You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
In case an author requires to identify a document element to the reader, for instance a numbering of paragraphs or sentences, the Content Marker Macro allows to employ a page-related auto-numbering and provides means to specify the format in which these consecutive numbers are rendered.
The Content Marker Macro allows to wrap content with an identifier to form a content element. It also allows to associate the content element with a sequence. The projectdoc Toolbox then auto-numbers the content elements and allows to render this number with the content element.
This is useful for documents where readers need to identify content elements like paragraphs or sentences.
This tip shows a use case where the Content Marker Macro is used to track the definitions within a specification document.
Use case
Suppose you need to add a number on your definitions and explanations. Each definition and each explanation is enclosed on a Content Marker Macro. Each definition should have a number to be uniquely identified within the document, like Def.1, Def.2, and so on. The same is true for explanations: Expl.1, Expl.2, and so on.
Implementation
For this example there are three definition and two explanations within a chapter.
Each content marker has an identifier (D.1
, E.1
, D.2
, D.3
, and Example.1
) and a Render Counter (definition
or explanation
).
The identifier is not related to the render counter. It is probably more stable to identify the element not by the sequence name. If they are not related, references to the content need not to be changed if another content of the same type is added in front at a later time. You may either use a text phrase or some arbitrary identifier.
Styling the Render Counter
Without any formatting, the rendered content looks like this:
You may add appropriate styles for your design to you space or site style sheet. Alternatively you may use a render template or combine the two approaches.
CSS Styles
Each counter is rendered with the class projectdoc-render-counter-element
plus the name of the render counter.
projectdoc-render-counter-element definition
Render Counter Template
Add the style information as a space property named projectdoc.renderCounterElement.template.
and append your render counter name (e.g. projectdoc.renderCounterElement.template.definition
).
For a layout with tooltip you may use the Layout Element Macro.
Define the label for the counter in the body of the Layout Element Macro.
Note the use of {}
as a placeholder for the consecutive element counters.
The rendered content is now: