Set Text - lifelike/countersheetsextension GitHub Wiki
To set the text of a counter to something other than what the text is in the template the header for that column must match the id attribute of the text object to change (right-click the text and choose Object Properties to edit the id).
It is possible to put a %name% placeholder (with any name) in the text and then use name as a column header to replace that text. That can be used to set the whole or only a part of a text object, and removes the need of setting the id.
New in version 2.1:
A very simple built-in wiki-like mark-up language can be used to insert
*bold*
or /italics/
text, using just that syntax.
New in version 2.2: It is possible to set the bold and italics styles, even to not be bold or italics. The first text marked as bold in any text element will get an id something-NNN-cs-b-1, where something is the id of the text element. NNN is just a number, needed to make each id unique, and can change at any time, so use a Wildcards to match it (i.e. *). To add extra style (or even remove the default bold style) on that part of the text the usual Set Style can be applied. Use wildcards in the CSV to modify the style of all bold text. To set the style on italics text do the same but with -i- in the id instead of -b-.
There are two types of text objects in Inkscape. Just clicking when using the text tool creates a single-line text object. Dragging with the text tool creates a multi-like text object with automatic line-wrapping. When setting texts for the latter type of objects it can be useful to be able to insert multi-line texts from the CSV. To make that easier to do any occurrence of \n (backslash followed immediately by a lower-case n) will create a line-break when setting the value of the multi-line text. It will not have any special effect on a single-line text and will just be inserted as-is.
New in version 2.1: In single-line texts (only, not multi-line texts) images can be inlined using the syntax {filename.png} (ie the filename in curly braces). There is currently no possibilitiy to modify the size or exact alignment of the inserted image. If the image used is not square (ie 1:1 aspect ratio) they will be deformed. The extension will crash with a rather wordy error-message if there is an attempt to inline an image in any other place than in a single-line text.
New in version 2.2: Same as with bold and italic text (see above) each inserted image now has a predictable id, e.g. something-NNN-cs-image-1 (same format as for text, but use -image- before the number instead of -b- or -i-). NNN is just a number, needed to make each id unique, and can change at any time, so use a Wildcards to match it (i.e. *). This can unfortunately not be used to directly set the style of the image itself. It can be used to tweak the position and size of the text placeholder that is used internally to position each image. (Untested.) The idea is to add some better way to control inline image style in some future version.
New in version 2.1: The contents of an external file can be read into a text object by putting <<filename.txt in a CSV cell, where filename.txt can be any filename. New-lines in the file will be preserved (so no need for the \n workaround there, but if a literal \n is found in the file it will also generate a line-break). The file must be in the same folder as the CSV data-file, or in one of the standard folders the extension searches for files (e.g. the user’s home Document folder). If the file can not be found the extension aborts and prints an error message containing a list of all locations that were searched for the missing file.
See also: Editing Counters, Templates, Wildcards