Markdown from an attachment macro

The Markdown-attachment macro renders Markdown content from attachments located in the same or different pages and/or spaces. 

The Markdown content is rendered based on the permissions of the page and/or space. Any attachment available in a public location can be accessed and the Markdown content can be rendered. Currently, any links or images in Markdown content referring to a private repository, or a location that must be logged in to, cannot be accessed and thus, rendered.

Parameters

Macro browser labelDefaultDescriptionMacro parameter
Page for attachmentcurrent pageRefers to the page where the Markdown file is present.page
Name of attachment<required>Name of the attachment with the file extension.name
File encodingsystem default

Encoding for an external file if different from the system default handling.

encoding

Common parameters

Macro browser labelDefaultDescriptionMacro parameter
Idgenerated valueEnter the HTML ID of the div element surrounding the content.id
Find regex patterns

Enter a comma-separated list of regex patterns to dynamically update the output for Markdown content with find and replace logic.

Example: (href=)(/display)

find

Enter a comma-separated list of positions to search for patterns in the output content. Note that the positions are indexed beginning at "1". If a comma is a part of the search, use single quotes (') around it.

Example: http://www.google.com/$1

replace
Allow HTML tagsfalseEnable this option to allow embedded HTML tags in Markdown macros. This is a potential security exposure, so it is disabled by default. The Confluence administrator must explicitly authorize users or groups using Macro Security for Confluence.allowHtml
Hard wrap newlinestrue

Determines how newlines are treated. This is a GitHub Flavored Markdown extension that defaults to being turned on.

TextHard wrap (selected)Soft wrap (Hard wrap not selected)
Roses are red
Violets are blue
Roses are red
Violets are blue
Roses are red Violets are blue
hardwrap
Anchor links for headingsfalseEnable this option to automatically add anchor links for headings.headerLinks
Table class@default

Enter the CSS to be applied to rendered tables. 

  • @default - Apply default Confluence table class to rendered tables.
  • @none - Do not apply any style for rendered tables. 
  • userDefinedClass - Use a custom user-defined style for rendering Tables.
tableClass

Basic use

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

Selected from the macro browserMarkdown from an attachment
Markup shortcut{markdown-attachment}

Screenshot

  • Example using an attachment on the same page named README.md:


Find answers from the community.

Ask a question to the community.

Log a request with our support team.

Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.