-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
lalrpop-docgen/src/railroad.rs
Outdated
@@ -245,7 +245,7 @@ impl LalrpopToRailroad { | |||
); | |||
|
|||
let diagram_ref = format!( | |||
r#"<img src="{}svg/{}.svg" alt="{}" width="{}" height="{}"/>"#, | |||
"![{}svg/{}.svg]({})", |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐢
No description provided.