gturri / nspages

Plugin for dokuwiki - Display tables of content
http://www.dokuwiki.org/plugin:nspages
GNU General Public License v2.0
25 stars 24 forks source link

list pages for ThisNS in a generic format #128

Closed GitWonder closed 4 weeks ago

GitWonder commented 2 years ago

Is there a way to compile a list of pages for this namespace in a generic way, i.e. <nspages .:> or <nspages @currentNS> rather than explicitly name the namespace? This would enable me to more freely move and rename pages and namespaces and also template the format.

gturri commented 2 years ago

If I understand correctly what you say, I think that just <nspages> should be what you are looking for. Does that answer you qyestion? If it does not, please let me know what I misunderstood.

GitWonder commented 2 years ago

I am building a wiki for handover to a client. All the plugins I am using need to be as generic in their execution as possible. does a lot of what is needed but I can't see a generic method of displaying pages/namespaces within namespaces

If I have docs namespace containing process namespace containing process 1 page and hr processes namespace `[docs] docs.txt

|- [processes]

|- process.txt

|--- [hr_processes]

|--- hr_processes.txt

|----- hr_process_1.txt`

(GitHub code blocks are not the best diagramming method sorry)

What I need is if I were to place the code in the top level docs it would correctly show the index of everything from root down, but if I were to paste the same code to [hr_processes] it would show the index for everything in hr_processes only.

All the other plug-ins I've looked at require the namespace to be specifically declared which is causing me a lot of pain while structure is being finalised - movePage doesn't properly interact and the second issue is that I can't just place the code in a template and let the user create their page within a scaffold of genericised statements.

gturri commented 2 years ago

If I understand correctly your example, just putting <nspages> on your page should do what you want:

Does that fit your needs?

GitWonder commented 2 years ago

Yes that is exactly what I am looking for.

EDIT I think I misunderstand where the start page for a namespace is meant to reside. Should the start page be IN the namespace our outside the namespace? END EDIT

I think there is something wrong with my Dokuwiki setup then because if I place at the top of my hierarchy and use the same in hr_processes.txt it does not show just the pages in [hr_processes] (ie just hr_processes_1.txt), it shows the entire hierarchy from [docs] down

gturri commented 2 years ago

I'm not sure I understand the behavior you describe. Could you reproduce the issue on a public instance of dokuwiki and send me the url so I could see it for myself?

gturri commented 2 years ago

I'm noticing that I missed your edition, and it's possible that this is the explanation of this behavior. My understanding is that:

I'm not too sure if that's a bug in nspages or if it's a bug in a Dokuwiki API used by ns pages (and I'm not sure I'll have time to figure it out any time soon, so I guess I'll leave this bug report open for now). Anyway, it seems that in your wiki you have :hr_processes, and a solution would be to move this page to :hr_processes:start instead.

gturri commented 4 weeks ago

This should be fixed by the last version, as you can now use <nspages ~> on your page and it should lead to the required behavior (ie: considering that the current page represents the sub-namespace you're interested in)