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
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[submodule "third-party/highlight.js"]
path = third-party/highlight.js
url = https://github.com/highlightjs/highlight.js.git
branch = main
shallow = true
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ Doxygen and Cargo must be installed separately. The JSDoc adapter finds a projec
`node_modules/.bin`, so a global Node.js package is not required. Open `_site/index.html` to move between the generated
Sphinx, Doxygen, MkDocs, JSDoc, and rustdoc sites.

The language gallery uses upstream fixtures from the pinned `third-party/highlight.js` submodule. `npm run build`
initializes it automatically; keep its release tag aligned with the `@highlightjs/cdn-assets` dependency.

## Read the Docs

The root `.readthedocs.yaml` delegates to `readthedocs_build.sh` because Dockle, rather than Read the Docs, owns generator
Expand Down
11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"access": "public"
},
"scripts": {
"prebuild": "git submodule update --init --depth 1 -- third-party/highlight.js",
"build": "npm run sync:highlighter && npm run sync:lucide && npm run stage:examples",
"prepack": "npm run build",
"pretest": "npm run build",
Expand All @@ -67,7 +68,6 @@
"c8": "10.1.3",
"eslint": "10.12.0",
"globals": "17.13.0",
"highlightjs-fixtures": "github:highlightjs/highlight.js#11.12.0",
"lucide": "1.52.0"
}
}
4 changes: 2 additions & 2 deletions scripts/stage-examples.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const runtimePath = path.join(
);
const fixtureRoot = path.join(
root,
'node_modules',
'highlightjs-fixtures',
'third-party',
'highlight.js',
'test',
'markup',
);
Expand Down
4 changes: 2 additions & 2 deletions tests-js/jsdoc-template.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ test('the packaged highlighter includes every built-in grammar', async () => {
assert.equal(context.hljs.listLanguages().length, packagedLanguages.length);
const fixtureLanguages = new Set((await readdir(path.join(
projectRoot,
'node_modules',
'highlightjs-fixtures',
'third-party',
'highlight.js',
'test',
'markup',
), { withFileTypes: true }))
Expand Down
9 changes: 4 additions & 5 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ def test_highlighter_runtime_is_managed_by_npm(self) -> None:
with (PROJECT_ROOT / "package.json").open(encoding="utf-8") as stream:
package = json.load(stream)
version = package["devDependencies"]["@highlightjs/cdn-assets"]
fixtures = package["devDependencies"]["highlightjs-fixtures"]
fixture_manifest = PROJECT_ROOT / "third-party" / "highlight.js" / "package.json"
with fixture_manifest.open(encoding="utf-8") as stream:
fixtures = json.load(stream)
runtime = (
PROJECT_ROOT
/ "src"
Expand All @@ -107,10 +109,7 @@ def test_highlighter_runtime_is_managed_by_npm(self) -> None:
).read_text(encoding="utf-8")

self.assertRegex(version, r"^\d+\.\d+\.\d+$")
self.assertEqual(
fixtures,
f"github:highlightjs/highlight.js#{version}",
)
self.assertEqual(fixtures["version"], version)
self.assertTrue(
runtime.startswith(
f"/*! Highlight.js {version} | BSD-3-Clause |"
Expand Down
1 change: 1 addition & 0 deletions third-party/highlight.js
Submodule highlight.js added at f7f7d3
Loading