asciidoctor-lists icon indicating copy to clipboard operation
asciidoctor-lists copied to clipboard

Feature request: show page number

Open gregorypeckdom opened this issue 2 years ago • 9 comments

When using asciidoctor-lists with asciidoctor-pdf, could you add the ability to show the page numbers? Ideally, it would be great if the asiidoctor-lists content were to be formatted similarly to the table of contents.

I'm creating the PDF via this command line. asciidoctor-pdf -n -o out.pdf -r asciidoctor-lists lists.adoc

And my source is: lists.adoc.txt

Thank you. Just wanted to add I really like your project as well.

gregorypeckdom avatar Oct 21 '22 21:10 gregorypeckdom

@gregorypeckdom I think that the feature you recommended, is a good idea. However, unfortunately paid work is keeping me busy, but pull requests are welcome! :)

Alwinator avatar Oct 23 '22 11:10 Alwinator

I am also interested in this feature and ready to invest some time, but I have no clue how to get the page number.

But I found this which could be helpful: https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#access-page-number-from-inline-macro

rdmueller avatar Nov 04 '22 16:11 rdmueller

Hello, @Alwinator thank you for creating this extension. It's unfortunate that it doesn't match the style of the ToC.

I have presented an alternative: https://github.com/asciidoctor/asciidoctor-extensions-lab/issues/111#issuecomment-1448455956 https://github.com/bai-yi-bai/asciidoctor-pdf-list-of-figures/blob/main/LoF/lof_extension_render_like_toc.rb

bai-yi-bai avatar Mar 01 '23 01:03 bai-yi-bai

@bai-yi-bai Thank you, it would be cool if you could create a pull request. Maybe that you can show it in your format (as an optional feature).

Alwinator avatar Mar 19 '23 10:03 Alwinator

@Alwinator I sent you a message on the zulipchat, let's continue discussing there.

bai-yi-bai avatar Mar 19 '23 14:03 bai-yi-bai

Hi @Alwinator and @bai-yi-bai First of all, many thanks to your contributions, very much appreciated! I would like to follow up on this open issue, is there a different library that may be used, which allows to display page numbers for a list of figures / tables / listings?

I have tried your asciidoctor-lists library but it does not seem to print any page numbers.

Best regards Jan

j-ruch avatar Sep 01 '24 15:09 j-ruch

@j-ruch, yes there is. At the end of 2023 I expanded upon the code. I included a link from my GitHub's readme.md file to AsciiDoctor-PDF-LoFTE.

https://gitlab.com/baiyibai/asciidoctor-pdf-lofte

bai-yi-bai avatar Sep 01 '24 16:09 bai-yi-bai

Hi @bai-yi-bai Thanks a lot for your message. I tested your project and it seems to work. However, the formatting of my ToC sort of changed now, the toc-levels are reduced to 1 instead of 2. I will probably look into this when I find the time.

Additionally, is it possible to change the occurence of the LoFTE from the beginning to the end of the document?

j-ruch avatar Sep 02 '24 08:09 j-ruch

@j-ruch you're welcome, and I want to say thank you as well. Thanks to you, I discovered that there were open issues on my GitLab project... I assumed that issues would automatically be assigned to me. I just made a small fix to remove an extra ||.

Regarding your questions, try adjusting the entry.level setting in the code; you might also need to adjust your theme. As far as placement of the LoFTE, these lists hook into the ToC, so wherever you define the ToC is where they will "live". If you'd like, feel free to message me on the zulipchat or if you have further questions, open an issue on my GitLab and @ me.

To try to steer this back to the original topic. I'd just like to mention that I plan to begin migrating to AsciiDoctor-WebPDF at some point next year and I will likely invest my own effort to make sure that these lists are usable.

bai-yi-bai avatar Sep 02 '24 18:09 bai-yi-bai