Skip to content

Commit

Permalink
feat(plugin): register container cut directive
Browse files Browse the repository at this point in the history
  • Loading branch information
d3m1d0v committed Nov 7, 2024
1 parent b47215f commit 4efae92
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"prepare": "husky"
},
"dependencies": {
"@diplodoc/directive": "file:../diplodoc-directive/diplodoc-directive-0.0.0-4.tgz"
"@diplodoc/directive": "file:../diplodoc-directive/diplodoc-directive-0.0.0-8.tgz"
},
"devDependencies": {
"@diplodoc/lint": "^1.2.0",
Expand Down
5 changes: 2 additions & 3 deletions src/plugin/directive.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import type MarkdownIt from 'markdown-it';

import {directiveParser, registerBlockDirective} from '@diplodoc/directive';
import {directiveParser, registerContainerDirective} from '@diplodoc/directive';

import {ClassNames, ENV_FLAG_NAME, TokenType} from './const';

export const cutDirective: MarkdownIt.PluginSimple = (md) => {
md.use(directiveParser());

registerBlockDirective(md, {
registerContainerDirective(md, {
name: 'cut',
type: 'container',
match(_params, state) {
state.env ??= {};
state.env[ENV_FLAG_NAME] = true;
Expand Down

0 comments on commit 4efae92

Please sign in to comment.