Going Stellar

Home/Confluence storage format reference

Confluence storage format

excerpt and include macros in Confluence storage format

The excerpt macro marks content for reuse, the excerpt-include macro shows a marked excerpt from another page, and the include macro shows a whole page. The source page is an unnamed parameter holding an ac:link. All three map to Confluence extension nodes in ADF and keep their parameters.

Storage format

<ac:structured-macro ac:name="excerpt"><ac:rich-text-body><p>excerpt text</p></ac:rich-text-body></ac:structured-macro>
<ac:structured-macro ac:name="excerpt"><ac:parameter ac:name="hidden">true</ac:parameter><ac:rich-text-body><p>hidden excerpt</p></ac:rich-text-body></ac:structured-macro>
<ac:structured-macro ac:name="excerpt-include"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>
<ac:structured-macro ac:name="include"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>

In the editor

HowNote
Type /insertexcerpt to place the insert excerpt macroPer the Atlassian documentation. The excerpt macro itself is found under the insert button, View more.

As ADF (Confluence Cloud)

The ADF that Confluence Cloud builds for:

<ac:structured-macro ac:name="excerpt"><ac:parameter ac:name="hidden">true</ac:parameter><ac:rich-text-body><p>hidden excerpt</p></ac:rich-text-body></ac:structured-macro>
{
 "type": "doc",
 "content": [
  {
   "type": "bodiedExtension",
   "attrs": {
    "extensionType": "com.atlassian.confluence.macro.core",
    "extensionKey": "excerpt",
    "parameters": {
     "macroParams": {
      "hidden": {
       "value": "true"
      },
      "_parentId": {
       "value": "<page id>"
      }
     },
     "macroMetadata": {
      "macroId": {
       "value": "<id>"
      },
      "schemaVersion": {
       "value": "1"
      },
      "title": "Excerpt"
     }
    }
   },
   "content": [
    {
     "type": "paragraph",
     "content": [
      {
       "text": "hidden excerpt",
       "type": "text"
      }
     ]
    }
   ]
  }
 ],
 "version": 1
}

Examples

Storage format sent

<ac:structured-macro ac:name="excerpt"><ac:rich-text-body><p>excerpt text</p></ac:rich-text-body></ac:structured-macro>

Mark a paragraph for reuse. On its own page the excerpt text is shown as normal content.

Rendered view (HTML)

excerpt text

Storage format after the round trip through ADF

<ac:structured-macro ac:name="excerpt" ac:schema-version="1" ac:macro-id="<id>"><ac:rich-text-body><p>excerpt text</p></ac:rich-text-body></ac:structured-macro>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="excerpt"><ac:parameter ac:name="hidden">true</ac:parameter><ac:rich-text-body><p>hidden excerpt</p></ac:rich-text-body></ac:structured-macro>

Hide the excerpt on its own page while keeping it available to other pages.

Rendered view (HTML)

Storage format after the round trip through ADF

<ac:structured-macro ac:name="excerpt" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name="hidden">true</ac:parameter><ac:rich-text-body><p>hidden excerpt</p></ac:rich-text-body></ac:structured-macro>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="excerpt-include"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>

Pull an excerpt from another page. The page named in the macro does not exist, so the stored view is an error message.

Rendered view (HTML)

<div class="error">Error rendering macro 'excerpt-include' : No link could be created for 'Page Title'.</div>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="excerpt-include" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>

Sent to Confluence Cloud on .

Storage format sent

<ac:structured-macro ac:name="include"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>

Include a whole page. A missing page produces an error message in the view.

Rendered view (HTML)

<div class="error conf-macro output-block" data-hasbody="false" data-macro-id="<id>" data-macro-name="include"><span class="error">Unable to render {include}</span> The included page could not be found.</div>

Storage format after the round trip through ADF

<ac:structured-macro ac:name="include" ac:schema-version="1" ac:macro-id="<id>"><ac:parameter ac:name=""><ac:link><ri:page ri:content-title="Page Title" /></ac:link></ac:parameter></ac:structured-macro>

Sent to Confluence Cloud on .

What changes in conversion

  • excerpt is a bodiedExtension with key excerpt, and the hidden parameter is kept with its value.
  • excerpt-include and include are extension nodes. The ac:link in the unnamed parameter is reduced to the page title in ADF and rebuilt as an ac:link with ri:page on the way back.
  • In ADF the extension title is Insert excerpt for excerpt-include and Include Page for include.
  • No loss was seen in the tested runs. Only a _parentId entry is added in ADF, and the macro id is regenerated.

Pitfalls

  • The excerpt-include macro needs an excerpt to exist on the named page. The tested page did not exist, so only the error text was observed.
  • A hidden excerpt renders as nothing on its own page. Check the other page to see the reuse.
  • Atlassian now points to synced blocks for reuse in the Cloud editor. The macro pages mention this at the top.

Questions and answers

What are the excerpt parameters?

The documentation lists a name, hidden, and in storage format atlassian-macro-output-type with BLOCK or INLINE. Only hidden was tested.

How is the source page written?

As an unnamed parameter that holds an ac:link with an ri:page and its content title.

Sources

  1. Insert the excerpt macro (Atlassian Support)
  2. Insert the excerpt include macro (Atlassian Support)
  3. Insert the include page macro (Atlassian Support)
  4. Atlassian Document Format: document structure (Atlassian Developer)

Markdown version · All storage format pages