docs: Document configuration of the remark-math plugin#10967
docs: Document configuration of the remark-math plugin#10967waldyrious wants to merge 1 commit intofacebook:mainfrom
Conversation
c17c8ee to
b1121d7
Compare
Josh-Cena
left a comment
There was a problem hiding this comment.
Hi there, thanks for the PR! This doc documents an external plugin. We are not interested in documenting any of its behaviors, only how to use it with Docusaurus. Anything documentation that can exist outside of the context of Docusaurus should be found in its own documentation.
⚡️ Lighthouse report for the deploy preview of this PR
|
That's precisely what I intended with this PR — to document how to set it up in Docusaurus, especially the Would it be acceptable if instead of adding a new section to this page, we simply modify the existing configuration snippet to include the (only) configuration option? -remarkPlugins: [remarkMath],
+remarkPlugins: [[remarkMath, {singleDollarTextMath: true|false}]], |
|
Documentation for how to add configuration is already in https://docusaurus.io/docs/markdown-features/plugins#configuring-plugins. I don't think we want to mention anything specific about how this plugin works. |
|
The options are documented here
At best, I'd prefer to link to these pages in a generic way, and not listing any option attribute in our docs -remarkPlugins: [remarkMath],
+// For available options, see: https://github.com/remarkjs/remark-math/tree/main/packages/remark-math#options
+remarkPlugins: [[remarkMath, remarkMathOptions]],If we document |
Pre-flight checklist
Motivation
Using the
remark-mathplugin with its default configuration (where single dollar signs, i.e.$...$, are interpreted as delimiting inline math) can result in unintended rendering changes in pages that happen to contain lines with two or more dollar signs, e.g. to indicate prices of items or other monetary amounts.This issue has been identified by others in the plugin's issue tracker, and the proposed solution is to set the configuration option
singleDollarTextMathtofalse. However, the exact syntax to set that option in the context of adocusaurus.config.jsfile is not immediately clear.This PR explicitly documents that configuration option, explains when one might want to use it, and provides an usage example.
Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/