timofurrer / pandoc-plantuml-filter

Pandoc filter for PlantUML code blocks
https://pypi.org/project/pandoc-plantuml-filter
MIT License
104 stars 26 forks source link

How do you define PLANTUML_BIN? #1

Closed RonanHiggins closed 6 years ago

RonanHiggins commented 6 years ago

Hi Timo,

thanks for putting this out there.. I also had problems getting other systems to work. I have one question, how do you define the PLANTUML_BIN.. right now i adapted your code so my plantuml could be a string with spaces and thin I need to split it for the subprocess.check_call

PLANTUML_BIN = "java -jar /home/higgins/Downloads/plantuml.jar"

and then

subprocess.check_call(PLANTUML_BIN.split() + ["-t" + filetype, src])

I'm reluctant to create a shell script to run the plantuml jar..

timofurrer commented 6 years ago

I'm reluctant to create a shell script to run the plantuml jar..

Yes, right now it has to be a single binary. However, I'd be happy to merge a PR where PLANTUML_BIN is split by whitespaces

RonanHiggins commented 6 years ago

I can check in the fix. I have also added raw latex support to your script aswell, this was relatively easy but required a small change to your sample.md. How does the pull request work. you have to give me permission or?

            if filetype=="latex":
                latex = open(dest).read()
                return RawBlock('latex', latex.split("\\begin{document}")[-1].split("\\end{document}")[0])
            else:           
                return Para([Image([ident, [], keyvals], caption, [dest, typef])])

and in the header of sample.md

---
header-includes: |
    \usepackage{tikz}    
---
timofurrer commented 6 years ago

How does the pull request work. you have to give me permission or?

You can just fork this repository and push to a branch there and create the PR afterwards.

RonanHiggins commented 6 years ago

thanks for walking me through that.. I'll close this out then

RonanHiggins commented 6 years ago

Did you get a chance to look at that pull request?

mritzco commented 4 years ago

Please make the path instructions part of the documentation or modify the comment on top. I was trying to set the path alone or with the jar file and couldn't work it out until checking the code and the issues.

tfc commented 3 years ago

@mritzco @RonanHiggins i am using this for some internal documentation, it works great!

Please regard this as a +1 for the PR: i am very thankful that this happened, and interested to have this upstream, too.