Reusable attributes

This page explains how to use reusable metadata, or attributes, across multiple AsciiDoc documents in Fedora Documentation.

Why reusable attributes?

Sometimes you may want to use the same data across many AsciiDoc documents. Some examples are below:

For these and more use cases, attributes allow you to define some metadata in a single place, and reuse it in multiple places.

Overview

There are two requirements for your Fedora Documentation project to use attributes.

  1. Import attributes in your AsciiDoc file

  2. Create an attributes file

Create attributes file

First, initialize an attributes file for a specific module, as shown below:

.
└── ROOT
    ├── nav.adoc
    └── pages
        ├── index.adoc
        └── _partials
            └── attributes.adoc

This is an example attributes.adoc from the Fedora Diversity & Inclusion Team:

:COMMBLOG: https://communityblog.fedoraproject.org
:FISCALYEAR: FY20
:FWIKI: https://fedoraproject.org/wiki
:YEAR: 2020
:MAILINGLIST: https://lists.fedoraproject.org/archives/list/diversity@lists.fedoraproject.org/
:MAJOROSVER: 32

Import attributes

Next, import the attributes file into your AsciiDoc document. Placing this macro on the top line will do the rest:

include::{partialsdir}/attributes.adoc[]

Use attributes in documentation

After creating an attributes file AND import attributes, reference the attributes in AsciiDoc documents with the following syntax:

{ATTRIBUTE}

See this example from the Fedora Diversity & Inclusion Team:

*Full consensus* is required to approve new processes, make changes to
existing team policies, and tickets requiring
https://budget.fedoraproject.org/budget/{FISCALYEAR}/d-i.html[D&I budget].