Skip to content

Add MATLAB live script documentation support#172

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/document-livescript-support
Draft

Add MATLAB live script documentation support#172
Copilot wants to merge 5 commits intomainfrom
copilot/document-livescript-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 5, 2026

Adds documentation rendering for MATLAB live scripts (.mlx binary format and R2025a plain-text .m format), invoked by relative file path from the config file. Comment blocks become documentation text; code blocks become highlighted MATLAB code.

Changes

Collection (handler.py)

  • Detects path-based identifiers: any identifier ending in .mlx or containing / pointing to a .mlx/.m file is parsed via maxx.livescript.LiveScriptParser rather than the MATLAB symbol lookup
  • Passes new parse_live_scripts config flag through to PathsCollection

Configuration (config.py)

  • New parse_live_scripts: bool = False option — enables indexing .mlx files in PathsCollection so they can also be referenced by stem name

Rendering (rendering.py, live_script.html.jinja)

  • New do_strip_livescript_comments filter strips %/% prefixes from R2025a comment lines before markdown conversion (no-op for binary .mlx text content, which is already clean)
  • New live_script.html.jinja template iterates live_script.sections, rendering "text" sections via convert_markdown and "code" sections via highlight(language="matlab")
  • AutorefsHook.get_context() handles the live_script object kind

Usage

# In any MkDocs page:
::: notebooks/demo.mlx
::: notebooks/analysis.m   # R2025a plain-text live script

Copilot AI linked an issue Apr 5, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits April 5, 2026 09:55
Agent-Logs-Url: https://github.com/watermarkhu/mkdocstrings-matlab/sessions/801aea9f-d24b-44db-8b4f-1712677763f0

Co-authored-by: watermarkhu <18556882+watermarkhu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation support for MATLAB livescript Add MATLAB live script documentation support Apr 5, 2026
Copilot AI requested a review from watermarkhu April 5, 2026 09:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

Test Results

0 files   -    10  0 suites   - 10   0s ⏱️ - 1m 22s
0 tests  -   252  0 ✅  -   252  0 💤 ±0  0 ❌ ±0 
0 runs   - 2 520  0 ✅  - 2 520  0 💤 ±0  0 ❌ ±0 

Results for commit 33e8871. ± Comparison against base commit 29343cd.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

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.

Document livescript

2 participants