Skip to content

MKdocs rather than Ldoc for documentation generation#32

Merged
nhartland merged 11 commits into
masterfrom
mkdocs
Mar 22, 2026
Merged

MKdocs rather than Ldoc for documentation generation#32
nhartland merged 11 commits into
masterfrom
mkdocs

Conversation

@nhartland
Copy link
Copy Markdown
Owner

No description provided.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 22, 2026

Pull Request Test Coverage Report for Build 23412252188

Details

  • 9 of 12 (75.0%) changed or added relevant lines in 4 files are covered.
  • 36 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.04%) to 98.169%

Changes Missing Coverage Covered Lines Changed/Added Lines %
forma/neighbourhood.lua 1 2 50.0%
forma/pattern.lua 3 5 60.0%
Files with Coverage Reduction New Missed Lines %
forma/neighbourhood.lua 1 97.83%
forma/raycasting.lua 1 98.39%
forma/pattern.lua 9 98.42%
forma/multipattern.lua 25 71.91%
Totals Coverage Status
Change from base Build 23107363738: -0.04%
Covered Lines: 2091
Relevant Lines: 2130

💛 - Coveralls

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the project’s documentation pipeline from LDoc to MkDocs Material, generating API and example pages from LuaLS annotations and the examples/*.lua sources, and updates CI accordingly.

Changes:

  • Add MkDocs configuration + a Lua-based extraction pipeline (docs/extract.lua and helpers) to generate docs/api and docs/examples.
  • Convert/augment module docstrings to LuaLS-style annotations and adjust examples/tests to align with the new tooling/type-checking.
  • Remove LDoc-specific assets/config and update GitHub Actions workflows for docs builds and Lua type-checking.

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/subpattern.lua Adds an assertion to ensure Voronoi seed selection is non-nil during tests.
tests/pattern.lua Tightens iterator expectations with assert(...) and suppresses a LuaLS diagnostic in a test.
tests/cell.lua Simplifies clone equality assertions.
mkdocs.yml Introduces MkDocs Material configuration and site navigation.
ldoc.css Removes LDoc styling (no longer needed).
forma/raycasting.lua Updates documentation comments to LuaLS-style annotations and improves formatting/examples.
forma/primitives.lua Adds LuaLS annotations and fenced usage examples for primitives API.
forma/pattern.lua Large doc/annotation modernization; adds several defensive assert(...) calls; updates section markers for doc generation.
forma/neighbourhood.lua Adds LuaLS annotations; renames internal category label storage to _category_label.
forma/multipattern.lua Adds LuaLS annotations and modernizes doc examples.
forma/cell.lua Adds LuaLS annotations and fenced usage examples.
forma/automata.lua Adds LuaLS annotations and converts usage blocks to fenced examples.
examples/sampling.lua Fixes typo and updates commented Voronoi-relax invocation style.
examples/gallery.lua Removes old LDoc gallery generator script.
examples/README.md Removes pre-generated example gallery markdown (now generated via MkDocs pipeline).
docs/index.md Adds MkDocs home page content (now README-like landing content).
docs/index.html Removes old HTML redirect (LDoc-era).
docs/getting-started.md Adds a new MkDocs “Getting Started” guide.
docs/extract/rockspec.lua Adds helper to extract public module names from the rockspec.
docs/extract/examples.lua Adds generator to turn examples/*.lua into MkDocs pages (with image inclusion).
docs/extract/api.lua Adds generator to turn LuaLS doc.json into per-module API markdown.
docs/extract.lua Adds the top-level docs generation script (LuaLS doc export + API/examples generation).
docs/README.md Removes old docs folder note (LDoc-era).
config.ld Removes LDoc configuration.
README.md Updates documentation regeneration instructions to docs/extract.lua + mkdocs build.
CHANGELOG.md Notes the migration to MkDocs and LuaLS annotations; reflows bullets.
.luarc.json Adds LuaLS config (sets runtime to Lua 5.1).
.ldoctest Removes LDoc test environment file.
.gitignore Ignores MkDocs build output and generated docs artifacts.
.github/workflows/tests.yaml Adds a Lua type-check job alongside tests/coverage.
.github/workflows/documentation.yaml Replaces LDoc build steps with LuaLS + MkDocs build and publishes site/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread forma/pattern.lua Outdated
Comment thread docs/extract.lua
Comment on lines +16 to +20
-- Generate LuaLS doc.json
os.execute("mkdir -p docs/source")
assert(os.execute("lua-language-server --doc=. --doc_out_path=docs/source"),
"lua-language-server failed (is it installed?)")

Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert(os.execute(...)) does not reliably detect failures on Lua 5.1 because os.execute returns a numeric exit status (non-zero is still truthy). This can cause docs/extract.lua to continue even when lua-language-server fails. Consider normalizing os.execute results (handle both Lua 5.1 numeric status and Lua 5.2+ boolean/exit-code returns) and erroring on non-zero exit codes with a clear message.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@nhartland nhartland merged commit 87f7684 into master Mar 22, 2026
8 checks passed
@nhartland nhartland deleted the mkdocs branch March 22, 2026 20:54
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.

3 participants