This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/next_gen.inx
Mario Voigt 4175b377bd Refactored extension names by "rename 's/fablabchemnitz_//g' *.py;rename
's/fablabchemnitz_//g' *.inx;sed -i 's/>fablabchemnitz_/>/g' *.inx;sed
-i 's/fablabchemnitz_//g' *.py; rename 's/fablabchemnitz_//g' *.svg"
2020-09-03 00:35:27 +02:00

63 lines
4.4 KiB
XML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<name>NextGenerator</name>
<id>fablabchemnitz.de.nextgenerator</id>
<param name="tab" type="notebook">
<page name="config" gui-text="Options">
<label appearance="header">Input options</label>
<param gui-text="CSV file:" gui-description="A file with comma-separated values, one line per exported file. The first line contains the column names. Put quotation marks around your variables if they contain a comma." name="csv_file" type="path" mode="file" filetypes="csv">/path/to/file.csv</param>
<spacer/>
<label>Non-text values to replace (see Help tab):</label>
<param name="extra-vars" type="string" gui-text=""/>
<spacer/>
<separator/>
<spacer/>
<label appearance="header">Output options</label>
<param name="format" type="optiongroup" appearance="combo" gui-text="Export file format:">
<option value="png">PNG</option>
<option value="pdf">PDF</option>
<option value="svg">SVG</option>
<option value="ps">PS</option>
<option value="eps">EPS</option>
</param>
<param gui-text="DPI (for PNG and filters):" gui-description="The resolution for your exported raster images" name="dpi" type="int" min="1" max="10000">300</param>
<param gui-text="File name pattern:" gui-description="The pattern for the names of the generated files. It should contain at least one unique column variable (in the form of '%VAR_my_variablename%'), or a unique combination of column variables, so new files won't overwrite those that have already been generated. Do not include the file extension, it will be added automatically." name="file_pattern" type="string">%VAR_my_variablename%</param>
<param gui-text="Save in:" gui-description="The name of the folder where the generated images should be saved" name="output_folder" type="path" mode="folders">/tmp</param>
</page>
<page name="help" gui-text="Help">
<label appearance="header">Replacing text</label>
<label xml:space="preserve">
In your SVG file, create any texts that you want to replace by clicking (not clicking and dragging) on the canvas. If you want to limit the width of the text, use the diamond-shaped handle at the end of the first line to indicate a maximum width. The text will auto-flow into the next line if it is longer. Make sure there is enough space for your texts.
As (or into) the text, type '%VAR_my_variablename%' (without the quotes) as a placeholder, where 'my_variablename' is the title of the corresponding column in your CSV data file.
</label>
<label appearance="header">Replacing attributes</label>
<label xml:space="preserve">If you want to replace attribute values in your SVG file (e.g. a color, or the name of a linked image file), you can assign them to columns in the field labeled "Non-text values to replace" in JSON format like this (no linebreaks allowed):
{"background_color":"#ff0000", "photo":"image.png"}
All objects that use the red color (#ff0000) will then be exported using the colors in the column 'background_color'. The linked image 'image.png' will be replaced by the image files listed in the column 'photo' (make sure to replace the complete image path).
</label>
</page>
<page name="about" gui-text="About">
<label appearance="header">NextGenerator</label>
<label indent="1">Version 0.8</label>
<spacer/>
<label xml:space="preserve">An Inkscape extension to automatically replace values (text, attribute values) in an SVG file and to then export the result to various file formats. This is useful e.g. for generating images for name badges and other similar items.
This extension is a Python rewrite of the Generator bash script extension by Aurélio A. Heckert. It is compatible with Inkscape starting from version 1.0 and requires Python 3.</label>
</page>
</param>
<effect needs-live-preview="false">
<object-type>all</object-type>
<menu-tip>Automatically replace values and export the result.</menu-tip>
<effects-menu>
<submenu name="FabLab Chemnitz">
<submenu name="Import/Export/Transfer"/>
</submenu>
</effects-menu>
</effect>
<script>
<command location="inx" interpreter="python">next_gen.py</command>
</script>
</inkscape-extension>