Skip to content
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

Add macro block, subs attributes, global config support #25

Merged
merged 1 commit into from
Apr 30, 2022

Conversation

HeinrichAD
Copy link

Add macro block support

includes #19
closes #18

Add subs attribute support (AsciiDoc variables)

closes #17

Add global PlantUML config file include support with :plantuml-include:

Support a global PlantUML configuration file.

Add the functionality of the PlantUML command line: https://plantuml.com/command-line#6a26f548831e6a8c

-I/path/to/file                Include file as if '!include file' was used

Other tools such as Kroki have similar features with :kroki-plantuml-include: path/to/file.puml.

How to use

Just add the variable :plantuml-include: path/to/file.puml inside your AsciiDoc file.

- add macro block support
- add subs attribute support (asciidoc variables)
- add global plantuml config file include support (:plantuml-include:)
Copy link
Owner

@hsanson hsanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long overdue review. Thanks for the work.

@hsanson hsanson merged commit 63d8121 into hsanson:master Apr 30, 2022
@HeinrichAD HeinrichAD deleted the feature/macro-subs-config branch April 30, 2022 09:44
private

def insert_config_to_content(parent, config_path, content, attrs)
File.open(config_path) do |file|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hsanson We need to be careful about File.open because this library is used in GitLab where it might be a security threat.
I would recommend to check Asciidoctor safe mode before trying to read something from the filesystem. We should also make sure that the file does not reside outside of the parent directory of the source file (otherwise it could be used to read /etc/passwd or other sensitives files)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the advice. Will consider this potential risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for block syntax The subs attribute should be honored
3 participants