plugin:svgembed
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:svgembed [2020-06-06 03:56] – [Development] Restless | plugin:svgembed [2023-12-06 21:25] (current) – [svgEmbed Plugin] Restless | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : restlessmind@gmail.com | + | email : emb@pobox.com |
type : helper, syntax | type : helper, syntax | ||
- | lastupdate : 2020-06-05 | + | lastupdate : 2021-06-09 |
- | compatible : Greebo | + | compatible : Igor, Hogfather, |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : svg, media, image, images, diagram, diagrams | + | tags : svg, media, image, images, diagram |
downloadurl: | downloadurl: | ||
- | bugtracker : http:// | + | bugtracker : https:// |
sourcerepo : https:// | sourcerepo : https:// | ||
donationurl: | donationurl: | ||
screenshot_img : https:// | screenshot_img : https:// | ||
+ | |||
---- | ---- | ||
+ | |||
+ | ===== Requirements ===== | ||
+ | |||
+ | PHP 7+ and [[https:// | ||
+ | |||
+ | ==== Compatibility with Igor release candidates ==== | ||
+ | |||
+ | As of this writing (June 27, 2022), this plugin is compatible with the Igor RC2 release without changes. | ||
===== Installation ===== | ===== Installation ===== | ||
Line 30: | Line 39: | ||
Under the " | Under the " | ||
- | ^ Setting name ^ Description ^ Default value ^ | + | ^ Setting name ^ Description ^ Default value ^ |
- | | | + | | **max_svg_width** |
- | | | + | | **default_width** |
- | | **default_height** | Default fall-through height of an SVG file. | 150 | | + | | **default_height** |
+ | | **default_print** | ||
See below for discussion about how these values interact with your SVG file for display. | See below for discussion about how these values interact with your SVG file for display. | ||
Line 66: | Line 76: | ||
* [[: | * [[: | ||
- | * [[# | + | * [[# |
* [[# | * [[# | ||
+ | * [[# | ||
=== Formatting === | === Formatting === | ||
Line 122: | Line 133: | ||
> <code - Example> | > <code - Example> | ||
{{: | {{: | ||
+ | |||
+ | |||
+ | === Printing === | ||
+ | |||
+ | Printing of individual SVG files from the page has been implemented. | ||
Line 133: | Line 149: | ||
If you want a link to open full-page, you should specify the '' | If you want a link to open full-page, you should specify the '' | ||
+ | |||
+ | **Visio produced SVG files** | ||
+ | |||
+ | You can produce an SVG from Visio however it doesn' | ||
+ | |||
+ | In Visio: | ||
+ | - Draw and save the Visio diagram. | ||
+ | - Add hyperlinks to the shapes - this means the item (the linked to page or image) must exist on the wiki , or use a placeholder; | ||
+ | - For the given diagram select all the shapes then Save As an SVG and untick the Visio properties (can set as a general option in settings) as they simply add bulk. | ||
+ | |||
+ | |||
+ | In a text editor (e.g. Notepad++): | ||
+ | - If you have added hyperlinks search for ' | ||
+ | - To solve the ' | ||
+ | - Save the file. | ||
+ | |||
+ | In the Wiki: | ||
+ | - Upload | ||
+ | - Add to a page using SVGEmbed | ||
+ | |||
+ | //Example and notes// | ||
+ | |||
+ | * The links must exist or be known prior to existence so that you can edit them in the Visio produced SVG file. | ||
+ | * Always used the full URL in the link | ||
+ | * The SVG xml code for the hyperlink will look something like this once edited: | ||
+ | |||
+ | < | ||
+ | xlink: | ||
+ | xlink: | ||
+ | target=" | ||
+ | </ | ||
+ | |||
+ | The target value of " | ||
+ | |||
Line 142: | Line 192: | ||
+ | ==== Printing SVGs ==== | ||
+ | |||
+ | Often you may want to include SVG files in your wiki but want to be able to make them printable by users (org charts, data center configurations, | ||
+ | |||
+ | You may set this in a couple ways: | ||
+ | |||
+ | - Affirmative printing: | ||
+ | - Selective printing: | ||
+ | |||
+ | To configure the wikitext, you can include the argument '' | ||
+ | |||
+ | ^ Setting | ||
+ | | Enable | ||
+ | | Disable | ||
+ | |||
+ | Additionally, | ||
+ | |||
+ | // | ||
+ | |||
+ | - To set an SVG for printing: '' | ||
+ | - To set an SVG to suppress printing (if configured to make all SVGs printable): | ||
+ | |||
+ | Of course, these arguments can be combined with any other arguments this plugin accepts. | ||
+ | |||
+ | |||
+ | |||
+ | === Styling SVG print button === | ||
+ | |||
+ | The class for the SVG printing button is '' | ||
+ | |||
+ | <code css> | ||
+ | /* SVG printing button */ | ||
+ | .dokuwiki div.svgprintbutton_table button { | ||
+ | font-family: | ||
+ | background: transparent; | ||
+ | border-top: none; | ||
+ | border-left: | ||
+ | border-right: | ||
+ | border-bottom: | ||
+ | border-radius-bottom: | ||
+ | color: #ccc; | ||
+ | font-size: 80%; | ||
+ | padding: 3px; | ||
+ | } | ||
+ | |||
+ | .dokuwiki div.svgprintbutton_table: | ||
+ | border-left: | ||
+ | border-right: | ||
+ | border-bottom: | ||
+ | color: #f99; | ||
+ | } | ||
+ | |||
+ | .svgembed_print_border { | ||
+ | background: rgba(0, 0, 0, 0.1); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | With this code I get a small button that is dim when normal, slightly grey-pink when hovered, and while it's hovered the JavaScript for this plugin triggers the last set of rules to slightly darken the background of the SVG file to show what would be printed if the button is pressed. | ||
+ | |||
+ | ==== Export to PDF with DW2PDF ==== | ||
+ | |||
+ | Export with [[plugin: | ||
+ | |||
+ | Unfortunately, | ||
+ | |||
+ | This may not be in final form. Further testing is needed, but does not affect anything if you are not using DW2PDF. | ||
===== Development ===== | ===== Development ===== | ||
=== Change Log === | === Change Log === | ||
+ | * **2021-06-09** | ||
+ | * Added initial support for [[plugin: | ||
+ | * **2020-06-07** | ||
+ | * Made change to make compatible with Hogfather RC2. | ||
* **2020-06-05** | * **2020-06-05** | ||
* Changes to fix [[https:// | * Changes to fix [[https:// | ||
Line 160: | Line 280: | ||
* **2019-06-21** | * **2019-06-21** | ||
* Initial release | * Initial release | ||
+ | |||
+ | |||
+ | === Limitations === | ||
+ | |||
+ | SVGZ (compressed SVG) files are not supported because of the way the plugin operates. | ||
=== Known Bugs and Issues === | === Known Bugs and Issues === | ||
- | None. If you find a bug, please [[http:// | + | * Currently, SVG file positioning may be an issue with the DW2PDF integration. |
+ | |||
+ | If you find a bug, please [[https:// | ||
- | Note that I have not tested under Hogfather yet. I will test under Hogfather once there' | ||
===== Discussion ===== | ===== Discussion ===== | ||
Line 180: | Line 306: | ||
>> < | >> < | ||
>> | >> | ||
- | >> < | + | >> < |
>>> | >>> | ||
- | >>> | + | >>> |
> < | > < | ||
>> < | >> < | ||
Line 188: | Line 314: | ||
>> < | >> < | ||
>> | >> | ||
- | >> | + | >> |
>> | >> | ||
>> < | >> < | ||
>> | >> | ||
- | >> | + | >> |
plugin/svgembed.1591408586.txt.gz · Last modified: 2020-06-06 03:56 by Restless