Fix/diagram generation#15
Merged
Merged
Conversation
REGISTRY_REPO still targeted the old JheisonMB/texforge-templates, which only resolved via GitHub's 301 redirect. Point it at UniverLab/texforge-templates. Verified template list --all and template add download from the new registry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diagram pipeline (src/diagrams/mod.rs):
- Cache rendered PNGs by content hash ({env}-{hash}.png), skipping re-render of
unchanged diagrams across rebuilds (notably under --watch).
- Build the resvg font database once via a shared OnceLock instead of per diagram
(scanning /mnt/c/Windows/Fonts over WSL 9P was slow).
- Raise rasterization from 1.5x to 3x (~300 dpi at \linewidth) for print quality.
- Fix invalid default \includegraphics[\linewidth] -> width=\linewidth.
Windows / TLS:
- Use TECTONIC_BIN (tectonic.exe on Windows) for the managed binary path so the
installed tectonic is actually located and executable.
- Switch reqwest off aws-lc-rs to rustls+ring (rustls-no-provider + ring provider
installed in main), removing the C-toolchain dependency that broke Windows/musl
builds. Verified aws-lc-sys leaves the tree and HTTPS downloads still work.
Build/assets:
- Output the PDF as <title>.pdf in the project root from a temp build dir.
- Unify sanitize_filename in utils; clean removes the output PDF + legacy build/.
- mirror_assets symlinks nested assets next to .tex files (absolute targets).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrite the formatter to indent by real nesting depth — environments (\begin/\end) plus unbalanced braces/brackets — fixing nested environments that were left flush-left while their content floated deeper. The scan is comment- and escape-aware, paragraph text is never reflowed, and verbatim-like environments pass through untouched. The result is idempotent and non-semantic (formatted output yields a byte-identical PDF body). Also format .bib files: one field per line, 2-space indent, aligned `=`, lowercased entry types and field names, trailing comma after every field. Conservative — unparseable .bib files are returned unchanged rather than risk corrupting references. Wire both into `texforge fmt` via utils::find_bib_files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`texforge template list` now queries the remote registry by default so users discover available templates without knowing a flag exists. The old `--all` flag is replaced by `--local`, which restricts output to installed templates (and skips the network call). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire the existing (previously dead-code) placeholder resolver into
`texforge new`: parse the template's manifest, resolve {{name}} tokens
from defaults, project config, and user config, and substitute them in
generated .tex files. Lenient by design — unresolved tokens are left
untouched and non-.tex files (code samples, images) are copied verbatim,
so token-free templates like `general` are unaffected.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
diagram generation