Modifying imported HTML to display code samples like code blocks

Alan Gray
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 8, 2013

I'm importing html code into a confluence page using the HTML macro. Can I modify the html code to display code examples so they display onscreen as if contained inside a code block?

4 answers

0 votes
Davin Studer
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.
February 17, 2014

You could add custom html in Confluence Admin and add a reference to a javascript syxtax highlighter such as this one ...
http://alexgorbatchev.com/SyntaxHighlighter/

Then it is just a matter of formatting your html in the html macro to work with the syntax highlighter. Is this what you are looking for?

Matthew J. Horn
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.
February 17, 2014

For me, it's all about being able to embed external files at page-load time, so that the files can sit in a separate repository.

0 votes
Matthew J. Horn
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.
February 17, 2014

I, too, would like to know if this is possible.

0 votes
Ramon Ramon
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 17, 2014

Did you ever figure this out? We're looking to do the same: create and maintain technical documentation in Confluence, and embed code snippets from sample code that is either stored as an attachment, or stored externally (e.g. in GitHub or similar)

0 votes
EddieW
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.
October 9, 2013

Are you displaying a remote page, or inline HTML?

You could likely do this with some custom CSS to modify the html presentation. https://confluence.atlassian.com/display/DOC/Styling+Confluence+with+CSS

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events