Skip to content

Formatting of Julia code in Markdown files#197

Merged
fredrikekre merged 1 commit into
masterfrom
fe/markdown
Apr 22, 2026
Merged

Formatting of Julia code in Markdown files#197
fredrikekre merged 1 commit into
masterfrom
fe/markdown

Conversation

@fredrikekre
Copy link
Copy Markdown
Owner

Extend Runic to format Julia code blocks inside Markdown (.md) files. The file dispatch is by extension: runic foo.md (or Runic.format_file("foo.md")) formats only the embedded Julia code blocks (same rules as --docstrings), leaving the surrounding prose untouched. Stdin can be routed through the Markdown formatter by passing --stdin-filename=*.md.

Directory walks are controlled by a new --extensions=<list> flag (default jl, e.g. --extensions=jl,md to walk both). Explicit file paths always bypass this filter. --lines is supported with block- granular semantics: any code block whose line range overlaps a --lines range is formatted in full; blocks outside are left untouched.

Closes #197.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 91.93548% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.85%. Comparing base (bae57a5) to head (069fc0f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/runestone.jl 69.23% 4 Missing ⚠️
src/main.jl 97.56% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
- Coverage   92.88%   92.85%   -0.03%     
==========================================
  Files           8        8              
  Lines        4032     4073      +41     
==========================================
+ Hits         3745     3782      +37     
- Misses        287      291       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Extend Runic to format Julia code blocks inside Markdown (`.md`) files.
The file dispatch is by extension: `runic foo.md` (or
`Runic.format_file("foo.md")`) formats only the embedded Julia code
blocks (same rules as `--docstrings`), leaving the surrounding prose
untouched. Stdin can be routed through the Markdown formatter by
passing `--stdin-filename=*.md`.

Directory walks are controlled by a new `--extensions=<list>` flag
(default `jl`, e.g. `--extensions=jl,md` to walk both). Explicit file
paths always bypass this filter. `--lines` is supported with block-
granular semantics: any code block whose line range overlaps a
`--lines` range is formatted in full; blocks outside are left
untouched.

Closes #197.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@fredrikekre fredrikekre merged commit 3e11fb2 into master Apr 22, 2026
11 checks passed
@fredrikekre fredrikekre deleted the fe/markdown branch April 22, 2026 09:35
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