owenh000 / asciidoctor-multipage

A configurable multipage HTML converter for Asciidoctor
https://owenh.net/asciidoctor-multipage
MIT License
58 stars 23 forks source link

Add some type of marker before the child list on each landing page #20

Open cirosantilli opened 3 years ago

cirosantilli commented 3 years ago

Can't do a sed hack, there absolutely no difference in the child list from a regular list: https://github.com/cirosantilli/china-dictatorship/blob/e7e9032f11734012f837c9003c39d085fa8afd31/push#L25

At gem 'asciidoctor-multipage', '0.0.12' It feels to me a bit too hard to separate the header body from he list of children that goes at the bottom.

This is especially true if the header ends in a large Asciidoctor list for example:

= h1

* one
* big
* list

== h2

== h3

it would be hard for readers to see that the list in h1 ends at list and that h2 and h3 that follow are the children as it renders something like:

* one
* big
* list

* h2
* h3

I would recommend adding a marker for that, e.g. saying Table of Contents or Children in bold. e.g. like:

* one
* big

== Table of contents

* h2
* h3

Sample live rendered example: https://cirosantilli.com/china-dictatorship/anti-ccp-info-sources.html that illustrates the difficulty.

Here's an example of the output style I went for on my own markup language: http://cirosantilli.com/evil#toc

owenh000 commented 3 years ago

Hi @cirosantilli, thanks for the feedback. Unfortunately I don't understand the problem. As I write this, the example you linked does not include any Table of Contents.

Please note that the asciidoctor-multipage extension does not have or maintain a stylesheet (only a few rules which can be disabled)—the stylesheet is maintained in the Asciidoctor project. And regardless, you're free to use a custom stylesheet instead of the default.

cirosantilli commented 3 years ago

Hi @cirosantilli, thanks for the feedback. Unfortunately I don't understand the problem. As I write this, the example you linked does not include any Table of Contents.

Hi, precisely, there is no Table contents. What I propose is that something like a <h1>table of contents</h1> or <h1>List of children</h1> be added automatically to the output before the child list.

owenh000 commented 3 years ago

@cirosantilli, the Table of Contents already has a title.

Here is the HTML portion:

<div id="toctitle">Table of Contents</div>

And here is a screenshot of the sample document in the repository:

sample

If there is still a problem or I am misunderstanding, please provide an example, test case, or screenshot clearly demonstrating it and re-open this issue.

cirosantilli commented 3 years ago

Just in case:

input.adoc

= h1

* big
* long
* list

== h2 

Desired multipage output:

h1.html

<h1>h1</h1>

<ul>
<li>big</li>
<li>long</li>
<li>list</li>
</ul>

<h2>Child sections</h2>

<ul>
<li><a href="h2.html">h2</a></li>
</ul>

Current multipage output: there is no h2 or anything that clearly separates list from h2. They are in two different lists, but this is not easy to see on the rendered output (there is a slightly taller vertical displacement, but it is not very easy to see for large lists)

<h1>h1</h1>

<ul>
<li>big</li>
<li>long</li>
<li>list</li>
</ul>
<ul>
<li><a href="h2.html">h2</a></li>
</ul>

This can be seen e.g. at: https://cirosantilli.com/china-dictatorship/anti-ccp-info-sources.html "Backlinks to this page" is the last list item, and "Reddit" is the first child.

Screenshot from 2021-08-27 09-26-13

owenh000 commented 3 years ago

@cirosantilli, so this isn't related to the Table of Contents, as mentioned in the title and description? The "Table of Contents" is the listing of all parts/chapters/etc. in the document, including (when asciidoctor-multipage is in use) those that are not included on the current page. In the screenshot from earlier, the Table of Contents is on the left side with a grey background.

From a writing style perspective, I recommend avoiding using multiple lists in succession. Instead use a regular paragraph to tell the reader what the new list contains. However, if you want more spacing between successive lists, just add this CSS rule, adjusting the margin value to suit you:

ul,ol,dl{margin-bottom:2em}

(As mentioned before, the asciidoctor-multipage extension does not have or maintain a stylesheet.)

cirosantilli commented 3 years ago

cirosantilli, so this isn't related to the Table of Contents, as mentioned in the title and description? The "Table of Contents" is the listing of all parts/chapters/etc. in the document, including (when asciidoctor-multipage is in use) those that are not included on the current page. In the screenshot from earlier, the Table of Contents is on the left side with a grey background.

Sorry if terminology was confusing. What I meant is that multipage essentially adds a one level ToC to every page automatically.

From a writing style perspective, I recommend avoiding using multiple lists in succession. Instead use a regular paragraph to tell the reader what the new list contains. However, if you want more spacing between successive lists, just add this CSS rule, adjusting the margin value to suit you:

Note that the input does not contain consecutive lists. Only the multipage does.

owenh000 commented 3 years ago

Note that the input does not contain consecutive lists. Only the multipage does.

Oh, okay. I understand now. You are suggesting that we add an h2 on each landing page before its list of child pages. Thanks for the examples and clarification.

In my opinion, the best solution here is to understand that your document output (with asciidoctor-multipage) will be generated using landing and leaf pages. Landing pages are not intended to contain document content; the purpose of those pages is to list child pages. As described in more detail over there, this extension is not designed for use as a website generator.

Still, I will leave this issue open in case there is need for further discussion.

rwoldu commented 1 year ago

+1 @cirosantilli I found an intermediate solution by adding "discrete heading" https://docs.asciidoctor.org/asciidoc/latest/blocks/discrete-headings/ whichdon't show up in the table of content

rwoldu commented 1 year ago

found another possibility using css:

.ulist:last-child:before {
    content: "Heading before child list:";

the list of child headers is always displayed at last on a page (except in the first page as "first-child")