Skip to content

Port README content into examples/README.jl#21

Merged
mtfishman merged 2 commits intomainfrom
mf/visbase-readme
Apr 25, 2026
Merged

Port README content into examples/README.jl#21
mtfishman merged 2 commits intomainfrom
mf/visbase-readme

Conversation

@mtfishman
Copy link
Copy Markdown
Member

@mtfishman mtfishman commented Apr 25, 2026

Summary

  • The previous examples/README.jl was the bare ITensorPkgSkeleton template stub (added to unblock the docs build, since make_index! requires that input file). Every itpkgfmt run regenerated README.md from the stub, which was about to wipe the actual usage prose and @visualize examples that lived in README.md on main — see Automatic ITensorFormatter run #18 for the regeneration that captured the deletion.
  • This PR moves the description, the UnicodePlots contraction example, the GLMakie backend example, and the backend-switching session into examples/README.jl as Literate input. The contraction setup and both @visualize calls are bare Julia so they execute as part of the shared ITensorPkgSkeleton.runtests examples sweep. Output blocks (ASCII art, GLMakie window snippet, julia> prompts) stay wrapped in #= ... =# so they pass through as raw markdown without trying to execute.
  • Image references switch to absolute raw.githubusercontent.com URLs so the same source renders correctly in both README.md and docs/src/index.md.

Closes #18.

mtfishman and others added 2 commits April 25, 2026 10:20
The previous examples/README.jl was the bare ITensorPkgSkeleton template
stub (added in 7a79fb5 to unblock the docs build), so every itpkgfmt run
regenerated README.md as the empty stub, wiping the actual usage prose
and `@visualize` examples that lived in README.md on main.

Move the description, the UnicodePlots contraction example, the GLMakie
backend example, and the backend-switching session into examples/README.jl
as runnable Literate input. The contraction setup and both `@visualize`
calls are now bare Julia so they execute via the shared
ITensorPkgSkeleton.runtests examples sweep; the ASCII output, GLMakie
window snippet, and `julia>` prompt blocks remain wrapped in `#= ... =#`
so they pass through as raw markdown without trying to run. Image
references switch to absolute raw.githubusercontent.com URLs so the same
source renders correctly in both README.md and docs/src/index.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Dropped accidentally in the previous commit; the template structure
expects it before the usage prose.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mtfishman mtfishman enabled auto-merge (squash) April 25, 2026 14:30
@mtfishman mtfishman merged commit b5f7eec into main Apr 25, 2026
12 of 13 checks passed
@mtfishman mtfishman deleted the mf/visbase-readme branch April 25, 2026 14:30
mtfishman added a commit that referenced this pull request Apr 25, 2026
## Summary

- The README port in #21 split the runnable Julia in
`examples/README.jl` into two bare-Julia code blocks (imports, then
setup + `@visualize` calls) separated by prose. Literate's
`DocumenterFlavor` turned each into its own `@example index` block in
`docs/src/index.md`. Inter-block state did not propagate on the
Documentation CI runner, so `Index` was undefined when the second block
ran. Independently, `docs/Project.toml` was missing `ITensors` as a
dependency — so even a single-block setup couldn't have resolved `using
ITensors: Index, random_itensor` during the Documenter build.
- Consolidate the runnable Julia in `examples/README.jl` into one
bare-Julia block so it lands as a single `@example index` block in
`index.md`. Both `@visualize` calls now sit together; the surrounding
prose was rearranged so the lead-in still flows.
- Add `ITensors` to `docs/Project.toml` `[deps]` and `[compat]`
(matching the root `Project.toml` compat range) so the Documenter build
can resolve the import.
- Bump `Project.toml` patch version 0.1.16 → 0.1.17.

Verified locally: `docs/make.jl` now completes successfully, and
`include("examples/README.jl")` from the test environment still runs the
example through the no-op default backend.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant