-
Notifications
You must be signed in to change notification settings - Fork 70
cobigen textmerger
The Text Merger Plug-in enables merging result free text documents to existing free text documents. Therefore, the algorithms are also very rudimentary.
There are currently two main merge strategies that apply for the whole document:
-
merge strategy
textmerge_append
(appends the text directly to the end of the existing document) -
merge strategy
textmerge_appendWithNewLine
(appends the text after adding a new line break to the existing document) Remark: empty patches will not result in appending a new line any more since v1.0.1
If a template contains comments that fit the definition of anchor:${documentpart}:${mergestrategy}:anchorend
, some additional functionality becomes available about specific parts of the incoming text and the way it will be merged with the existing text. These anchors have to be written as a comment of the language the template results in (As the merger doesn’t know about freemarker comments). Anchors always change things about the text to come up until the next anchor, text before it is ignored.
The following functionality is available
-
anchor:header:${mergestrategy}:anchorend
marks the beginning of a header, that will be added once when the document is created, but not again.Remark: This is only done once, if you haveheader
in another anchor, it will be treated as default text -
anchor:footer:${mergestrategy}:anchorend
marks the beginning of a footer, that will be added once when the document is created, but not again. -
anchor:${mergestrategy}:anchorend
simply means that the following text is default text that should be merged in a specific way
-
anchor:${documentpart}::anchorend
or anything in place of${mergestrategy}
means that the text should only be appended. -
anchor:${documentpart}:${}newline:anchorend
oranchor:${documentpart}:newline${}:anchorend
states that a new line should be appended before or after this anchor, depending on where the newline is (before or after the mergestrategy). -
anchor:${documentpart}:anchorend
does not work, you have to always have at least a default mergestrategy defined.
Disclaimer
If you discover any documentation bugs or would like to request new content, please raise them as an issue or create a pull request. Contributions to this wiki are done through the main repo under the folder documentation.
License
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International
)