Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 38 additions & 37 deletions packages/starlight-codeblocks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
# Changelog

## Unreleased

- `only` turns on only the features that it lists, and every other feature off: `codeblocks({ only: ['focus', 'codeTabs'] })`. With a feature that reads directives in comments, it also turns on `notation`
- Plugins of the package in `expressiveCode.plugins` take the place of the ones that `codeblocks()` adds, in place of a second copy. The plugins of `codeblocks()` go where the list has the first one, so other plugins can come after them (#36)
- Markdown plugins: `starlight-codeblocks/markdown` exports a Markdown plugin for each feature that changes Markdown, such as `mdastCodeTabs()`, and `mdastCodeblocks()` for all of them. `codeblocks()` adds only the ones that the Markdown processor does not already list, in the correct order among them. A listed plugin for a feature that is off stops the build (#36)
- Split diff: a **Unified** and **Split** switch in the title bar of each block that removes and adds lines. **Split** shows the old code on the left and the new code on the right, as a GitHub pull request does. `splitDiff.view`, `splitDiff.switch` and `splitDiff.sync` set the start view, remove the switch and stop it syncing across the page (#37)
- Untitled blocks with title bar controls use the tab bar colours of titled blocks (#37)
- Skipped code: `[!code skip]` on its own line shows a marker in place of code that a block leaves out, at the indentation of its line. The text after the directive goes in the marker, else it reads "Code not shown". The line keeps its line number, and copies as a comment with the text, such as `// Not shown: Imports`. A comment that holds only `...`, such as `// ...`, and `...` alone on a line in JSON, also show as markers and copy as written. `skippedCode.commentAliases` and `skippedCode.bareAliases` change these aliases for each language. `skippedCode: false` turns the feature off (#28)
- Run code: `runnable.args="<arguments>"` gives the code command line arguments. In Python, `sys.argv` holds the title of the block (else `main.py`) and the arguments, so a Click, Typer or argparse tool runs with no change to its code (#43)
- Run code: in Python, `sys.exit()` ends a run as it ends a program: with no `SystemExit` traceback, and with an exit message that is not a number on standard error. Before, `--help` in a Click command showed a traceback (#43)
- Run code: the `COLUMNS` environment variable of a Python run is the width of the output panel in characters, so help text from argparse and Rich fits the panel. Custom runtimes get `args`, `file` and `columns` in the options of `run()` (#43)
- Run code: a Python run with `runnable.outputLang=ansi` has `FORCE_COLOR=1` in its environment, so Rich, rich-click and Typer print colours with no hidden lines. Custom runtimes get `color` in the options of `run()`
- API links: a starlight-pydocs registry left over from an `astro dev` restart that removed starlight-pydocs from the config is dropped, so Python names no longer link to its old pages
## 1.5.0

- Split diff: new feature, a switch between unified and side-by-side views of a diff ([#37](https://github.com/ewels/starlight-codeblocks/pull/37))
- Skipped code: new feature, `[!code skip]` and `// ...` show a marker for left-out code ([#39](https://github.com/ewels/starlight-codeblocks/pull/39))
- Options: `only` turns on just the listed features ([#38](https://github.com/ewels/starlight-codeblocks/pull/38))
- Expressive Code plugins: listed plugins replace the ones `codeblocks()` adds ([#38](https://github.com/ewels/starlight-codeblocks/pull/38))
- Markdown plugins: exported from `starlight-codeblocks/markdown` ([#38](https://github.com/ewels/starlight-codeblocks/pull/38))
- Run code: `runnable.args` passes command line arguments, read by `sys.argv` in Python ([#43](https://github.com/ewels/starlight-codeblocks/pull/43))
- Run code: `sys.exit()` in Python ends a run with no traceback ([#43](https://github.com/ewels/starlight-codeblocks/pull/43))
- Run code: `COLUMNS` matches the width of the output panel ([#43](https://github.com/ewels/starlight-codeblocks/pull/43))
- Run code: `FORCE_COLOR` is set for Python runs with `runnable.outputLang=ansi` ([#47](https://github.com/ewels/starlight-codeblocks/pull/47))
- Code tabs: the block no longer moves when the tab changes ([#45](https://github.com/ewels/starlight-codeblocks/pull/45))
- Title bar: untitled blocks with controls use the tab bar colours ([#37](https://github.com/ewels/starlight-codeblocks/pull/37))
- API links: a stale starlight-pydocs registry is dropped after a dev restart ([#44](https://github.com/ewels/starlight-codeblocks/pull/44))

## 1.4.1

- Run code: `runnable.outputFile="<path>"` reads scripted output from a file at build time, with the path relative to the page. The block shows it from the start; `runnable` gives it the button. A `.ansi` file is in the `ansi` language. In `astro dev`, a change to the file reloads the page (#35)
- Run code: `runnable.static` with no output gives a build warning in a block without `runnable`. Before, it had no effect and no warning (#35)
- Run code: in `ansi` output, `\\e[` (and the `\\x1b[`, `\\033[` and `\\u001b[` forms) shows the text `\e[`, for output that prints it (#35)
- Run code: `runnable.outputFile` reads scripted output from a file ([#35](https://github.com/ewels/starlight-codeblocks/pull/35))
- Run code: `runnable.static` warns when the block has no output ([#35](https://github.com/ewels/starlight-codeblocks/pull/35))
- Run code: `\\e[` in `ansi` output shows as text ([#35](https://github.com/ewels/starlight-codeblocks/pull/35))

## 1.4.0

- Run code: `runnable.outputLang` and `[!output lang=…]` highlight scripted output in a language. With `ansi`, terminal colour codes show as colours, corrected for contrast in each theme, in scripted output and in the output of real runs (#32)
- Run code: `runnable.static` shows scripted output from the start, with no button and no JavaScript (#32)
- Run code: `[!run]` runs hidden code in place of the code that readers see, so a terminal block can show a command and run Python (#32)
- Run code: the output panel is a shade darker than the code, and long lines of output scroll sideways, as code does, instead of wrapping. The `wrap` attribute wraps them. The `codeblocksRunnable.outputFontFamily` and `outputLineHeight` style settings give the output its own font, such as one with box-drawing characters (#32)
- Run code: the output panel has no visible **Output** label, which screen readers still hear. The `outputLabel` option shows it (#32)
- Run code: `runnable.outputLang` and `[!output lang=…]` highlight scripted output, and `ansi` shows terminal colours ([#32](https://github.com/ewels/starlight-codeblocks/pull/32))
- Run code: `runnable.static` shows scripted output with no button and no JavaScript ([#32](https://github.com/ewels/starlight-codeblocks/pull/32))
- Run code: `[!run]` runs hidden code in place of the code that readers see ([#32](https://github.com/ewels/starlight-codeblocks/pull/32))
- Run code: long output lines scroll in place of wrapping, and new style settings set the output font ([#32](https://github.com/ewels/starlight-codeblocks/pull/32))
- Run code: the **Output** label is for screen readers only, unless `outputLabel` is set ([#32](https://github.com/ewels/starlight-codeblocks/pull/32))

## 1.3.0

- API links: the Nextflow adapter links process directives, input and output labels, global names such as `params`, and the scopes and process directives of config files. `nextflow="config"` marks a block as a config file (#22)
- Code walkthrough: `start` opens a walkthrough on a chosen step, and `walkthrough: { start: 'last' }` sets it for the site (#23)
- Run code: `[!output stderr]` prints scripted output as standard error, and `[!code highlight]` and the line states mark lines of output (#24)
- Run code: ranges on the fence line count lines of code only, not lines of scripted output, so a range after `[!output end]` can now mark another line (#24)
- Translations: the plugin texts are Starlight UI strings, with translations in 17 languages. A site changes them in `src/content/i18n/` (#25)
- API links: the Nextflow adapter links directives, labels, globals and config scopes ([#22](https://github.com/ewels/starlight-codeblocks/pull/22))
- Code walkthrough: `start` opens on a chosen step ([#23](https://github.com/ewels/starlight-codeblocks/pull/23))
- Run code: `[!output stderr]`, and line marks on lines of output ([#24](https://github.com/ewels/starlight-codeblocks/pull/24))
- Run code: ranges on the fence line count lines of code only ([#24](https://github.com/ewels/starlight-codeblocks/pull/24))
- Translations: plugin texts in 17 languages, as Starlight UI strings ([#25](https://github.com/ewels/starlight-codeblocks/pull/25))

## 1.2.0

- Squiggles: wavy error, warning and info lines under code, with a message on hover, focus or tap (#16)
- Callouts, code links: a `/text/` match prefers a whole word (#16)
- Squiggles: wavy error, warning and info lines under code, with a message on hover, focus or tap ([#16](https://github.com/ewels/starlight-codeblocks/pull/16))
- Callouts, code links: a `/text/` match prefers a whole word ([#16](https://github.com/ewels/starlight-codeblocks/pull/16))

## 1.1.0

- Astro: `starlight-codeblocks/astro` adds every feature to Astro sites without Starlight (#14)
- Docs: an example Astro site, and separate install pages for Starlight and Astro (#14)
- Integration: a change to the options clears cached Markdown pages (#13)
- Astro: `starlight-codeblocks/astro` adds every feature to Astro sites without Starlight ([#14](https://github.com/ewels/starlight-codeblocks/pull/14))
- Docs: an example Astro site, and separate install pages for Starlight and Astro ([#14](https://github.com/ewels/starlight-codeblocks/pull/14))
- Integration: a change to the options clears cached Markdown pages ([#13](https://github.com/ewels/starlight-codeblocks/pull/13))

## 1.0.1

- Swatches: `match` and `delimiters` options (#6)
- File icons: `false` turns icons off (#8)
- Callouts: bubble text is selectable (#11)
- Notation: warn on directives outside comments (#5)
- Annotations: notes open beside more markers (#12)
- Footnotes: text exports drop the numbers (#3)
- Swatches: `match` and `delimiters` options ([#6](https://github.com/ewels/starlight-codeblocks/pull/6))
- File icons: `false` turns icons off ([#8](https://github.com/ewels/starlight-codeblocks/pull/8))
- Callouts: bubble text is selectable ([#11](https://github.com/ewels/starlight-codeblocks/pull/11))
- Notation: warn on directives outside comments ([#5](https://github.com/ewels/starlight-codeblocks/pull/5))
- Annotations: notes open beside more markers ([#12](https://github.com/ewels/starlight-codeblocks/pull/12))
- Footnotes: text exports drop the numbers ([#3](https://github.com/ewels/starlight-codeblocks/pull/3))

## 1.0.0

Expand Down
2 changes: 1 addition & 1 deletion packages/starlight-codeblocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starlight-codeblocks",
"version": "1.4.1",
"version": "1.5.0",
"description": "A plugin for Starlight and Astro that adds focus, line states, comment notation, annotations, API auto-linking and more features to code blocks, on top of Expressive Code.",
"keywords": [
"withastro",
Expand Down
Loading