什么是用于重构文本的简单网页编译器?
我想要一个基于 html 的静态网站,其中包含一些(很少更新)页面,而不是博客/cms。我认为更新它们的最简单方法是将源代码保留为 ReST 之类的格式,并在每次更新时进行编译。对于这种用途,推荐的编译器是什么?我想要有自己的主题/设计,除了正确的 ReST 语法之外我不需要任何东西(例如,Sphinx 就太多了)。
Instead of a blog/cms, I'd like to have a static html-based site with a few (rarely updated) pages. I figure the simplest way to update them is to keep the sources in a format like ReST, and compile it each time it updates. What is a recommended compiler for this usage? I'd like to have my own theme/design and I don't need anything beyond the proper ReST syntax (Sphinx is too much, for example).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Makefile 将是一个很好的解决方案。这是一个快速模板 makefile
然后只需在包含文件的目录中运行
make
即可从第一个文件生成 htmlA Makefile would be a good solution to do this. Here's a quick template makefile
Then just run
make
in the directory with your files to generate the html from the rstrest2web 可能更适合您正在寻找的东西。
rest2web might be more the sort of thing you're looking for.
如果您不一定需要重组文本,但 Markdown 或 Textile 也可以,那么请查看 jekyll。
我自己用的。竖起大拇指。
If you dont necessarily need restructured text, but markdown or textile is just as fine, then check out jekyll.
I use it myself. Thumbs up.
我使用 nanoc3 以及 docutils (通过 sphinx 安装)在静态站点生成器中启用良好的重构文本支持。我已经研究过(并且想使用)纯Python解决方案(hyde),但nanoc允许更干净的ReST源文件。
我也考虑过使用 sphinx 来生成静态站点,但是如果不滚动大量代码来支持它,做到这一点并不容易。
如果您仍然对此主题感兴趣,我很乐意详细介绍如何准确地执行此操作。它基本上是使用 docutils 从源代码中输出 html。我有一个简单的 nanoc 处理器可以执行此操作:
rest.template 文件基本上是一个虚拟模板,具有以下单行:
I use nanoc3 along with docutils (via a sphinx install) to enable nice restructuredtext support in a static site generator. I've looked at (and would like to use) a pure python solution (hyde) but nanoc allows for cleaner ReST source files.
I've also considered using sphinx to produce a static site, but it's not as easy to do this without rolling a lot of code to support it.
I'm happy to detail how to do this precisely if there is still interest in this topic. It's basically using docutils to output html from the source rest. I have a simple nanoc processor that does this:
The rest.template file is basically a dummy template with the following single line:
您可能想使用静态站点生成器。有十亿个......
https://www.staticgen.com/
You may want to use a static site generator. There's a billion of them…
https://www.staticgen.com/