Dokuwiki Migration - Various topics (change page template, code macro defaults, refactorings...)

Hello, I am a new user to XWiki. One of the first things was I migrated my Dokuwiki to XWiki. So far everything looks neat, but four issues came up:

  1. In Dokuwiki I have a table of contents on every page. I see I can achieve the same effect using a page template of “Simple page” for new pages instead of the “Empty page” template that was used for the migration. I found out, that I can retro-fit the “box” macro, to my pages, by manually copying the macro text to the existing page so I can get the ToC on the imported pages. The problem is: Is there not a way to just change them ALL to include this macro? Do I really need to change every page by hand? I have about 200 pages to change… (I found this here: Change page type after creating - but this also seems to suggest to do it manually?)

  2. I use the “code” macro a LOT in Dokuwiki. Usually I didn’t specify any language to render, and it fits fine (I use it mainly for shell output visualizations). However XWiki seems to try to render everything with color highlighting, so for example “$” are colored and “;”. I found out, I can make it look proper when I explicitly specify the language “console” afterwards, the problem is just I again would need to change a lot of those macros on many pages. I hoped I could just change a global default, so that instead of auto-detection I would always get the “console” template and only for those where I want python, yaml, … I would specify so. I see there is a property “rendering.macro.code.pygments.style” in xcode.properties, but this just seems to affect the theme, not the language.

  3. The “Navigation” pane on the left hand side of the pages only shows about 15-16 entries of my ca. 50 entries before showing “29 more…” Is there a way to specify how many entries are listed by default? I’d like to have it shown completely if possible.

  4. I started creating my wiki in Dokuwiki with few big pages with 10-20 subsections each. I now realize it might be better to make a dedicated page out of every section. Is there a way to easily select a portion of a page and then say “Refactor → into new page” or something like that, so I can literally move parts of a page into something new instead of manually creating a new page side-by-side and copy/pasting stuff?

Thank you!

Hello,

I hope you’re enjoying XWiki. What you posted is interesting especially from someone coming from another wiki, please continue to send needs.

I have 2 ideas that come to mind:

  1. Use a panel and display the TOC in the panel (see Loading...)
  2. Edit the skin (or create a new one) and override the contentview.vm template to add a TOC

I don’t think we can change the default language in the code macro (right now when you don’t specify a language, it’s guessed by pygments).

That should be doable by editing the Navigation Panel and specifying a parameter/updating it for the {{documentTree}} macro.

There’s no such refactoring. The simplest is to edit using the wiki editor mode and do copy paste.

Thanks

Thank you!

Ad 1) Yes a panel would be perfectly fine. I was actually thinking about that at first but couldn’t figure out how to do this. Will try!

Ad 2) The latest status is still that the code macro is planned for general redesign but has not been done, right?

Ad 3) Thank you, will try

Ad 4) So basically open 2 pages and doing side-by-side editing, correct?

Ad 3) Where exactly am I editing the Navigation Panel please?
I am looking at Global at “bin/admin/XWiki/XWikiPreferences?editor=globaladmin&section=panels.navigation” but there doesn’t seem to be an edit option?

image

Could you kindly guide me, where I find the relevant option?

I think I found it:

https://xwiki.home.bigigloo.de/bin/edit/Panels/Navigation

Searched for “documentTree” amd changed it to:

"{{documentTree showTranslations="false" showAttachments="false" compact="true" openTo="document:$openToDoc"
  exclusions="$exclusions" limit="50" /}}" 

Is this the proper way to edit it?

Yes. I guess you saw https://extensions.xwiki.org/xwiki/bin/view/Extension/Document+Tree+Macro#HParameters

Yes (it’s not on the roadmap of the XWiki core developers though, but anyone can contribute so if someone implements it, it could happen at any time :)).

Exactly! That’s where I ended up. I got a warning before editing the page that I could break something.
Will these changes survive xwiki upgrades or do they need to be redone? Currently running xwiki in a docker environment

The changes will survive (XWiki upgrade process will try to do a merge and if there’s a conflict it’ll show you the diffs and ask you to choose what to do, see https://extensions.xwiki.org/xwiki/bin/view/Extension/Extension%20Manager%20Application#HUpgrade ).

1 Like