Getting the confluence page content as plaintext using CLI .

aravind May 14, 2013

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

0 votes
aravind May 14, 2013

Thanks Bob.

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2013

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.

aravind May 14, 2013

Thanks for the update .

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

aravind May 14, 2013

Thanks for the update .

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

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 14, 2013

No, there is not.

aravind May 16, 2013

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 .

aravind May 16, 2013

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 ?

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2013

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.

aravind May 16, 2013

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.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2013

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events