Skip to content

Commit

Permalink
feat(YfmCut): support directiveSyntax experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m1d0v committed Nov 22, 2024
1 parent ed85f71 commit da8fef7
Show file tree
Hide file tree
Showing 13 changed files with 498 additions and 98 deletions.
9 changes: 7 additions & 2 deletions demo/defaults/md-plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ type GetPluginsOptions = {
directiveSyntax?: RenderPreviewParams['directiveSyntax'];
};

export function getPlugins(_opts: GetPluginsOptions = {}): markdownit.PluginWithParams[] {
export function getPlugins({
directiveSyntax,
}: GetPluginsOptions = {}): markdownit.PluginWithParams[] {
const defaultPlugins: PluginWithParams[] = [
anchors,
code,
yfmCut({bundle: false}),
yfmCut({
bundle: false,
directiveSyntax: directiveSyntax?.mdPluginValueFor('yfmCut'),
}),
deflist,
file,
(md) => md.use(imsize, {enableInlineStyling: true}),
Expand Down
33 changes: 28 additions & 5 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
"tslib": "^2.3.1"
},
"devDependencies": {
"@diplodoc/cut-extension": "^0.3.1",
"@diplodoc/cut-extension": "^0.4.0",
"@diplodoc/folding-headings-extension": "0.1.0",
"@diplodoc/html-extension": "2.3.2",
"@diplodoc/latex-extension": "1.0.3",
Expand Down Expand Up @@ -258,6 +258,7 @@
"sass": "^1.64.1",
"sass-loader": "^13.3.2",
"stylelint": "15.11.0",
"ts-dedent": "2.2.0",
"ts-jest": "^27.0.7",
"typescript": "^4.5.2"
},
Expand All @@ -282,7 +283,7 @@
}
},
"peerDependencies": {
"@diplodoc/cut-extension": "^0.3.1",
"@diplodoc/cut-extension": "^0.3.1 || ^0.4.0",
"@diplodoc/folding-headings-extension": "^0.1.0",
"@diplodoc/html-extension": "2.3.2",
"@diplodoc/latex-extension": "^1.0.3",
Expand Down
Loading

0 comments on commit da8fef7

Please sign in to comment.