Search code examples
wikimarkupconfluence

How do I create text file for Confluence and then import it as a Confluence wiki page?


Here is what I want to accomplish:

  1. I am writing a script which will parse some source code, extract some comments that I want it to extract and I will store this text in a text file.

  2. I want to write another script that uses the content of this text file to be programatically transformed into a Confluence wiki-page.

Please tell me the best way to do this. I already saw this

I felt that I could change the input in the above example to take input from text file and update contents of Confluence page. But, I am not sure how it will be formatted. If I have to format it, what do I need to do?

Thanks in advance!


Solution

  • As an alternative to XML-RPC you can use the integrated WebDAV plugin.

    1. Write a script that creates a directory in the selected space. The directory name will be the page name. After creating the directory a text-file with the same name (with .txt extension) will be created in the directory which holds the content of the page
    2. let your script edit this file in insert the content of your text-file.

    Information about the usage of the plugin: