Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Does Confluence support downloadable text?

egrant June 4, 2019

I'm coming from DokuWiki, and I'm looking for a specific feature. In DokuWiki, it's possible to put <file> tags around text content: https://www.dokuwiki.org/wiki:syntax#downloadable_code_blocks

 

For example:

<file - myexample.txt>
This is content I want to display to users, but they can also download it as a file.
</file>

Users will see a link above the content, "myexample.txt", and when they click the link, the content is downloaded as a text file to their machine. Does Confluence do anything similar? Is there a Marketplace plugin?

1 answer

0 votes
Bill Bailey
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.
June 5, 2019

Does the DokuWiki feature read and display the contents of the file?

egrant June 5, 2019

Essentially, there is no "file" until you download it as one. You're just editing text. Here's another example:

 

<file php myexample.php>

<?php echo "hello world!"; ?>

</file>

 

The result looks like this, so a user can click the "myexample.php" link and it will download a file with the format specified, and the text you entered as its contents:

 

screenshot.png

Bill Bailey
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.
June 5, 2019

So how does this differ from the having a hyperlink to a file and then the contents pasted in the code macro?

If I am understanding what this is, you could easily create a user macro (with CSS) to mimic this presentation.

egrant June 5, 2019

This is different because I don't have to create an entirely different file and link it.

 

On a single page, I can do this:

 

Intro To Our Scripts

Paragraph describing best practices. Here's some more relevant information. We use the following script to run XYZ function, download it and try it yourself.

screenshot.png

Next paragraph ...

 

And more importantly, I can make edits directly to the "file" contents right on the page! I don't have to track uploads, make separate edits ... all I have to do is change the text between the <file> tags, and presto, users get a new version to see on the page, and download.

Bill Bailey
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.
June 5, 2019

Ah, so you are not viewing an attachment, but able to download the code between those structures.

No, I know of no plugin, but could search the marketplace to see.

I would copy and paste the code. ;-)

egrant June 6, 2019

Correct. I looked in the marketplace, but didn't find anything that would allow this.

As I'm not a developer, it looks like I'm out of luck. DokuWiki will have to remain my go-to unless this feature is ever developed.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events