New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dokuwiki math support [enhancement] #5319
Comments
Yeah I just ran into this, I tried: pandoc -f dokuwiki+tex_math_double_dollars -t latex and it returns an error saying that there is no support. I would love to see this implemented because dokuwiki is very common and as opposed to mediawiki does not require a database making it more portable. A workaround that I hope continues to work is to do this: pandoc input.txt -f dokuwiki -t org | pandoc -f org -t pdf -o file.pdf This isn't too bad because Edit: A more reliable solution would be to use the Dokuwiki Parser out of the gate, this will only work if the MathJax Extension is installed, assuming that Dokuwiki is installed in sudo \
/srv/http/dokuwiki/bin/render.php < file.dw |\
pandoc -f html+raw_tex+tex_math_dollars+tex_math_single_backslash -t latex |\
pandoc -f latex -t html --mathjax -s -o /tmp/file.html
xdg-open file.html & disown the output should have all the math working as would be expected This is some text
====== What Should Work ====== ===== LaTeX AMSmath Align ===== I don't know what a raw block is \begin{align} ====== What could appear ====== ===== KaTeX Aligned ===== $$\begin{aligned} ===== Dollars Align ===== $$ ===== Backslash Align ===== |
To go in the other direction from #!/usr/bin/env python
"""
Pandoc filter to convert raw tex to paragraph for dokuwiki
"""
from pandocfilters import toJSONFilter, Emph, Para
def raw_to_para(key, value, format, meta):
if key == 'RawBlock' and value[0] == 'latex':
math_content = value[1]
math_value=[{
"t": "Str",
"c": math_content
}]
return Para(math_value)
if __name__ == "__main__":
toJSONFilter(raw_to_para) so save that in chmod +x filter.py
pip install pandocfilters
pandoc file.txt -f dokuwiki -t org --filter ./filter.py |
Conversion from Dokuwiki doesn't support math. The standard way to add math to a Dokuwiki page is with the MathJax plugin, and the syntax is the same as markdown. This currently fails:
with message
The error message says
expecting "{{"
but that's because it's trying to link to an image. That doesn't help with math.The text was updated successfully, but these errors were encountered: