Are there any macros that allow you to put a link to a file in SVN from a wiki page that will show the contents of that file as part of the wiki page when you save it?

3 answers

0 vote
Davin Studer Community Champion Jul 13, 2016

What kind of file is it? Also, is there a URL accessible to the file in the SVN repo?

It's a text file (BDD test results, actually). Yes, there's a URL.  The idea is for developers to generate the file during each build and by using a link to the generated file from documentation in confluence, the content will always be up to date.

0 vote
Davin Studer Community Champion Jul 13, 2016

Here is a user macro I created a while ago that can do this. It would require allowing CORS on your SVN server.

## Developed by: Davin Studer
## Date created: 05/07/2014
## @param URL:title=Text File URL|type=string|required=true|desc=
#set( $id=$action.dateFormatter.calendar.timeInMillis )
#set( $d = "$" )
<div id="text$id">
    <ac:structured-macro ac:name="noformat">
		<ac:parameter ac:name="nopanel">true</ac:parameter>
		<ac:plain-text-body><![CDATA[ ]]></ac:plain-text-body>
	</ac:structured-macro>
</div>
<script type="text/javascript">
AJS.toInit(function(){
    AJS.${d}.get("${paramURL}", function( data ) {
        AJS.$('#text${id} pre').text(data);
    });
});
</script>

Thanks, Davin!  I'm checking with the administrators here and I'll let you know if it works out.

Cheers,

Marty

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

251 views 11 10
Join discussion

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