feat(web): export static wiki artifacts - #418
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ed166d0a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <!doctype html> | ||
| <html lang="en" data-theme="light"> | ||
| <head> | ||
| <base href="/" /> |
There was a problem hiding this comment.
Keep relative links scoped to the active repo
With this global <base href="/">, any wiki content link that is intentionally relative to the current repo route stops resolving against /<repoId>. For example, WikiBuilder emits module links like ?p=mod__..., and the right-rail uses #heading; after this tag those resolve to /?p=... or /#heading (or the static mount root) instead of the current wiki page, so clicking generated module or in-page navigation links drops the user onto the landing/root route rather than switching sections.
Useful? React with 👍 / 👎.
| forbidden_paths: Iterable[Path], | ||
| environ: Mapping[str, str], | ||
| ) -> None: | ||
| forbidden = [str(path.resolve()).encode("utf-8") for path in forbidden_paths] |
There was a problem hiding this comment.
Reject JSON-escaped Windows paths too
When exporting on Windows, forbidden checkout paths contain backslashes, but all page and manifest JSON is written via json.dumps, which serializes those backslashes as escaped characters. This scan only searches for the raw path bytes, so a citation snippet or metadata field containing a drive-letter checkout path can pass _assert_publishable and still be published despite the no build-machine-path guarantee; include the JSON-escaped form or inspect decoded JSON before accepting the export.
Useful? React with 👍 / 👎.
Mount only document startup assets at the Pages base path so generated query and hash links keep browser-relative semantics. Detect JSON-escaped build paths during publication validation.
047c3c4 to
d11e97b
Compare
Summary
Add a versioned, deterministic static Wiki export for an existing manifest-backed repository.
The export targets GitHub Pages and other serverless hosts. It preserves repository and view provenance while exposing only capabilities with a real browser-side implementation. Closes #416 and advances H1 of #415.
Changes
codenib export <repo>with output and Pages mount-path optionscodenib-static.jsonwith repository identity, commit, source fingerprint, source-location semantics, view provenance, generation metadata, and per-file SHA-256 digestsType of Change
Testing
Tests pass locally
Added new tests for the changes
unit tier: 2546 passed, 10 skipped
static export: 17 passed after the final restack
frontend: 19 passed; production build completed
strict MkDocs build
pre-commit run --all-files
real
pallets/itsdangerous@672971d6export mounted at/itsdangerous: Playwright loaded the overview route at/itsdangerous/itsdangerouswith no console or resource errorsdesktop and 390px mobile captures plus direct deep-link smoke
Checklist