-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
AsciiDoc lists have extra space (when compared to Markdown output) #1087
Comments
Can you provide with an example of your source? I have never heard this 2014-09-11 22:52 GMT+02:00 sgilda notifications@github.com:
+----------------------------------------------------------+ |
Sure. For a comparison, see how the following files render on Github: https://github.com/sgilda/playground/blob/master/file-asciidoc.asciidoc https://github.com/sgilda/playground/blob/master/file-markdown.md |
It just so happens we've been discussing this topic this week on the tags around list item text. See https://groups.google.com/forum/#!topic/asciidoc/BF9HlACuNjE Note that I did something slightly different in the EPUB3 converter, which https://github.com/asciidoctor/asciidoctor-epub3/blob/master/lib/asciidoctor-epub3/converter.rb#L610 I wrap the item's "principal" text in a instead of a . The text |
The fact that they look different on GitHub is a slightly different issue. AsciiDoc relies on a stylesheet to fill in some features. GitHub renders AsciiDoc without any help from the stylesheet, so we fall back to the default styling of HTML tags. This is something we still need to address with AsciiDoc support on GitHub. |
I've updated the issue title so it better reflects the discussion. |
@mojavelinux : Thanks for following up on this and providing this information. It's not an urgent issue. Just an observation. :-) |
Some additional insight: What I discovered when implementing clean room HTML5 for the EPUB3 converter is that if we simply remove the |
I was thinking there is one other way around this problem that would possibly allow us to drop the In other words, a simple list might look like:
I'll need to play around with the CSS to determine if it's better to flag the simple or compound list (or both). To clarify, we'd be passing a hint to CSS about what type of content the list contains. |
Oh yeah, I remember another reason why I needed the |
@mojavelinux What's min required css should be included to fix this "bug"? |
I noticed the same issue when migrating my READMEs from md to adoc. Any idea when you will start using span instead of p ? |
I have it scheduled for 1.6.0. The default Asciidoctor stylesheet provides the CSS necessary to make it render more compact. However, it's going to look expanded on GitHub until the HTML changes because GitHub doesn't (and won't likely) provide the necessary styles. But hey, they could surprise us :) |
+1 for this. I also find the lists too "spread out" when converting to HTML. |
Also related to #1221. |
I don't want to nag, but is there any progress on this issue? :) |
@89z If you're unhappy with a design decision of a product you're using for free, I've great news for you. Asciidoctor is Open Source. Nothing prevents you from forking it and making the changes you deem necessary. |
@89z Of course not… The maintainers do not wish to remove the I simply asked GitHub to either tweak the CSS they generate (to simply remove padding for first |
@89z I surely know nobody forces you to use GitHub or Asciidoctor. I surelly know that @mojavelinux already commented on the issue in detail. I surely know bad attitude when I see it. |
Please stop this argument. It's off the rails, distracting, and not productive. I never said I wasn't going to implement the solution previously agreed on. I merely pointed out that this is a display issue. I stated that to emphasize that it's not something that is controlled by the AsciiDoc source, but rather by the output Asciidoctor produces and how that output is styled. That output can be controlled by CSS where CSS can be controlled. GitHub happens to style |
If you are using Refined GitHub (if not, you should!), you can define the following styles to remove margins: .markdown-body li>p {
margin-top: 0;
margin-bottom: 0;
} Open the extension options and copy-paste the above styles in the "Custom CSS" text area: And here's the result:
https://github.com/opendevise/asciidoc-samples/blob/master/demo.adoc#1-first-steps-with-asciidoc |
Folks, a lot of comments here. So, how on GitHub can I achieve compact spacing in bulleted lists for any popular browser (without using the extension) using |
@sskras you can open a support ticket at https://support.github.com/. Hopefully, if enough people ask for this, they will do something. |
I and others are waiting for the Personally, I'm working on a Soupault plugin to clean up all of the issues I'm finding with AsciiDoc output. Currently this list includes:
Maybe I'll report back once it's more stable |
Reporting back tangentially... https://git.sr.ht/~toastal/sourcehut-asciidoc-renderer I've made a Nix script to help do READMEs or other docs in on Sourcehut. This script include stripping these extra |
The question is not whether it is a bug. The output is the way it is because it was developed initially to be consistent with the output that AsciiDoc.py generated. Changing that structure years after the fact would affect every single user of Asciidoctor in some way, and I'm just not going to do that to this community. It's too late to change the markup in the existing built-in converter. That's why we are changing it in the new HTML converter. See #242. |
Ah, I did not consider that this would break AsciiDoc (:snake: version). This is a fair consideration and I don't disagree with your plan. There are two problems though:
I subscribed to the #242 issue though. It will be cool to see what comes of it. |
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
Makes it look better on Github at least. See asciidoctor/asciidoctor#1087
It's not fun to maintain both formats, and I think we should aim to ditch the markdown in the future, but for now, since it's non-trivial to have asciidoc show up in GitHub pages, let's keep both. Includes: - Introduction of a separate yaml file for static docs text to make maintenance less annoying. - Move and rename the templates. - Some inline html to work around an ascii doc annoyance related to putting p elements inside li elements in lists, that makes lists look bad on Github. (See asciidoctor/asciidoctor#1087 ) Notes: - I considered having a docs-templates and a docs-output directory but decided just to keep it all together. - It would be fun to create a proper make rule that built the docs only when needed, but since the rebuild takes a millisecond it doesn't seem worth the trouble. Also I've spent too long on this already probably. JIRA: HACBS-607
It's not fun to maintain both formats, and I think we should aim to ditch the markdown in the future, but for now, since it's non-trivial to have asciidoc show up in GitHub pages, let's keep both. Includes: - Introduction of a separate yaml file for static docs text to make maintenance less annoying. - Move and rename the templates. - Some inline html to work around an ascii doc annoyance related to putting p elements inside li elements in lists, that makes lists look bad on Github. (See asciidoctor/asciidoctor#1087 ) Notes: - It would be fun to create a proper make rule that built the docs only when needed, but since the rebuild takes a millisecond it doesn't seem worth the trouble. Also I've spent too long on this already probably. JIRA: HACBS-607
It's not fun to maintain both formats, and I think we should aim to ditch the markdown in the future, but for now, since it's non-trivial to have asciidoc show up in GitHub pages, let's keep both. Includes: - Introduction of a separate yaml file for static docs text to make maintenance less annoying. - Move and rename the templates. - Some inline html to work around an ascii doc annoyance related to putting p elements inside li elements in lists, that makes lists look bad on Github. (See asciidoctor/asciidoctor#1087 ) Notes: - It would be fun to create a proper make rule that built the docs only when needed, but since the rebuild takes a millisecond it doesn't seem worth the trouble. Also I've spent too long on this already probably. JIRA: HACBS-607
It's not fun to maintain both formats, and I think we should aim to ditch the markdown in the future, but for now, since it's non-trivial to have asciidoc show up in GitHub pages, let's keep both. Includes: - Introduction of a separate yaml file for static docs text to make maintenance less annoying. - Move and rename the templates. - Some inline html to work around an ascii doc annoyance related to putting p elements inside li elements in lists, that makes lists look bad on Github. (See asciidoctor/asciidoctor#1087 ) Notes: - It would be fun to create a proper make rule that built the docs only when needed, but since the rebuild takes a millisecond it doesn't seem worth the trouble. Also I've spent too long on this already probably. JIRA: HACBS-607
Hi, I'd like to express my interest in this feature. I agree that changing stylesheets would be a proper solution, but too often these days we do not control the styling, e.g. I use asciidoc on github, gitlab, vscode preview extension and so on. Particularly, now I experience this problem with jekyll SSG and a custom theme, but, fortunately, there I have some control over CSS files. By the way, to retain backward-compatibility, an extra list modifier can be introduced, like the one suggested earlier by @tringuyen-yw :
|
As I've already stated:
Btw, you are free to add a compact role on the list, then modify the CSS accordingly. You have all the control you need to achieve the appearance you want. The main issue here is whether the principal text is wrapped in a paragraph by default. In the new HTML converter, it will not be. It will instead be wrapped in a span, making it easier to get compact by default with the option to add more space using targeted CSS. |
Current version of asciidoctor includes a <p> around <li>s. This avoids that. See asciidoctor/asciidoctor#1087
I am converting Markdown files to Asciidoc. Simple lists render strangely using Asciidoctor.
This is the source:
This is a list:
Asciidoctor renders list items with a
<p></p>
tag and the resulting list has blank lines betweenlist items, resulting in a very spread out list.
The resulting HTML rendered by Asciidoctor:
Markdown files render more compactly like this:
The text was updated successfully, but these errors were encountered: