diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 16:19:19 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-09-09 16:19:19 +0200 |
commit | 9fbc5edf2a78ebc733732b7fa6fc40acd3bf978b (patch) | |
tree | 3ef7a40ac71b0e158aabf1525244e068deb7b36d /src/construct/mdx_expression_text.rs | |
parent | 4711b1f0720eb54e458ca5a16cb655013693b628 (diff) | |
download | markdown-rs-9fbc5edf2a78ebc733732b7fa6fc40acd3bf978b.tar.gz markdown-rs-9fbc5edf2a78ebc733732b7fa6fc40acd3bf978b.tar.bz2 markdown-rs-9fbc5edf2a78ebc733732b7fa6fc40acd3bf978b.zip |
Add docs for mdx expressions
Diffstat (limited to 'src/construct/mdx_expression_text.rs')
-rw-r--r-- | src/construct/mdx_expression_text.rs | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/construct/mdx_expression_text.rs b/src/construct/mdx_expression_text.rs index 8d061eb..53160a0 100644 --- a/src/construct/mdx_expression_text.rs +++ b/src/construct/mdx_expression_text.rs @@ -1,10 +1,40 @@ -//! To do. +//! MDX expression (text) occurs in the [text][] content type. +//! +//! ## Grammar +//! +//! MDX expression (text) forms with the following BNF +//! (<small>see [construct][crate::construct] for character groups</small>): +//! +//! ```bnf +//! mdx_expression_text ::= mdx_expression +//! +//! ; See the `partial_mdx_expression` construct for the BNF of that part. +//! ``` +//! +//! See [`mdx_expression`][mdx_expression] for more info. +//! +//! ## Tokens +//! +//! * [`MdxTextExpression`][Name::MdxTextExpression] +//! * see [`mdx_expression`][mdx_expression] for more +//! +//! ## Recommendation +//! +//! See [`mdx_expression`][mdx_expression] for recommendations. +//! +//! ## References +//! +//! * [`syntax.js` in `micromark-extension-mdx-expression`](https://github.com/micromark/micromark-extension-mdx-expression/blob/main/packages/micromark-extension-mdx-expression/dev/lib/syntax.js) +//! * [`mdxjs.com`](https://mdxjs.com) +//! +//! [text]: crate::construct::text +//! [mdx_expression]: crate::construct::partial_mdx_expression use crate::event::Name; use crate::state::{Name as StateName, State}; use crate::tokenizer::Tokenizer; -/// Start of MDX: expression (text). +/// Start of an MDX expression (text). /// /// ```markdown /// > | a {Math.PI} c @@ -22,7 +52,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { } } -/// After an MDX expression (text) tag. +/// After expression. /// /// ```markdown /// > | a {Math.PI} c |