Skip to content

Commit 3e7b4ad

Browse files
authored
ci: update dependency marked (#2815)
1 parent 0740e3d commit 3e7b4ad

24 files changed

Lines changed: 215 additions & 245 deletions

docs/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"compileOnSave": false,
33
"compilerOptions": {
4-
"rootDir": "../",
54
"outDir": "../dist/out-tsc",
65
"forceConsistentCasingInFileNames": true,
76
"allowSyntheticDefaultImports": true,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"@types/jasmine": "6.0.0",
9797
"@types/jasminewd2": "2.0.13",
9898
"@types/mapbox__point-geometry": "0.1.4",
99-
"@types/marked": "^2.0.2",
10099
"@types/minimatch": "^5.1.2",
101100
"@types/node": "22.19.20",
102101
"@types/semver": "^7.3.9",
@@ -131,7 +130,7 @@
131130
"karma-sourcemap-loader": "0.4.0",
132131
"lint-staged": "17.0.7",
133132
"magic-string": "0.30.21",
134-
"marked": "^2.0.3",
133+
"marked": "^18.0.0",
135134
"minimatch": "^3.1.4",
136135
"npm-run-all2": "9.0.1",
137136
"octokit": "5.0.5",
@@ -147,6 +146,7 @@
147146
"sass": "1.100.0",
148147
"semver": "7.8.3",
149148
"shelljs": "0.10.0",
149+
"slugify": "^1.6.6",
150150
"source-map-support": "^0.5.21",
151151
"standard-version": "9.5.0",
152152
"stylelint": "17.13.0",

pnpm-lock.yaml

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

tools/dgeni/docs-package.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Package } from 'dgeni';
22
import { ReadTypeScriptModules } from 'dgeni-packages/typescript/processors/readTypeScriptModules';
33
import { Host } from 'dgeni-packages/typescript/services/ts-host/host';
44
import { TypeFormatFlags } from 'typescript';
5-
import { HighlightNunjucksExtension } from './nunjucks-tags/highlight';
65
import { patchLogService } from './patch-log-service';
76
import { AsyncFunctionsProcessor } from './processors/async-functions';
87
import { categorizer } from './processors/categorizer';
@@ -166,6 +165,4 @@ apiDocsPackage.config(function (templateFinder: any, templateEngine: any) {
166165
variableStart: '{$',
167166
variableEnd: '$}',
168167
};
169-
170-
templateEngine.tags.push(new HighlightNunjucksExtension());
171168
});

tools/dgeni/nunjucks-tags/highlight.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

tools/dgeni/templates/constant.template.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ <h4 id="{$ constant.name $}" class="docs-header-link docs-api-h4 docs-api-consta
1717

1818
<div class="docs-markdown">
1919
<pre class="docs-markdown-pre">
20-
<code class="docs-markdown-code">
21-
{%- highlight "typescript" -%}
22-
const {$ constant.name | safe $}: {$ constant.type | safe $};
23-
{%- end_highlight -%}
24-
</code>
20+
<code class="docs-markdown-code">const {$ constant.name | safe $}: {$ constant.type | safe $};</code>
21+
2522
</pre>
2623
</div>

tools/dgeni/templates/type-alias.template.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ <h4 id="{$ alias.name $}" class="docs-header-link docs-api-h4 docs-api-type-alia
1717

1818
<div class="docs-markdown">
1919
<pre class="docs-markdown-pre">
20-
<code class="docs-markdown-code">
21-
{%- highlight "typescript" -%}
22-
type {$ alias.name | safe $} = {$ alias.typeDefinition | safe $};
23-
{%- end_highlight -%}
24-
</code>
20+
<code class="docs-markdown-code">type {$ alias.name | safe $} = {$ alias.typeDefinition | safe $};</code>
2521
</pre>
2622
</div>

tools/highlight-files/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package(default_visibility = ["//visibility:public"])
55

66
ts_project(
77
name = "sources",
8-
srcs = glob(["**/*.ts"]),
8+
srcs = glob(["**/*.mts"]),
99
tsconfig = "//tools:tsconfig",
1010
deps = [
1111
"//:node_modules/@types/fs-extra",
@@ -20,5 +20,5 @@ js_binary(
2020
data = [
2121
":sources",
2222
],
23-
entry_point = ":highlight-files.js",
23+
entry_point = ":highlight-files.mjs",
2424
)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import highlightJs from 'highlight.js';
2+
3+
/** Map of language aliases not recognized by highlight.js to supported equivalents. */
4+
const languageAliases: Record<string, string> = {
5+
angular: 'html',
6+
ts: 'typescript',
7+
};
8+
9+
/**
10+
* Transforms a given code block into its corresponding HTML output. We do this using
11+
* highlight.js because it allows us to show colored code blocks in our documentation.
12+
*/
13+
export function highlightCodeBlock(code: string, language?: string) {
14+
if (language) {
15+
const normalizedLanguage = languageAliases[language.toLowerCase()] ?? language.toLowerCase();
16+
if (highlightJs.getLanguage(normalizedLanguage)) {
17+
return highlightJs.highlight(code, { language: normalizedLanguage }).value;
18+
}
19+
}
20+
21+
return code;
22+
}

tools/highlight-files/highlight-code-block.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)