Open johncrossland opened 6 years ago
Currently only HTML is supported, but pull requests are welcome.
I'm not familiar with the internals of Sphinx; what changes would need to be made? I see where you've made a function to convert markdown tables to HTML here and connected it as a callback after Sphinx reads the source file. If I had a function that could convert Markdown tables to LaTeX syntax, how do I connect it as a callback to Sphinx for when I want the make latexpdf
rule?
I would love to have this functionality as well, any way I could help? Though, I am not familiar with the Sphinx.
@jkmacc-LANL @gaodingpan You would need to find out programmatically whether Sphinx was called with make html
or make latexpdf
, I don't know if that's available in the source-read
event. The list of events Sphinx supports is here.
The general Sphinx documentation on writing extensions is here, though I find them a little impenetrable.
The callback is registered here.
@jkmacc-LANL @gaodingpan You would need to find out programmatically whether Sphinx was called with
make html
ormake latexpdf
, I don't know if that's available in thesource-read
event. The list of events Sphinx supports is here.The general Sphinx documentation on writing extensions is here, though I find them a little impenetrable.
The callback is registered here.
figured out how to determine the current target, just import sys and check if "latexpdf" is in sys.argv will do it. Next I will try to output correct latex table format from markdown input
It seems that directly rendering the table to output latex table texts into blocks is not working ,any advice?
I used pytablereader and pytablewriter to generate latex codes, but the code is treated as raw text.
This is the output:
I found kind of a hack to it, I will create the table output to rst but append "```eval_rst" before the table to make sphinx evaluate as rst source. it worked for now.
Hi. Any updates on this?
To anyone who finds themselves here, it seems as though using myst is a better path to follow and has table support built-in. A quick test of myst compiled simple markdown tables nicely to PDF output.
I can use
sphinx-markdown-tables
successfully for HTML from Sphinxmake html
but notmake latexpdf
. I would like an update to do this instead of needing to work around it by converting.md
tables to.rst
tables manually, usingMarkdown2PDF
and making PDFs from.md
separately usingmd2pdf
. We need Sphinx to make PDF as well as HTML. We want our developers to be able to author in.md
as easily as they'd write aREADME.md
to obtain accurate documentation from them in GitHub code repositories. We don't want to ask developers to author in.rst
as it'd reduce how much accurate documentation we'd get.