-
Notifications
You must be signed in to change notification settings - Fork 3.5k
IO.ANSI.Docs - Properly render quote blocks #9684
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
IO.ANSI.Docs - Properly render quote blocks #9684
Conversation
Having such a styling would clash with quote inline styling which is non-trivial to resolve.
|
Thank you @sascha-wolf! Generally speaking, we try to render IO.ANSI as close to the original markup as possible, so I think we can render it as: Can you please adjust the code accordingly? Thank you. |
|
Sure thing! |
Now the formatting uses leading `>` instead of boxing the quote:
> first line
> second line
To differentiate it from "regular" text the leading `> ` character is formatted according to the `doc_quote` setting which is set to light_black for the time being.
|
I've updated the code to render quotes with a leading The end result looks like this: @josevalim the quote retains the lines as originally written in markdown. It would also be possible to wrap the lines using the same logic as According to Babelmark 2 most renderers just pop the content into a What do you think? |
|
Let’s use write_text because the lines originally written may be too short or too long! |
|
@josevalim I've updated the code to wrap the lines for quotes. The result now looks like this for |
|
I'll also extend the rendering to respect empty lines for quotes. |
|
@josevalim from my perspective everything is ready to go. 🙂 |
|
Thank you @sascha-wolf! |


Issue
This PR introduces markdown quote block handling in
IO.ANSI.Docs, for blocks such as this:Before this a quote was simply rendered as text which lead to the above quote looking like this:
> first line of quote > second line of quote > third line of
quoteAn example of this in the Elixir codebase can be seen in
Access(link to code). Which got rendered like this iniex:Solution
Instead of defining a specific quote style (such as
doc_quote) - which clashes with inline styling of text - this solution instead renders the quote's content in an ASCII-art box. As such the quote from above would be rendered like this:With this change the quote from
Accessnow gets rendered like this: