Skip to content

Fix/diagram generation#15

Merged
JheisonMB merged 9 commits into
developfrom
fix/diagram-generation
Jun 12, 2026
Merged

Fix/diagram generation#15
JheisonMB merged 9 commits into
developfrom
fix/diagram-generation

Conversation

@JheisonMB

@JheisonMB JheisonMB commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

diagram generation

JheisonMB and others added 9 commits May 7, 2026 08:59
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>
@JheisonMB JheisonMB added the target:develop Targets the develop branch label Jun 12, 2026
@JheisonMB JheisonMB merged commit 2a4c35c into develop Jun 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target:develop Targets the develop branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant