Repository navigation
Add a reference for Markdown processor packages. - #14600
Conversation
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Preview deployment ✅ Deployment complete!
|
Princesseuh
left a comment
There was a problem hiding this comment.
Looks good to me! Bit worrying all the things we export from the Remark processor, but so be it
|
Well, at least not everything is documented. We can always clean up what sounds internal if there is another way without making this a breaking change! But, yes, there are a lot of things! 😅 Thanks for the review! 💜 |
Context: Currently, we have no docs for
@astrojs/markdown-remarkand@astrojs/markdown-satteri. When we'll remove the deprecated Markdown options, we might want this to live elsewhere. Some helpers are useful for integrations (e.g. Starlight use some of them or use less convenient types).Description (required)
@astrojs/markdown-remark:unified(). This allows us to show defaults. So, I removedUnifiedProcessorOptionsfrom the type list.UnifiedResolvedOptions. It doesn't seem helpful for users.@astrojs/markdown-satteri:satteri(). This allows us to show defaults. So, I removedSatteriProcessorOptionsfrom the type list.SatteriResolvedOptionsin the end. It seems rather internal?SatteriFeatures? So, I put the features directly under thesatteri()options.@astrojs/markdown-remarkand@astrojs/markdown-satterito the content collection config to be able to use<Since />.<ReadMore />in the Markdown and MDX guides.recmaPluginsdescription (we had about the same description in 3 places...)I took some liberty with a few types:
Featuresrenamed toSatteriFeatures(they are identical) and so adding a link to Sätteri docs on them might be less confusing.RoottoMdastRoot/HastRootwith an external linkAstroMarkdownOptionstype. Since this wasn't documented yet, I don't think we should show them.I didn't include some exports that seemed "for Astro-use only" to me:
rehypeShiki: but I can see some people use it (e.g. in an unexepectednext.config.tsfile)satteriCollectHastText,satteriCollectImagesPlugin,satteriCreateHighlightFn,satteriHighlightPlugin,satteriImageMarkerPlugin,extractFrontmatter,isFrontmatterValid,markdownConfigDefaults,parseFrontmatter,rehypePrism,remarkCollectImages,syntaxHighlightDefaults,Node(re-export from unist),ParseFrontmatterOptions,ParseFrontmatterResultOpen questions:
ShikiConfig:ShikiConfigtype is not really useful by itself...Reference(kinda similar to the virtual modules,astro/hono, andastro/zod) andEcosystem(kinda similar to@astrojs/mdx) tabs.Referencetab.If you want to double check the `Since`, click here to expand the list.
@astrojs/markdown-remark:@astrojs/markdown-remark@3.2.0):createMarkdownProcessor()@astrojs/markdown-remark@7.2.0):isUnifiedProcessor(),unified(),AstroMarkdownOptions,MarkdownHeading,MarkdownRenderOptions,MarkdownRenderResult,MarkdownRenderer,RehypePlugin,RehypePlugins,RemarkPlugin,RemarkPlugins,RemarkRehype,ShikiConfig,Smartypants,UnifiedProcessorOptions, andUnifiedResolvedOptionsMarkdownProcessorandSyntaxHighlightConfig. If I got the history right... This was imported, but never exported before.@astrojs/markdown-remark@1.2.0):rehypeHeadingIds()@astrojs/markdown-satteri:@astrojs/markdown-satteri@0.3.1):SatteriAstroDataSatteriFeaturestype exists since fix(markdown-satteri): clarify smartPunctuation default astro#17314 (@astrojs/markdown-satteri@0.3.8) but this was just to fix an issue with defaults. So, I added no<Since />tooptions.featureswhich exists since feat: add markdown processor abstraction astro#16848 (first release).References