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

list pages for ThisNS in a generic format #128

Open
GitWonder opened this issue Aug 19, 2022 · 6 comments
Open

list pages for ThisNS in a generic format #128

GitWonder opened this issue Aug 19, 2022 · 6 comments

Comments

@GitWonder
Copy link

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
Copy link
Owner

gturri commented Aug 19, 2022

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
Copy link
Author

GitWonder commented Aug 19, 2022

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
Copy link
Owner

gturri commented Aug 20, 2022

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

  • if you put <nspages> on a top levels docs it would show the index of everything in the root
  • if you put the same code (i.e.: still <nspages>, without option) on hr_processes it would show pages in in the hr_processes namespace only (because when no namespace is provided, this plugin consider we're interested in the current one)

Does that fit your needs?

@GitWonder
Copy link
Author

GitWonder commented Aug 20, 2022

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
Copy link
Owner

gturri commented Aug 21, 2022

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
Copy link
Owner

gturri commented Aug 21, 2022

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

  • Dokuwiki considers that there are 2 possible options for the location of the main page of a namespace. Namely, the main page of the namespace :hr_processes may be either:

    • :hr_processes:start
    • or :hr_processes
  • However nspages does not implement the exact same logic: it considers that:

    • :hr_processes:start is part of the namespace :hr_processes:
    • but that :hr_processes is not part of it (it considers that it is part of the parent namespace)

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.

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

No branches or pull requests

2 participants