Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New spx2html features for Tectonopedia #1016

Merged
merged 39 commits into from
Mar 29, 2023

Conversation

pkgw
Copy link
Collaborator

@pkgw pkgw commented Mar 29, 2023

These are various major changes and improvements needed for the Tectonopedia project to do its fancy HTML emission.

Transport the code that deals with a document's ensemble of font
families into its own file. There is a lot of code churn here, but I've
compared the before-and-after HTML output with the tt-weave documents
weave.web and xetex.web, and there are no changes besides some places
where `/` and `'` become `/` and `'`.

This is motivated by my plan to serialize the "assets" generated/used by
a spx2html runs, but it also helps with some of the algorithms. By
separating the "fonts" and "content" into separate substructures of the
state, we can tidy up some of the algorithms with regards to
simultaneous mutability.
After the literal split, we can go back and tidy up this stuff. This
mostly adds docstrings but also homogenizes things a bit.
Which is the sensible thing to do.
This is the obviously sensible way to do things. It was just difficult to implement
before refactoring the shared behavior into individual data structures.
Still need to figure out API and whether our serialization actually works.
This isn't yet complete, but should provide the first part of the
"precomputed assets" mode that we'll use to be able to process lots of
separate inputs to a standardized HTML output format.
I think that serde tries to work around this, but it appears to be a common
issue that its workarounds can fail.
Try to have the important internal state linked to the "inner" Font state,
not the TeX font. We'll need this to be able to load precomputed fonts that
don't actually show up in the SPX file.
…t loaded

We need to do this to ensure that we can output all of the font assets
at the end of the run, if needed. This depends on a bunch of the
internal reorganizations that I've been doing with font loading. It
still feels pretty messy to me, but I think it's now working.
We'll see if this becomes a long-term choice, but it's looking like it is
going to be better to handle paragraph tags at the LaTeX level with the new
2022 paragraph hook features.
Not 100% sure about the positioning here but in my one test, it's looking good!
…ification

This is a quasi-hack to support the Tectonopedia build framework.
We have to jump through some annoying hoops to serialize all of our
hashmaps with sorted keys, but we need this so that we're not always
rebuilding everything in Pass 2 in Tectonopedia whenever anything
changes, since without the explicit sorting, the order of everything in
the maps will change from one invocation to the next.
@codecov
Copy link

codecov bot commented Mar 29, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@40214f0). Click here to learn what that means.
The diff coverage is 0.83%.

❗ Current head 0b9a085 differs from pull request most recent head 887e8e1. Consider uploading reports for the commit 887e8e1 to get more accurate results

@@            Coverage Diff            @@
##             master    #1016   +/-   ##
=========================================
  Coverage          ?   44.77%           
=========================================
  Files             ?      155           
  Lines             ?    62698           
  Branches          ?        0           
=========================================
  Hits              ?    28076           
  Misses            ?    34622           
  Partials          ?        0           
Impacted Files Coverage Δ
crates/engine_spx2html/src/assets.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/emission.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/finalization.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/fontfile.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/fonts.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/initialization.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/lib.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/specials.rs 0.00% <0.00%> (ø)
crates/engine_spx2html/src/templating.rs 0.00% <0.00%> (ø)
crates/engine_xetex/xetex/xetex-xetex0.c 78.79% <ø> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pkgw pkgw merged commit cd1733f into tectonic-typesetting:master Mar 29, 2023
@pkgw pkgw deleted the pedia-features branch March 29, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant