Getting the confluence page content as plaintext using CLI .

Hi All,

Can we get the page content as plain text using CLI or by other means .

I tried below commands,

./confluence.sh --action renderPage --space "spacename" --title "This is title 1" --> this page as html

./confluence.sh -a getPageSource --space spacename --title "This is title 1"

Both does not not suffice the requirements.

Any suggestions will be apprecieated.

Thanks,

Aravind

2 answers

Confluence 4.x and above no longer has plain text source. Data is stored as XHTML. So, no, there is no way to retrieve plain text using the CLI. If you really need wiki back, you can use the wikifier.

Thanks for the update .

Is there any other way apart from CLI which i can use to get contents in plain text format .

Thanks for the update .

Is there any other way apart from CLI which i can use to get contents in plain text format .

No, there is not.

I was trying to export the spaces as html , XML using below commands

./confluence.sh --action exportSpace --space "zconfluencecliTarget" --file "target/output/confluencecli/export.html" --exportType "HTML"
./confluence.sh --action exportSpace --space "zconfluencecliTarget" --file "target/output/confluencecli/export.xml"

but the output html, XML has unicode charecters instead of text, Any idea why it happens

Also this is not seen when i try exporting this as pdf .

I was trying to use below commands to export the spaces as html, XML , but output generated has some encoding issues , the charecters are not displayed properly ,

./confluence.sh --action exportSpace --space "zconfluencecliTarget" --file "target/output/confluencecli/export.html" --exportType "HTML"
./confluence.sh --action exportSpace --space "zconfluencecliTarget" --file "target/output/confluencecli/export.xml"

any idea why it happens ?

You may need to open an issue so you can provide more details. You may need to specify the encoding parameter to match your Confluence setting.

Thanks for the reply .

specify the encoding parameter to match your Confluence setting.

Could you please let me know what encoding param needs to be specified.

For instance, if your Confluence is UTF8, then try --encoding UTF8

Thanks Bob.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Marketplace Apps

Tips on how to choose the best estimation method for your planning

Planning and grooming sessions all come with their own sets of rules. Team members meet to estimate stories or other work items, all according to an agreed-upon process. And with every session comes ...

77 views 0 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you