Alwinator / asciidoctor-lists

An asciidoctor extension that adds a list of figures, a list of tables, or a list of anything you want!
Mozilla Public License 2.0
37 stars 11 forks source link

Feature request: show page number #14

Open gregorypeckdom opened 1 year ago

gregorypeckdom commented 1 year ago

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.

Alwinator commented 1 year ago

@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! :)

rdmueller commented 1 year ago

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

bai-yi-bai commented 1 year ago

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

Alwinator commented 1 year ago

@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).

bai-yi-bai commented 1 year ago

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

j-ruch commented 1 week ago

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

bai-yi-bai commented 1 week ago

@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

j-ruch commented 1 week ago

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?

bai-yi-bai commented 1 week ago

@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.