Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] plugin-md-enhance is too large, perhaps it needs to be split #4130

Open
2 tasks done
pengzhanbo opened this issue May 12, 2024 · 2 comments
Open
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@pengzhanbo
Copy link
Contributor

pengzhanbo commented May 12, 2024

Checklist

  • I searched existing issues and no one else requests similar feature.
  • I think that 25%+ users are positive towards this feature.

Describe the feature

First of all, thank you to markdown enhance for providing powerful functionality support to vuepress markdown! However, it must be said that this plugin has now become very large and cumbersome, making maintenance increasingly difficult. Perhaps it is time to consider splitting it up.

My suggestion is to consider splitting from various perspectives such as new syntax, grammar extensions, third-party dependencies, resource embedding, and content container types.

For example, these combinations can be used as individual plugins.:

  • content container: hint, github alerts, [code-group];
  • new syntax: sup, sub, task list, footnote, mark, spoilerinclude;
  • grammar extensions: attrs, imgSize, imgMark, obsidianImgSize, imgLazyload;
  • markdown render: breaks, linkify, figure, stylize;
  • math Tex: katex, mathjax (optional deps);
  • chart: chart, echarts, flowchart, markmap, mermaid, plantuml (optional deps);
  • code blocks: [code-group], code-demo;
  • code playground: kotlin-playground, vue-repl, typescript-playground
  • ...more

Additional context

No response

@pengzhanbo pengzhanbo added the enhancement New feature or request label May 12, 2024
@Mister-Hope
Copy link
Member

I actually prefer function spliting, e,g. I will split imgMark imgSize and figure into one plugin called plugin-markdown-img.

Here are my plans:

  • plugin-img: imgMark -> mark imgSize -> size figure -> figure
  • plugin-math: katex or mathjax
  • plugin-gfm:

@pengzhanbo
Copy link
Contributor Author

Comparing the more complex aspects of splitting is challenging, especially with elements like sup, sub, task list, footnote, mark, spoiler, include, imgSize, imgMark, obsidianImgSize, imgLazyload, breaks, linkify, figure, and stylize. Distinguishing their categories can be quite tricky.

Considering these functions are relatively simple and independent, perhaps they can be separately implemented in the upstream mdit-plugins, then integrated into plugin-md-enhance. Meanwhile, plugin-md-enhance should only retain these functions, with others being separated out.

e.g:

  • plugin-md-enhance: sup, sub, task list, footnote, mark, spoiler, include, imgSize, imgMark, obsidianImgSize, imgLazyload, breaks, linkify, figure, stylize
  • plugin-hint: hint, github alerts
  • plugin-math: katex or mathjax
  • plugin-chart: chart
  • plugin-echarts: echarts
  • plugin-mermaid: mermaid
  • ... more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants