Whole site compilation of markdown/pandoc? [closed]

只愿长相守 提交于 2019-12-02 18:24:06

Some static site generators that work with Markdown:

I think none of them use pandoc (maybe because it's written in Haskell), but they all use an enhanced Markdown syntax or can be configured to use pandoc.

Other interesting ways to generate a site from markdown:

  • Markdown-Wikis that are file based: f.ex. Gollum, the Wiki-Engine that is also used by GitHub
  • Telegram: commercial; written by David Pollak, the inventor the Lift-Scala-framework

Engines that use Pandoc:

The definitive listing of Static Site Generators

A good overview of static site generators: http://staticsitegenerators.net/

Pandoc, the GNU make and sed commands, sprinkled with some CSS are all you need to fully automate the creation of a static website starting from Markdown.

Pandoc offers three command line options which can provide navigation between pages as well as the creation of a table of contents (TOC) based on the headings inside the page. With CSS you can make the navigation and TOC look and behave the way you want.

-B FILE, --include-before-body=FILE

Include contents of FILE, verbatim, at the beginning of the document body (e.g. after the tag in HTML, or the \begin{document} command in LaTeX). This can be used to include navigation bars or banners in HTML documents. This option can be used repeatedly to include multiple files. They will be included in the order specified. Implies --standalone.

--toc, --table-of-contents

Include an automatically generated table of contents.

--toc-depth=NUMBER

Specify the number of section levels to include in the table of contents. The default is 3 (which means that level 1, 2, and 3 headers will be listed in the contents).

As a matter of fact, my personal website is built this way. Check out its makefile for more details. It is all free-libre open-source licensed under the GNU GPL version 3.

If you're OK not using Pandoc, mkdocs would seem to fit your needs.

If you definitely want to use Pandoc-flavoured Markdown, you could check out pdsite. I wrote it as a way to get mkdocs-style site generation with more input formats (like emacs org-mode) and without the Python dependencies - you pass in a folder of Markdown files and get out an HTML site (including automatically-generated multi-level navigation links). It's similar to Serge Stroobandt's approach in that it's just a shell script (it does require you to have tree installed however). Unfortunately it doesn't have a search function yet, although that wouldn't be too hard to add...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!