ProjectEvergreen / greenwood

Greenwood is your full-stack workbench for the web, focused on supporting modern web standards and development to help you create your next project.
https://www.greenwoodjs.io
MIT License
94 stars 9 forks source link

standalone markdown plugin #1247

Open thescientist13 opened 2 weeks ago

thescientist13 commented 2 weeks ago

Summary

Coming out of #955 / #1212, it is now possible for Resource plugins to start opting in to serving pages, like for TypeScript and markdown. With this capability in hand, we should now make the move to moving the markdown capabilities out of the CLI and into its down plugin

Details

While having markdown out of the box is nice, the current dependency list just for markdown right now is quite a lot (7!) https://github.com/ProjectEvergreen/greenwood/blob/v0.30.0-alpha.2/packages/cli/package.json#L32

"dependencies": {
  "markdown-toc": "^1.2.0",
  "rehype-raw": "^5.0.0",
  "rehype-stringify": "^8.0.0",
  "remark-frontmatter": "^2.0.0",
  "remark-parse": "^8.0.3",
  "remark-rehype": "^7.0.0",
  "unified": "^9.2.0",
},

Plus, since it's not critical (albeit convenient), we shouldn't tax every user on this. Instead, we should really be promoting the init package and providing the most useful options as part of the wizard, e.g.

  1. Do you want TypeScript?
  2. Do you want markdown?
  3. Etc

Also, this means users can bring their own markdown plugin system as well.


I think we'll probably still want to honor frontmatter in the CLI, since as part of #1167 , noticed that frontmatter worked even in HTML, so might be nice to have this shared capability in the CLI.