Merged
Conversation
- Add SetAssetFS/AssetFS to ltml.Scope with per-scope storage and parent inheritance, so concurrent documents can carry different asset filesystems without sharing global state. - Add per-document rootScope to ltml.Doc; Doc.SetAssetFS sets the FS on this root scope, which all parsed element scopes inherit via the parent chain. - Update ltml.HasScope interface to include SetAssetFS and AssetFS. - Extend StdImage to resolve image bytes via the scope's asset filesystem when one is set and the Writer implements the data-based image methods; falls back to the file-path Writer methods for backward compatibility. - Add github.com/namsral/flag dependency for env-variable-aware flag parsing. - Implement ltml/server (package main): - config.go: Config struct + parseConfig using namsral/flag - overlayfs.go: per-request overlay FS (upper=uploads, lower=base-path) - render.go: LTML parse → SetAssetFS → ltpdf render → temp PDF - handler.go: multipart streaming, upload validation, lifecycle cleanup - main.go: http.Server wiring and startup - Add tests covering handler behaviour, overlay FS semantics, LTML FS threading, and request-temp-dir cleanup. https://claude.ai/code/session_01Fr7DT5rkqVCraSSSEFrWbV
Aligns with the rest of the command layout (cmd/render-ltml). https://claude.ai/code/session_01Fr7DT5rkqVCraSSSEFrWbV
overlayfs: sort ReadDir results by name (fs.ReadDirFS contract requires it) overlayfs: remove unused overlayFile type handler: require Content-Type multipart/form-data exactly, not multipart/* main: replace Go 1.22 method-routing syntax with a plain /render pattern; renderHandler already enforces POST and returns 405 for other methods https://claude.ai/code/session_01Fr7DT5rkqVCraSSSEFrWbV
Extract overlayfs.FS to internal/overlayfs so both commands share it. Rewrite cmd/render-ltml to use doc.SetAssetFS instead of os.Chdir: - Extra files are still symlinked into a temp dir, but the dir is presented as an fs.FS upper layer rather than the process working directory. - When an extra file has the same base name as an assets-dir file, the extra file silently shadows it (last -e flag wins on true name collisions). - No asset filesystem is set when neither -a nor -e are given, preserving backward-compatible behaviour for plain file-path rendering. Update cmd/serve-ltml/overlayfs.go to delegate to internal/overlayfs. Move detailed overlay tests from cmd/serve-ltml to internal/overlayfs. https://claude.ai/code/session_01Fr7DT5rkqVCraSSSEFrWbV
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.
No description provided.