- Created by Robert Reiner, last modified on 23. Jan 2020
projectdoc Toolbox
Renders code of attached file, referenced by local property, with placeholders replaced by properties.
- Tags
- ID
projectdoc-ref-attachment-code-block-placeholder-macro
- Suite
- Since
- 3.1
Parameters
Property
The property with a reference to a locally attached file.
The Attachment Link Macro may be used to reference the attached file as a property value.
Document
The document to fetch property values for the placeholders. If not specified, the current document is used.
Apply Space Properties
If checked the properties defined by the space of the document this macro is part of are applied as defaults.
Snippet ID
The identifier of the snippet to include.
With the line after the line containing the identifier the snippet starts. The line marking the end of the snippet again includes this identifier (and this line is also not part of the snippet).
Example with Snippet ID
The example can be fetched with the ID 'important
'.
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [important] Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. [important] Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Lines
The line or line ranges to match. There may be multiple line ranges, separated by comma.
Here are some examples:
Specified | Description | |
---|---|---|
-12 | Transclude all lines up to and including line 12. | |
23 | Transclude line 23 only. | |
42-50 | Transclude lines 42 to 50, both edge values included. | |
90- | Transclude from line 90 to the end of the file. | |
-12, 23, 42-50, 90- | All of the above in combination. |
Please note that this information is not used, if a snippet ID is provided.
Encoding
The encoding of the file. Defaults to the character type announced by the response.
Use extra Snippet Marker
Check if the extra labels "SNIPPET START
" and "SNIPPET END
" should assumed. This may help to make you snippet ID marker unique without having to add this identifier parts with the snippet ID explicitly.
Example with Snippet ID
The example can be fetched with the ID 'important
', but makes it less likely to match an arbitrary string in the text..
Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. [SNIPPET START important] Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. [SNIPPET END important] Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Code Syntax highlighting
This value is passed to the Code Block Macro.
The value "Default Language" refers to the value provided by the space property "Code Language".
Until 7.1.x
Before version 7.2.0 this parameter was called "Code Language".
Code Title
This value is passed to the Code Block Macro.
Code Theme
This value is passed to the Code Block Macro.
Until 7.1.x
Since version 7.2.0 this parameter is no longer supported.
Code Show line numbers
This value is passed to the Code Block Macro.
Until 7.1.x
Before version 7.2.0 this parameter was called "Code Line Numbers".
Code First line number
This value is passed to the Code Block Macro.
Until 7.1.x
Before version 7.2.0 this parameter was called "Code First Line".
Code Collapsible
This value is passed to the Code Block Macro.
Until 7.1.x
Before version 7.2.0 this parameter was called "Code Collapse".
Related Macros
- Attachment Code Block Placeholder Macro
- Renders a code block from an attached file with placeholders replaced by properties.
- Attachment Link Macro
- Renders a link to an attached file for download.