Heck you can even integrate a full-on requirements management system in them using sphinx-needs https://sphinx-needs.readthedocs.io/en/latest/
Heck you can even integrate a full-on requirements management system in them using sphinx-needs https://sphinx-needs.readthedocs.io/en/latest/
Also works with HTML documents produced in other ways.
Also if you're going to embed a giant binary blob, please ship way to extract it.
Not a bad idea, thanks for the suggestion.
I always thought CHM files were a nice self-contained option for multi-page HTML docs. (Though they'd happily execute whatever JavaScript the author embedded in there... Maybe that's why they fell out favor?)
Particularly because of the text-to-speech engine features.
Wait: also, how is what you're saying different from the built-in singlehtml builder? https://www.sphinx-doc.org/en/master/usage/builders/index.ht...
Check out the CPython docs for example: https://adrianvollmer.github.io/Zundler/output/cpython.html
This is a huge document, and having this all rendered naively in one single page will not only be hard to navigate, it will also feel really sluggish if not crash the browser.
For my use cases, the default multi-file HTML builds are ok, and I just pound out a latex-builder generated PDF for the archives.
Getting data from my Python analysis into the reports are tedious at best and updating numbers last minute is hair pulling frustrating.
But because of the good wysiwyg I can cheat on my adjustments when I need a graph to go “just there”, I can edit my paragraph wording such that I don’t get a almost completely blank page in between sections, etc, etc which is important to make a good looking report, imho.
How do you go about that with rst? I’d love to write a templates rst file that can be fed from my excel sheets and Python scripts, but how do I go about final layout adjustments?
Another (non-Sphinx) thing you can do is just write (portions of) your docx reports directly from Python using python-docx [1]. I use this approach when people give me strict docx templates that need to be filled in from Python in a very specific way. It can drop data-generated tables in at special placeholder sections and everything.
[1] https://python-docx.readthedocs.io/en/latest/
I will say that I've been more and more happy with just using sphinx straight to pdf for very professional looking reports. Given some latex preamble work in the config you can get it looking quite nice. I haven't personally struggled recently with too many egregious formatting issues on the sphinx-built latex stuff. You do have to swap over to landscape mode for large tables, etc. so it takes some work. But you're right that in many cases, formatting issues do still happen, so YMMV.
Another neat trick in sphinx is the csv-table directive [2], which loads table data directly from a csv file you have around, which you can obviously get from your xlsx.
[2] https://docutils.sourceforge.io/docs/ref/rst/directives.html...
Typora uses pandoc to do the conversion. My reports are mainly text, charts, and lots of math formulae and it works great. You don't get fine adjustment of layout, but I find that a feature not a bug. I see so many people waste time to put a figure in just the right place. It doesn't matter. The goal is clear information transfer so just get the figure in the doc where it makes sense and go on.
It senses changes to any file and auto-updates the doc lightning fast - it's far better than LaTeX IMO
Though I too like typst and am subscribed to their Github issue for HTML export, that maybe some day will be available.
1. Great markdown editor with both source and WYSIWYG views
2. Render to a wide range of formats including html, pdf, epub, docx
3. Generate books, web sites, single page docs, presentations
4. Incorporate code (like jupyter) except the source is plain text with fenced blocks
5. Supports code in a number of languages including Python and R.
6. Can use other editors too (iirc there's a plugin for VS Code though never tried it).
7. Built in support for MathJax for mathematical formulae and Mermaid for text-based diagramming with auto inline preview
I prefer it to Word for writing and jupyter for notebooks. No affiliation to Posit, the company that develops both Quarto & RStudio. Just a fan of the products.
--
[0]: https://quarto.org/ [1]: https://posit.co/download/rstudio-desktop/
[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/...
Looks like AsciiDoc supports similar latex math blocks [2]. Are there reasons you can't stick with that when doing math?
[2] https://docs.asciidoctor.org/asciidoc/latest/stem/#block
[1] https://pandas.pydata.org/docs/reference/api/pandas.DataFram...
[2] https://github.com/astanin/python-tabulate/blob/master/tabul...
MyST-Markdown supports MathJaX and Sphinx roles and directives. https://myst-parser.readthedocs.io/en/latest/
jupyter-book supports ReStructuredText, Jupyter Notebooks, and MyST-Markdown documents:
You can build Sphinx and Jupyter-Book projects with the ReadTheDocs container, which already has LaTeX installed: https://github.com/executablebooks/jupyter-book/issues/991
myst-templates/plain_latex_book: https://github.com/myst-templates/plain_latex_book/blob/main...
GitHub supports AsciiDoc in repos and maybe also wikis?
Is there a way to execute code in code blocks in AsciiDoc, and include the output?
latex2sympy requires ANTLR.
Typst is better IMO
I've not used Typst and not authored much LaTeX (but worked on a project with a group of scientists who used nothing but LaTeX) and can see obvious advantages to Typst. Same with many, many other Rust libraries.
They never imagine that people choose Rust for something they want to implement anyway and not just to replicate something existing, that they do not want to use since it's not implemented in Rust????
- Ah, you got me good you meddling kids!
jamiedumont was talking to himself again.
hackerbod slowly leaned over and squinted at the screen.
- Uh Typst?
- Yeah! It’s a typesetting markup language. It’s supposed to be better than things like latex.
- Ok. What’s so funny about it?
- Oh hehe, it’s written in—guess what?
- I dunno?
- Rust!
jamiedumont started giggling but hackerbod remained neutrally unamused.
- Oh come on! Rewrite in Rust? Language zealots? Young adults who can’t program without some Ruby syntax sprinkled in?
- So this “typt” thing—
- Typst.
- Right, Typst, this typesetting thing was created to promote Rust in some way?
- Oh I don’t think so.
- It doesn’t mention Rust on the homepage or something? You know, Written in Rust?
- Nope. Not to my recollection.
- So is it a rewrite of something else in—
- Nope.
- So then what does that have to do with—
- Ah, but you’re missing the bigger picture, hackerbod.
- Ok.
- Year after year of this eye-rolling promotion and nagging, blah blah blah memory unsafety is bad, blah blah this is why we used angle brackets for generics, and these sly bastards went and pulled off the most epic Trojan Horse that I’ve ever seen been—
- And what’s that?
- They made an actually useful language!
hackerbod had to scoot back as jamiedumont fell off his swivel chair because he was laughing so hard. hackerbod scratched his head.
jamiedumont finally recovered from the ab-induced euphoria.
- Ah hackerbod, I hate to admit it but they got me good! Those cursed language zealots got one over on me!
A rewrite in Rust can be good for those reasons, as it removes the "cruft" of old implementation, but also gets the nice properties of speed and such.
But ultimately the thing I love most about Rust is not even the safety and such - it's the package management and build system. Just look at the horrible python/js scene for how bad packaging and build systems can be, and you'll understand why that basic uniform experience can be so nice.
And it's really tweakable, especially with html output where you can provide your own templates, or add in your own CSS/scripts even manual tags.
E.g. I don't care about a configurable formatting for bibliography, but I would want a pre-made template that implements the APA bibliography guidelines with all the tiny nuances correctly. I don't want to configure margins for columns, I want a template that does the IEEE formatting standard exactly. (95% compatibility doesn't work, if a single missing feature means the tool can't produce the required document because it's wrong at one spot on page 3, then I'd need to abandon the tool and pick something that works). And crucially, I want the separation between content and formatting so that I can easily take a blob of content that was formatted for one layout and just copy it in a completely different template and have it match the new formatting guidelines, e.g. automatically moving all the image captions to the other side, changing how they're numbered and referenced, etc.
Latex has all this baggage solved, almost everyone who wants a specific format from me will provide a Latex template with their weird typesetting fetishes included, and I just need to provide the content - while any upcoming tool has an uphill battle to become compatible and provide the same things, at the very least pre-made (and well made) templates for all the major formats (each discipline of science generally uses something different).
I have enjoyed including inline code using the literal-include directive, which allows you to just include sections of code directly from a file in disk. This is great because you can cover your example code with unit tests while also talking about it in docs without replication. You can even use little border comments to mark snippet sections so that it's not sensitive to specific line numbers.
https://www.sphinx-doc.org/en/master/usage/restructuredtext/...