feat: coloration syntaxique locale via themes/default.css
Suppression de la dépendance CDN highlight.js. Le CSS github-dark est maintenant dans themes/default.css, lu au démarrage et injecté dans chaque page HTML générée. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -4,6 +4,11 @@ const { marked } = require('marked');
|
||||
const { markedHighlight } = require('marked-highlight');
|
||||
const hljs = require('highlight.js');
|
||||
|
||||
const SYNTAX_CSS = fs.readFileSync(
|
||||
path.join(__dirname, '..', 'themes', 'default.css'),
|
||||
'utf-8'
|
||||
);
|
||||
|
||||
marked.use(markedHighlight({
|
||||
langPrefix: 'hljs language-',
|
||||
highlight(code, lang) {
|
||||
@@ -444,7 +449,7 @@ function htmlShell({ title, sidebar, body, watchMode }) {
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⚡</text></svg>">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Roboto+Mono&display=swap">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
|
||||
<style>${SYNTAX_CSS}</style>
|
||||
<style>${STYLES}</style>${noSidebarStyle}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user