1
0
Fork 0

wip(shared): Started working on jargon overhaul

See #6017
This commit is contained in:
joostdecock 2024-02-17 19:55:56 +01:00
parent 43c069719c
commit e87e889a87
12 changed files with 331 additions and 20 deletions

View file

@ -16,11 +16,7 @@ import { remarkGithubImages } from './remark-github-images.mjs'
import rehypeHighlight from 'rehype-highlight'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeSlug from 'rehype-slug'
import rehypeJargon from 'pkgs/rehype-jargon/src/index.mjs'
import rehypeHighlightLines from 'pkgs/rehype-highlight-lines/src/index.mjs'
// FreeSewing jargon and jargon transform
import { jargon as baseJargon } from 'shared/jargon/index.mjs'
import { jargonTransform } from './rehype-jargon-transform.mjs'
/*
* Compiles markdown/mdx to a function body
@ -29,7 +25,6 @@ export const compileMdx = async ({
md, // A string holding the markdown
site, // The site folder, one of 'org' or 'dev'
slug, // The slug to the page below the folder (like 'guides/plugins')
jargon = {}, // An object of jargon definitions. See rehype-jargon
fromGithub = false, // Set this to true when dynamically loading mdx from Github
}) => {
const mdx = String(
@ -56,13 +51,6 @@ export const compileMdx = async ({
remarkIntroAsFrontmatter,
],
rehypePlugins: [
[
rehypeJargon,
{
jargon: { ...baseJargon, ...jargon },
transform: jargonTransform,
},
],
[
rehypeHighlight,
{