View git file macro
The View git file macro allows you to add a git file to the content of a Confluence page. The content of the macro will be up-to-date with the Git repository.
Last updated
The View git file macro allows you to add a git file to the content of a Confluence page. The content of the macro will be up-to-date with the Git repository.
Last updated
You can add the View git file macro to a Confluence page by using the macro browser. Alternatively, you can start typing {view git
and Confluence will suggest to add the View git file macro.
Once the macro is added to your page, you can select the Git file you want to add. There are also some additional options, which we will discuss later on.
Repository - Confluence Admins can configure one or more repositories, from which you can add Git files. Choose the repository from which you want to add a file.
Branch / Tag - You can select the branch or tag from which you want to select the file.
File path - Now add the full path to the file. You can click on the drop-down and navigate through folders to find the correct file.
Once you have selected a file, you can preview it by clicking on the refresh icon on the right-hand side of the macro. If it's the file that you want to add, you can click on Insert to add it to the page.
You can add a Git file macro by pasting a Git URL into a Confluence page, if the URL refers to a configured server and repository.
Pasting the URL in a document, the macro will check if it can be converted to a macro and will do so automatically. The URL will be removed and a macro will appear with all mandatory fields pre-filled. If the URL can not be resolved it will not be removed from the page by the app.
The first three options of the macro help you select the correct Git file. The remaining options can be used to change the way the macro and its content are displayed.
Update the preview on the right-hand side of the macro to see the effect of these options. You can update the preview by clicking on the refresh icon.
Language - You can select the language of the content in order to get syntax highlighting. Can't find the language of your file? Let us know.
Title - The title option adds a title to the macro. The title will be displayed at the top of the macro, below the file name.
Render panel - Macro files are rendered without a macro panel by default. If you would like to add a panel around the content, you can select this option.
Collapse - Select this option if you want to collapse the macro. Users can expand the macro to see its content. This option is useful when the macro takes up too much space.
Line numbers - This option adds line numbers to the macro.
First line / Last line - If you don't want to display the complete file, you can choose what lines to display. Simply add the number of the line you want to start with and/or the number of the line you want to stop at.
Themes - Themes change the color scheme of the file. Themes affect the background as well as the text of the file.
Git for Confluence adds support for natively rendering markdown files. This can be demonstrated through our test repository: git-for-confluence-reference
.
Git for Confluence adds support for natively rendering PlantUML. This can be demonstrated through our test repository: git-for-confluence-reference
. You can use the following file to test this feature: formats/plantuml/multi-page.puml
.
Initially the PlantUML file will be rendered as text. To render the file as an image, click on the Render PlantUML option.
Git for Confluence also supports the following image extensions natively
.PNG
.SVG
.JPG
.WEBP
.ICO