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

Offset list level #172

Open
mdg583 opened this issue Feb 20, 2025 · 1 comment
Open

Offset list level #172

mdg583 opened this issue Feb 20, 2025 · 1 comment

Comments

@mdg583
Copy link

mdg583 commented Feb 20, 2025

The plugin is working very well to generate a sidebar menu. However I also want to integrate it into a site-wide TOC page, but I need to integrate the list into an existing list at a specific level. I want to use it something like this:


1.  list item
  1. sub-item
2. second list item
<nspages item:namespace -numberedList -tree -r -exclude -subns -pagesInNs -h1 -textNS="">

where the numbered list it generates should be offset in the tree by 1 so that the items fall under "second list item"

@gturri
Copy link
Owner

gturri commented Feb 21, 2025

Thanks for this feature request.
I'm afraid I won't have time to work on it soon, but it's interesting.
If someone is interested in trying to do a pull request that implement that feature, here are some pointers regarding how I think it should be implemented:

  • in function _getDefaultOptions in syntax.php add a new key for that new option and set the default value so that it's deactivated by default
  • in function handle in syntax.php add a line to parse that option
  • in the constructor of nspages_printerSimpleList (in printers/printerSimpleList.php) add a boolean parameter that represent whether this option is activated or not
  • in function _selectPrinter in syntax.php pass that new parameter to the "printer" according to the value of that option (in the cases simpleList and numberedList
  • Adapt the implementation of nspages_printerSimpleList so that it display a list with more indentation if that option is activated.
    That part is the one that I'm not too sure about, it will probably require to look into the methods available in Doku_Renderer_xhtml in order to find out which one to use

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

No branches or pull requests

2 participants