5 ms·
Does anyone know of anything similar in a more popular language, like Python? In particular, what I dislike about all other static generators is they come with
by CJefferson 7y ago
Does anyone know of anything similar in a more popular language, like Python?
In particular, what I dislike about all other static generators is they come with their own templating language, which is usually limited, stupid and broken in various ways. I just want to mix Python and Markdown, but have the code replaced with its output, to make it easy to build more complicated structures.
Maybe I'll just write something myself...
- mbar84 7y agoI'm working pretty much exactly on that. It's not at all fit for consumption yet though. This is a file I'm using for testing: https://gitlab.com/mbarkhau/litprog/blob/master/lit_v3/11_overview.md https://gitlab.com/mbarkhau/litprog/blob/master/lit_v3/11_ov...
- bayesian_horse 7y agoPointers: paged.js for paged-media polyfills. Sphinx (you can customize the layout). Static page generators. In general, you'll want javascript-assisted solutions working in the browser, and then some pre-processing in Python, depending on your needs.
- jboynyc 7y agoPerhaps pweave, which is like knitr for Python. http://mpastell.com/pweave/ http://mpastell.com/pweave/
- raizinho 7y agoThere's bookdown in R which is great. https://bookdown.org/yihui/bookdown/ https://bookdown.org/yihui/bookdown/
- criddell 7y agoIf you want to publish on the web, why not give Pollen a try (I'm assuming you haven't)? It isn't really a static generator, but the end result is similar. It's a pretty neat system and worth learning before you head off to invent your own wheel.
- CJefferson 7y agoI tried pollen, but I just don't have room for another language in my head I'm only going to use for one purpose, and I felt the cool features were around the combination of text and code, not the racket/lisp part.
- criddell 7y agoNot a fan of DSL's? I err on the other side of that coin and tend to produce them even when it may be overkill.
- gpoore 7y agoI've created https://github.com/gpoore/codebraid https://github.com/gpoore/codebraid for running Python in Pandoc Markdown. It's written in Python and focused on executing Python code, though it also supports Julia, R, Rust, Bash, and JavaScript. It operates on the Pandoc AST, so there are no Markdown preprocessor issues and there's no custom Markdown syntax.
- velcrovan 7y agoInterestingly, the author of Pollen attempted to write it in Pollen first, then switched to Racket. > “I wrote the initial version of Pollen in Python. I devised a simplified markup-notation language for the source files. This language was compiled into XML-ish data structures using ply (Python lex/yacc). These structures were parsed into trees using LXML. The trees were combined with templates made in Chameleon. These templates were rendered and previewed with the Bottle web server. > “Did it work? Sort of. Source code went in; web pages came out. But it was also complicated and fragile. Moreover, though the automation was there, there wasn’t yet enough abstraction at the source layer. I started thinking about how I could add a source preprocessor.” [1] https://docs.racket-lang.org/pollen/Backstory.html#%28part._.Rethinking_the_solution_for_digital_books%29 https://docs.racket-lang.org/pollen/Backstory.html#%28part._...