summaryrefslogtreecommitdiff
path: root/src/build/to-html.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/to-html.mjs')
-rw-r--r--src/build/to-html.mjs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/build/to-html.mjs b/src/build/to-html.mjs
index 4bc3c06..786f91d 100644
--- a/src/build/to-html.mjs
+++ b/src/build/to-html.mjs
@@ -7,6 +7,7 @@ import remarkMath from 'remark-math';
import remarkFrontmatter from 'remark-frontmatter';
import remarkRehype from 'remark-rehype';
import rehypeSlug from 'rehype-slug';
+import rehypePicture from 'rehype-picture'
import rehypeKaTeX from 'rehype-katex';
import rehypeRaw from 'rehype-raw';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
@@ -14,6 +15,7 @@ import rehypeStringify from 'rehype-stringify';
import rehypeHighlight from 'rehype-highlight';
import remarkSpecialBox from './special_box.mjs';
import remarkRemoveFootnoteHeader from './remove-footnote-header.mjs';
+import {getTocHeading} from './i18n.mjs';
const autoLinkOption = {
behavior: 'wrap',
@@ -23,10 +25,14 @@ const autoLinkOption = {
},
};
+const pictureOptions = {
+ 'png': {avif: 'image/avif'}
+}
+
const generator = unified()
.use(remarkParse)
.use(remarkGfm)
- .use(remarkToc, {heading: 'Sommaire', tight: true, ordered: true})
+ .use(remarkToc, {heading: getTocHeading(), tight: true, ordered: true})
.use(remarkMath)
.use(remarkDirective)
.use(remarkSpecialBox)
@@ -34,6 +40,7 @@ const generator = unified()
.use(remarkRehype, {allowDangerousHtml: true})
.use(rehypeRaw)
.use(remarkRemoveFootnoteHeader)
+ .use(rehypePicture, pictureOptions)
.use(rehypeKaTeX)
.use(rehypeSlug)
.use(rehypeHighlight)
@@ -43,7 +50,7 @@ const generator = unified()
const generatorMd = unified()
.use(remarkParse)
.use(remarkGfm)
- .use(remarkToc, {heading: 'Sommaire', tight: true, ordered: true})
+ .use(remarkToc, {heading: getTocHeading(), tight: true, ordered: true})
.use(remarkMath)
.use(remarkDirective)
.use(remarkSpecialBox)
@@ -53,6 +60,7 @@ const generatorHTML = unified()
.use(remarkRehype, {allowDangerousHtml: true})
.use(rehypeRaw)
.use(remarkRemoveFootnoteHeader)
+ .use(rehypePicture, pictureOptions)
.use(rehypeKaTeX)
.use(rehypeSlug)
.use(rehypeHighlight)