diff --git a/dollarmath.py b/dollarmath.py new file mode 100644 index 0000000..b222a61 --- /dev/null +++ b/dollarmath.py @@ -0,0 +1,88 @@ +# dollarmath.py by Akihiro Uchida *public domain* +# the original one is written by Paul Kienzle +# and published as public domain in [sphinx-dev]: $math$ extension +r""" +Allow $math$ markup in text and docstrings, ignoring \$. + +The $math$ markup should be separated from the surrounding text by spaces. +To embed markup within a word, place backslash-space before and after. +For convenience, the final $ can be followed by punctuation +(period, comma or semicolon). +""" + +import re + +dollar_pat = r"(?:^|(?<=\s))[$]([^\n]*?)(?