Skip to content

Commit 4da1752

Browse files
committed
Render ANSI sequences without transforming to HTML
1 parent 3c6444f commit 4da1752

File tree

12 files changed

+1080
-1742
lines changed

12 files changed

+1080
-1742
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
with:
145145
cache: pnpm
146146
node-version-file: .nvmrc
147-
cache-dependency-path: docs/pnpm-lock.yaml
147+
cache-dependency-path: "**/pnpm-lock.yaml"
148148
env:
149149
COREPACK_INTEGRITY_KEYS: '{"npm":[{"expires":"2025-01-29T00:00:00.000Z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="},{"expires":null,"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEY6Ya7W++7aUPzvMTrezH6Ycx3c+HOKYCcNGybJZSCJq/fd7Qa8uuAKtdIkUQtQiEKERhAmE5lMMJhP8OkDOa2g=="}]}'
150150

docs/astro.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ export default defineConfig({
2121
expressiveCode: {
2222
themes: ["catppuccin-mocha", "catppuccin-latte"],
2323
},
24-
social: {
25-
github: "https://github.com/pls-rs/pls",
26-
},
24+
social: [
25+
{
26+
icon: "github",
27+
label: "GitHub",
28+
href: "https://github.com/pls-rs/pls",
29+
},
30+
],
2731
sidebar: [
2832
{
2933
label: "About",
@@ -124,7 +128,4 @@ export default defineConfig({
124128
],
125129
}),
126130
],
127-
markdown: {
128-
smartypants: false, // SmartyPants converts '--' into en-dash, breaking alignment.
129-
},
130131
});

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"fmt": "prettier --ignore-path .gitignore --ignore-path .prettierignore --write ."
1212
},
1313
"dependencies": {
14-
"@astrojs/starlight": "^0.30.6",
15-
"astro": "^5.1.5",
16-
"astro-auto-import": "^0.4.2"
14+
"@astrojs/starlight": "^0.33.2",
15+
"astro": "^5.6.2",
16+
"astro-auto-import": "^0.4.4"
1717
},
1818
"packageManager": "[email protected]"
1919
}

docs/pnpm-lock.yaml

Lines changed: 1034 additions & 1639 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/styles/terminal.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ pre.terminal p {
4747
overflow-x: auto;
4848
}
4949

50-
div.expressive-code + pre.terminal {
50+
/* Join output code block into its preceding command block */
51+
div.expressive-code:has(figure.is-terminal)
52+
+ div.expressive-code:not(:has(figure.is-terminal)) {
5153
margin-top: 0;
52-
border-width: 1px 0 0 0;
54+
border-top: 1px solid var(--sl-color-gray-4);
5355
}

docs/src/styles/typography.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ span.math {
33
font-style: italic;
44
}
55

6-
figcaption.header:has(span.sr-only) ~ pre .ec-line .code::before {
6+
pre[data-language="bash"] .ec-line .code::before {
77
content: "$ ";
88
opacity: 0.5;
99
}

examples/justfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ set fallback
1212
# Install Python dependencies.
1313
install:
1414
pdm install
15-
[ -x "$(command -v to-html)" ] || cargo install --git https://github.com/Aloso/to-html --branch main to-html
1615

1716
###########
1817
# Recipes #

examples/src/examples/filtering.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def name_filter():
1717
["a.rs", "b.rs", "c.rs", "a.jpg", "b.jpg", "c.jpeg"],
1818
)
1919
) as bench:
20-
write_out("--only='(a|c)'", r"--exclude='\.jpe?g'", bench=bench, dest_name="on")
20+
write_out("--only=(a|c)", r"--exclude=\.jpe?g", bench=bench, dest_name="on")
2121
write_out(bench=bench, dest_name="off")
2222
write_out(
23-
r"--exclude='\.jpe?g'",
23+
r"--exclude=\.jpe?g",
2424
"a.jpg",
2525
cwd=bench,
2626
include_bench=False,

examples/src/examples/utils/io.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ def write_content(dest_path: str, content: str):
1414
:param content: the content to write inside the file
1515
"""
1616

17-
if not content.endswith("\n"):
18-
content += "\n"
19-
2017
dest_path = DOCS_EXAMPLES / dest_path
2118
if not dest_path.parent.exists():
2219
dest_path.parent.mkdir(mode=0o755, parents=True)

examples/src/examples/utils/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import shutil
33
from pathlib import Path
44

5-
from examples.utils.to_html import run_to_html
5+
from examples.utils.pls import run_pls
66
from examples.utils.io import write_content
77

88

@@ -31,7 +31,7 @@ def write_out(
3131
args = list(args)
3232
if bench and include_bench:
3333
args.append(str(bench.absolute()))
34-
content = run_to_html(args, **kwargs)
34+
content = run_pls(args, **kwargs)
3535

3636
out_file = f"{func_name}/{dest_name}.mdx"
3737
print(f"Writing MDX to '{out_file}'.")

0 commit comments

Comments
 (0)