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 option to wrap lines in verbatim blocks using a wrap indicator and hanging indent #1812

Open
ericzolf opened this issue Nov 7, 2020 · 1 comment
Milestone

Comments

@ericzolf
Copy link

ericzolf commented Nov 7, 2020

Listing blocks currently can be either wrapped or non-wrapped, non-wrapped doesn't always work (especially not in PDFs), and wrapped makes the code/listing not very readable resp. can lead to confusion, hence the idea to have a nicer/clearer way to wrap lines. Asciidoc was able to do it, AFAICJ asciidoctor can't do it, and that's what I'd like to have.

To give an example, I'd have something like:

----
## the required sizing depends on the current and constantly growing size of each software repository.
----

which would be rendered as follows:

image

(it would be even cooler if the wrapped lines could be right aligned, it would make it even clearer that they're only the continuation of the first line, but indentation and arrow at the end of the first line would already be good enough)

Originally posted by @ericzolf in asciidoctor/asciidoctor#3820 (comment)

@ericzolf ericzolf changed the title I meant code in my documentation, more correctly "listing blocks". They currently can be either wrapped or non-wrapped, non-wrapped doesn't always work (especially not in PDFs), and wraped makes the code/listing not very readable resp. can lead to confusion, hence the idea to have a nicer/clearer way to wrap lines. Asciidoc was able to do it, AFAICJ asciidoctor can't do it, and that's what I'd like to have. [ENH] long listing block lines to be wrapped in a more readable way Nov 7, 2020
@mojavelinux mojavelinux changed the title [ENH] long listing block lines to be wrapped in a more readable way Add option to wrap lines in verbatim blocks using a wrap indicator and hanging indent Nov 7, 2020
@graphitefriction graphitefriction added this to the future milestone May 16, 2022
@mojavelinux
Copy link
Member

One way to indicate wrapping is by enabling line numbers. If I use the following source:

:source-highlighter: rouge

[%linenums,text]
----
## the required sizing depends on the current and constantly growing size of each software repository.
----

Then it will appear as follows:

linenum-wrap

The line number serves as another sort of wrap indicator.

I'll follow-up later with ideas for how you could add a wrap indicator using an extended converter.

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

No branches or pull requests

3 participants