n8willis / opentype-shaping-documents

Documentation of OpenType shaping behavior
161 stars 15 forks source link

[WIP] Static HTML output with Sphinx #154

Closed n8willis closed 1 year ago

n8willis commented 1 year ago

This is an attempt to make the document set buildable, locally, as static HTML pages, so that they can be easily used outside of the GitHub web interface.

Obviously there are some bits still to be hammered out, mainly getting the MyST markdown parser to play nicely with the RestructuredText automatic-Table-Of-Contents magic. But, at the moment, the files in the _build/html/ directory should be correctly linked together and readable while offline.

Comments and suggestions on the CSS and HTML are welcome! Looking at it, the tables and code blocks need some attention. Other itches probably need scratching, too.

n8willis commented 1 year ago

Putting this open for review now!

This branch adds a Sphinx-based local HTML page-set as the output for the documents.

Feedback wanted about output

It is important to know about everything that breaks, however, the most important thing at this stage is how well the generated HTML pages work.

There is a lot of tweaking and formatting involved in the page output, and because the formatting affects the semantics of the docs for people who read them, ambiguities and confusing things really need to get caught. So, in all seriousness, no minor nitpick is too small.

A couple of specific things to call out:

The Bengali document previews some deeper changes than the others

You can start there if you want to see those. Namely:

It uses local copies of the Source fonts

This branch started out using the Souce Serif/Sans/Code family from Adobe be Google Fonts, but the static versions served remotely didn't allow for tweaking the CSS well enough or using some of the features. So, instead, the variable-font files are included in the build _static tree. They have their own license (OFL), which is included in the folder.

Numbering everything is not easy

I believe that having per-section numbering of things is critical to new readers keeping track of where they are and to how people reference or talk about things. It is proving kind of tricky to get Sphinx to follow orders in that regard, however.

In particular, the "shaper" section docs themselves are nested for Indic2 and Arabic-like, and I haven't yet gotten the multitoc-numbering extension to behave. It looks like it's breaking on double-nested subtrees being the top item of a TOCtree, but I haven't yet tried to dig in. There is an open issue on that upstream with the extension here: https://github.com/executablebooks/sphinx-external-toc/issues/89 ... which looks like it's not getting active looks. So if you want to dive in to that, separate from all the HTML juggling, that'd potentially be worthwhile.

Regardless, feedback on whether or not the numbering is useful would be helpful (remember to compare Bengali and other docs, though, due to the change mentioned above)