Can I link a Confluence code block macro to an existing source file?

I would like to be able to refer to a file in github and ideally specify the range of lines I want to display -- e.g. startline=27;lastline=40.

1 answer

This widget could not be displayed.

Hi Joe,

Text inserted into the code block macro must be manually typed or pasted in. It is not possible to link to a file.

I've created a feature request a while back to be able to drag and drop a file or text into the macro. If you're interested, please vote on it and watch it for further updates:

Kind regards,


Hi Shannon,

Thanks for your response! I saw your request and although that is interesting (I upvoted it) it is not what I am looking for. I actually want to be able to pull in current file contents from a link. 

I thought someone might tell me there is another macro I should be using, since this seems like an obvious feature.

I added CONFSERVER-54394 address this.




Thanks, Joe!

Both deal with using a file to fill the macro, so it may be closely related. We can suggest both outcomes.

I'll link your case to mine in case it would be the same feature.

Take care!


Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Tuesday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

107 views 12 6
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