Skip to content

Commit

Permalink
Document >>styles, allow spaces after >>
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Sep 21, 2024
1 parent 6c96dab commit 810b9ec
Showing 3 changed files with 50 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/src/content/docs/reference.mdx
Original file line number Diff line number Diff line change
@@ -34,6 +34,18 @@ Similar to Markdown emphasis.
***bold italic***
`}/>

You can also redefine the meaning of these symbols:

<Example src={`
>>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:

<Example src={`
@='thm main'
@"thm main"
#@'thm main'
`}/>

If you want to use a custom `\ref` system, such as `cleveref`, you can
override the meaning of these symbols:

<Example src={`
>>styles
@ = \\cref
#@ = \\cpageref
@thm:main
#@thm:main
@thm:main,thm:other
`}/>


## Cite

<Example src={`
2 changes: 1 addition & 1 deletion src/parser.hera
Original file line number Diff line number Diff line change
@@ -205,7 +205,7 @@ InlineArgumentAfterColon
]

MetaBlock
&/[ \t]*>>/ Indent:indent ">>" MetaCommand:cmd -> cmd
&/[ \t]*>>/ Indent:indent ">>" /\s*/ MetaCommand:cmd -> cmd

MetaCommand
MetaStyles
16 changes: 16 additions & 0 deletions test/emphasis.civet
Original file line number Diff line number Diff line change
@@ -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}
'''

0 comments on commit 810b9ec

Please sign in to comment.