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

Feature request: support ditaa command-line arguments #169

Closed
kngok opened this issue Apr 21, 2020 · 9 comments · Fixed by #1781
Closed

Feature request: support ditaa command-line arguments #169

kngok opened this issue Apr 21, 2020 · 9 comments · Fixed by #1781
Labels
📖 documentation 🍩 enhancement New feature or request ☕ java Related to Java code

Comments

@kngok
Copy link

kngok commented Apr 21, 2020

This project is very helpful, but I'm in trouble with drawing result of ditaa.
I've found that running ditaa with --no-separation argument solves my problem.
So I want the feature running ditaa with command-line arguments such as -E,--no-separation or -S,--no-shadows.

@ggrossetie
Copy link
Member

Hello @coo79

That's a good idea but I've not yet decided how we should pass additional parameters/configuration to the API.

@kngok
Copy link
Author

kngok commented Apr 22, 2020

@Mogztter Thank you for your reply.
As temporary solution, I hard-coded the arguments in Ditaa.java and rebuild docker image.
Although my immediate requirement is satisfied, I'd be grateful if you could consider this feature.

@ggrossetie
Copy link
Member

Indeed that's less than ideal but I'm glad that you found an interim solution.

I will try to take some time to think about how we should implement this feature.

@xanni
Copy link

xanni commented Dec 31, 2023

I also have this issue - need to pass options to ditaa.

@elbehery95
Copy link
Contributor

Not sure why this is not documented.

You can either now add options via diagram_option: {no-shadow: 1} or as a query arg ..?no-shadows=1

@ggrossetie
Copy link
Member

You can either now add options via diagram_option: {no-shadow: 1} or as a query arg ..?no-shadows=1

Indeed, we do support a few options:

public byte[] convert(String source, FileFormat format, JsonObject options) throws IOException, InterruptedException {
List<String> commands = new ArrayList<>();
commands.add(binPath);
if (format.equals(FileFormat.SVG)) {
commands.add("--svg");
}
String noAntialias = options.getString("no-antialias");
if (noAntialias != null) {
commands.add("--no-antialias");
}
String noSeparation = options.getString("no-separation");
if (noSeparation != null) {
commands.add("--no-separation");
}
String roundCorners = options.getString("round-corners");
if (roundCorners != null) {
commands.add("--round-corners");
}
String scale = options.getString("scale");
if (scale != null) {
commands.add("--scale " + scale);
}
String noShadows = options.getString("no-shadows");
if (noShadows != null) {
commands.add("--no-shadows");
}
String tabs = options.getString("tabs");
if (tabs != null) {
commands.add("--tabs " + tabs);
}
commands.add("-");
return commander.execute(source.getBytes(), commands.toArray(new String[0]));
}

Not sure why this is not documented.

Just an oversight, feel free to edit the documentation: https://docs.kroki.io/kroki/setup/diagram-options/ (you can click on the "Edit this page" on the top right corner)

@elbehery95
Copy link
Contributor

elbehery95 commented Sep 16, 2024

@ggrossetie i think this can be closed right?

@ggrossetie
Copy link
Member

I prefer to keep it open until the documentation is updated.

@elbehery95
Copy link
Contributor

@ggrossetie done at #1781

hopefully with this merged, all Ditaa options are reflected in the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation 🍩 enhancement New feature or request ☕ java Related to Java code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants