LaurentRDC / pandoc-plot

Render and include figures in Pandoc documents using your plotting toolkit of choice
https://laurentrdc.github.io/pandoc-plot/
GNU General Public License v2.0
216 stars 8 forks source link

Allow specifying language on code blocks for tools like VSCode #25

Closed m00nwtchr closed 3 years ago

m00nwtchr commented 3 years ago

Currently, at least as far as i know for the codeblocks to be picked up by pandoc-plot they have to exactly match the format specified in the readme, which disables syntax highlighting and language features in editors like VSCode. I'td be nice if you could use something liike this:

```py{.matplotlib} import matplotlib.pyplot as plt ```

for the marker, it looks like this is still recognized by vscode as a python code block, so you just need to allow this in pandoc-plot

LaurentRDC commented 3 years ago

Hi there!

The README example is short but incomplete. The documentation explains that syntax highlighting can be activated like so:


```{.python .matplotlib caption="example"}
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])


I personally use VScode without any Markdown-specific extensions and syntax highlighting works correctly using the above snippet.
m00nwtchr commented 3 years ago

Ah, thx, i missed that