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

Use md images #1

Merged
merged 5 commits into from
May 16, 2022
Merged

Use md images #1

merged 5 commits into from
May 16, 2022

Conversation

Licenser
Copy link

@Licenser Licenser commented May 5, 2022

No description provided.

Signed-off-by: Heinz N. Gies <heinz@licenser.net>
@@ -245,7 +245,7 @@ impl LalrpopToRailroad {
);

let diagram_ref = format!(
r#"<img src="{}svg/{}.svg" alt="{}" width="{}" height="{}"/>"#,
"![{}svg/{}.svg]({})",
Copy link
Owner

Choose a reason for hiding this comment

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

This was the original choice, but not all rendering engines will use the width/height information in the svg to render the images correctly - and this makes the resulting documents visually sub optimal visually. We could add a flag to switch this behaviour for specific rendering engines though with this as a generic default

Copy link
Author

Choose a reason for hiding this comment

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

Yes neither choices are right, some eingines will trip up with one, others with the other. This PR works with the engine we are using right now, while the current code causes problems. The .svg images do include the correct dimensions, so the forced with/height is mostly working around bugs in other engines. It feels odd to bias for bugs in engines we don't use and causing issues with the engine we use in return.

Licenser and others added 4 commits May 5, 2022 12:57
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
Signed-off-by: Darach Ennis <darach@gmail.com>
Make image markup in generated markup support a switchable style
Copy link
Owner

@darach darach left a comment

Choose a reason for hiding this comment

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

LGTM 🐢

@darach darach merged commit b5207e8 into darach:docgen May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants