mikitex70 / plantuml-markdown

PlantUML plugin for Python-Markdown
BSD 2-Clause "Simplified" License
196 stars 55 forks source link

Keeping the inline code when a source file is provided #47

Closed itopaloglu83 closed 4 years ago

itopaloglu83 commented 4 years ago

Ability to provide a source file is a really useful feature. Current implementation ignores the inline code when a source file is provided and PlantUML !include doesn't work when a remote server is used. After asking a question about it on a closed issue, I went ahead and updated the code locally. Would you bu interested to add such functionality?

Here's how I changed the plantuml_markdown.py lines 153 trough 159.

code = ""

# Load diagram source from external file
if source and base_dir:
    with open(os.path.join(base_dir, source), 'r') as f:
        code += f.read()

# Add extracted diagram source from markdown text
code += m.group('code')

This might be really useful to include theme files etc.

mikitex70 commented 4 years ago

Hi @itopaloglu83, I like your suggestion, I will merge it as soon as possible. Thanks for your contribution.

itopaloglu83 commented 4 years ago

Don't mention it. Thank you for making such a useful engineering plugin. 👍

itopaloglu83 commented 4 years ago

With https://github.com/mikitex70/plantuml-markdown/releases/tag/3.4.0 this PR can be closed. Thank you!