From 810b9eceff1b5d41fc97effaf098adc386683e55 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Sat, 21 Sep 2024 18:13:07 -0400 Subject: [PATCH] Document `>>styles`, allow spaces after `>>` --- docs/src/content/docs/reference.mdx | 33 +++++++++++++++++++++++++++++ src/parser.hera | 2 +- test/emphasis.civet | 16 ++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/reference.mdx b/docs/src/content/docs/reference.mdx index d12c0f3..00382dd 100644 --- a/docs/src/content/docs/reference.mdx +++ b/docs/src/content/docs/reference.mdx @@ -34,6 +34,18 @@ Similar to Markdown emphasis. ***bold italic*** `}/> +You can also redefine the meaning of these symbols: + +>styles + * = \\textit + ** = \\textsf + *** = \\texttt + *italic* + **sans-serif** + ***teletype*** +`}/> + ## Lists Similar to Markdown lists, but with less strict requirements on indentation. @@ -72,6 +84,27 @@ Similar to Markdown lists, but with less strict requirements on indentation. #@thm:main `}/> +If your label needs spaces or trailing punctation, put it in quotes: + + + +If you want to use a custom `\ref` system, such as `cleveref`, you can +override the meaning of these symbols: + +>styles + @ = \\cref + #@ = \\cpageref + @thm:main + #@thm:main + @thm:main,thm:other +`}/> + + ## Cite >/ Indent:indent ">>" MetaCommand:cmd -> cmd + &/[ \t]*>>/ Indent:indent ">>" /\s*/ MetaCommand:cmd -> cmd MetaCommand MetaStyles diff --git a/test/emphasis.civet b/test/emphasis.civet index ab71eae..a23046e 100644 --- a/test/emphasis.civet +++ b/test/emphasis.civet @@ -44,3 +44,19 @@ describe 'Markdown emphasis (*/**/***)', -> emphasized} and \\defn{super emphasized} ''' + + testCase ''' + custom style + --- + >> styles + * = \\textit + ** = \\textsf + *** = \\texttt + *italic* + **sans-serif** + ***teletype*** + --- + \\textit{italic} + \\textsf{sans-serif} + \\texttt{teletype} + '''