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?
Does the DokuWiki feature read and display the contents of the file?
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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. ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.