Skip to end of banner
Go to start of banner

Code Pro macro

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 33 Next »

On this page

Overview

The Code Pro macro extends the native code macro. The following features are included:

  • Source code can be from any of these sources:
    1. Within your Confluence page (same as the code macro).
    2. From an external URL. For example: Bitbucket, GitHub, or Stash.
    3. From a file residing on the Confluence server. For example, a clone of a Git or Mercurial repository.
    4. From a page attachment.
    5. From a global or space template.
  • Syntax highlighting equivalent to code macro. Recognizes the same language extensions added to the code macro.
  • Supports all the current code macro parameters.
  • Subset by line number or regex selection - see Sections parameter. Allows showing one or more sections of code from the same source.
  • Expand and collapse support similar to the expand macro. Option to show or collapse on initial display.
  • Automatic title generation from the file or path name.
  • Profiles allow administrators to pre-configure access to repositories and hide access credentials.
  • Enabled for Macro Security for Confluence to allow control of url and profile parameters. See Macro Security Managed Macros.

Under the covers

After retrieving the source code from the various sources, the code macro is then used under the covers. This means behavior will be equivalent to existing code macro behavior! The native code macro must be enabled (the default).


Basic use

This macro can be deployed using one of the following methods:

Selected from the Macro Browsercode-pro
Markup Shortcut{code-pro}

Screenshot

Parameters

(info) Click a column heading to toggle the sorting of that column.

Examples

You can get source from virtually any repository or other source of data provided they provide a url link to the raw source text (as if you were downloading the source file). Here are just a few examples.


  • No labels