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

Compare with Current View Page History

Version 1 Next »

projectdoc Toolbox

An overview over features employing placeholders to create a modular documentation.

Placeholders allow to define templates where transclusions supply context information that are inserted at render-time. This makes it possible to reuse a common form in multiple contexts. Transclusions support modular documentation and single sourcing.

 

There is another type placeholders used in blueprint wizards that are only applied during creation-time of a document. These placeholders are not addressed here.

For more information on this topic, please refer to Page Wizard Placeholder.

Defining Placeholders

Placeholders are defined in a document whose content is intended to be transcluded.

The projectdoc Toolbox supports two kinds of placeholders.

Simple Placeholders

A simple placeholder has a name and is delimited by a starting ${ and ends with a curly brace ('}').

${A simple placeholder}

Without transclusion simple placeholders are not replaced.

 

Supporting property references is in discussion for version 1.13: PDAC-671 - Getting issue details... STATUS

Simple placeholders are used by

  • Transclusion Macro - Transcludes content from a document marked with the content marker macro.
  • Code Block Placeholder Macro - Passes a text containing placeholders to the Code Block Macro. The placeholders are replaced by the properties of a document and/or the space properties.

Property References

A property reference is a macro that displays the value of a page or space property.

Properties are defined by the Document Properties Marker Macro and the Document Properties Supplier Macro.

Property placeholders simply render the value of a property. If a property is not defined an alternative value may be rendered which is specified with the macro.

Macros used to display the property values are

Replacing Placeholders

This is the part were a fragment from another document is transcluded and placeholders are replaced with a value.

The projectdoc Toolbox supports placeholder replacements in three different ways.

Explicit Replacement

An explicit replacements defines the replacement values with the transclusion macro.

This is an example for placeholder replacements in the body of the Transclusion Macro or the Transclude Documents Macro:

product-name=projectdoc Toolbox
product-version=2.0

And this is an example of a fragment that defines the placeholders:

There current version of ${product-name} is ${product-version}.

Here is another example with the Transclusion Macro where a letter is created using placeholders.

Context Replacement

The context replacement uses the properties defined on the page, the space the page is part of, and to spaces and pages the space or page delegates to. All properties accessible from a given point are part of the replacement context.

The Code Block Placeholder Macro uses the properties information form the page and space.

 

Currently it is not possible to replace simple placeholders with values supplied from document and space properties.

PDAC-670 - Getting issue details... STATUS is considering this approach.

Impersonator

The impersonator feature, available since version 1.13 of the projectdoc Toolbox, allows to use property references in transclusion by replacing the owning document. Usually a page is rendered in its own context. With an impersonator the page will rendered in the context of the transcluding page.

 

Assume there is a page that renders the value of its property 'A' in one of its sections. If the section is transcluded by another page that impersonates the page, the value rendered will be of the impersonating page instead of the transcluded page.

ModeValue of Property
ImpersonatingTranscluding Page
Not ImpersonatingTranscluded Page

The Transclusion Macro provides a property to define the impersonating page.

 

Currently this feature is under development. Track it under PDAC-663 - Getting issue details... STATUS .

Resources

For more information on this and related topics, refer to the following resources.

Rendering Code Fragments
Explains the differences between and commonalities of the Confluence Code Block Macro and the projectdoc Toolbox Code Block Placeholder Macro.
Code Block Placeholder Macro
Passes a text containing placeholders to the Code Block Macro. The placeholders are replaced by the properties of a document and/or the space properties.
Space Properties
Lists the configuration options at space level.
Using Space Properties
Space properties are defined for spaces and are accessed via the Space Property Macro. This tip goes into detail in how to use space properties with inheritence and extension pages.
Document Properties
Properties are metadata that can be added to every projectdoc document. If you require a set of metadata for each instance of a document type, you should write your own doctype.
Transclusion Macro
Transcludes content from a document marked with the content marker macro.
Transclude Documents Macro
Renders transcluded content fetched from documents of a result set.
Display Table Macro
Lists references to projectdoc documents in a table. Allows to select document properties for columns. Also non-list representations are provided.
Tour Macro
Renders a predefined list of documents in a table.
  • No labels