Hi,
I am in the process of creating a Groovy script to import a Github wiki into XWiki. What I have done so far:
- Cloned the Github wiki (which is an ordinary Git repo with Markdown documents);
- Opened the
_Sidebar.md
file from that wiki, because that contains the table of contents; - Extracted all Markdown links from that TOC and found each corresponding
.md
file.
Now I want to create a wiki page for eacht .md
file I found. I have browsed the API docs and found things like createDocumentReference
. I also found some examples that use createDocumentReference
. All examples I found do a redirect after that, but I don’t want that, I want to create the pages “in the background”.
I have a couple of questions:
- Should I use
createDocumentReference
orcreatePageReference
? What’s the difference? - If I call just
createDocumentReference
from Groovy, nothing seems to happen. I suppose I have to take some additional action to actually save/create the page? - How do I add the contents to a page I created this way, from Groovy?
- How do I set the rendering engine to ‘Markdown’ for each created page?
I hope someone can help me with this step. Thanks in advance!
Best regards,
Bart Kummel