DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:svgembed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:svgembed [2021-06-09 17:16] Restlessplugin:svgembed [2023-12-06 21:25] (current) – [svgEmbed Plugin] Restless
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Allows the use of the standard media syntax, but SVG files are placed with the <object> or <embed> tag, not the <img> tag +description: Allows the use of the standard media syntax (with some extensions), but SVG files are placed with the <object> or <embed> tag, not the <img> tag 
-author     : Michael Bowers +author     : Emma Bowers 
-email      : restlessmind@gmail.com +email      : emb@pobox.com 
 type       : helper, syntax type       : helper, syntax
 lastupdate : 2021-06-09 lastupdate : 2021-06-09
-compatible : Hogfather, Greebo +compatible : Igor, Hogfather, Greebo, Jack Jackrum 
 depends    :  depends    : 
 conflicts  conflicts 
Line 19: Line 19:
  
 screenshot_img : https://www.w3.org/Icons/SVG/svg-logo-h.svg screenshot_img : https://www.w3.org/Icons/SVG/svg-logo-h.svg
 +
 ---- ----
  
Line 24: Line 25:
  
 PHP 7+ and [[https://www.php.net/manual/en/book.libxml.php|libxml libraries]] required. PHP 7+ and [[https://www.php.net/manual/en/book.libxml.php|libxml libraries]] required.
 +
 +==== Compatibility with Igor release candidates ====
 +
 +As of this writing (June 27, 2022), this plugin is compatible with the Igor RC2 release without changes.  It is my aim to keep it compatible since, although Dokuwiki supports SVG in that release, it still uses the ''<img>'' tag and so it will not make use of embedded links.  Further, I intend to refactor it somewhat for a couple of requests and a bug report on the Github, but its number has not come up yet.
  
 ===== Installation ===== ===== Installation =====
Line 34: Line 39:
 Under the "Configuration Settings" page in the admin panel, the plugin has a section with a few values: Under the "Configuration Settings" page in the admin panel, the plugin has a section with a few values:
  
-^        Setting name ^ Description ^ Default value ^ +^        Setting name ^ Description ^  Default value  
-  **max_svg_width** | Maximum width for SVG file size if no sizes are specified in the wiki page. | 1024 | +| **max_svg_width**   | Maximum width for SVG file size if no sizes are specified in the wiki page. |  1024  
-  **default_width** | Default fall-through width of an SVG file. | 300 | +| **default_width**   | Default fall-through width of an SVG file. |  300  
- **default_height** | Default fall-through height of an SVG file. | 150 | +| **default_height**  | Default fall-through height of an SVG file. |  150  
-  **default_print** | Make all SVG files in your wiki have a print button. ([[#printing_svgs|About printing.]]) | False |+| **default_print**  | Make all SVG files in your wiki have a print button. ([[#printing_svgs|About printing]]) |  False  |
  
 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 71: Line 76:
  
   * [[:wiki:syntax#media_files|The normal image formatting arguments for media files]], although there are some [[#formatting|caveats and modifications documented below]]   * [[:wiki:syntax#media_files|The normal image formatting arguments for media files]], although there are some [[#formatting|caveats and modifications documented below]]
-  * [[#setting_responsive_units|Setting responsive units]] instead of normal ''px'' "pixel" units that Dokiwiki normally uses+  * [[#setting_responsive_units|Setting responsive units]] instead of normal ''px'' "pixel" units that DokuWiki normally uses
   * [[#additional_css_classes|Adding additional CSS classes]] to the SVG file   * [[#additional_css_classes|Adding additional CSS classes]] to the SVG file
   * [[#printing|Printing]] SVGs from the page   * [[#printing|Printing]] SVGs from the page
Line 245: Line 250:
  
 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. 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:dw2pdf|DW2PDF]] is now supported.  For this functionality ''<img>'' tag is used for output since the [[https://mpdf.github.io/html-support/html-tags.html|documentation for mPDF's HTML support]] specifies that ''<embed>'' and ''<object>'' are not supported tags for rendering to PDF.
 +
 +Unfortunately, due to this it means that links in SVG files cannot realistically be supported in the PDF output.
 +
 +This may not be in final form.  Further testing is needed, but does not affect anything if you are not using DW2PDF.
 ===== Development ===== ===== Development =====
  
Line 250: Line 263:
  
   * **2021-06-09**   * **2021-06-09**
-    * Added initial support for [[plugin:dw2pdf|DW2PDF plugin]] ([[https://github.com/restlessminded/dokuwiki-plugin-svgEmbed/issues/9|GitHub issue #9]]).  If the renderer is the DW2PDF renderer then an ''<img>'' tag is used for output since the [[https://mpdf.github.io/html-support/html-tags.html|documentation for mPDF's HTML support]] specifies that ''<embed>'' and ''<object>'' are not supported tags for rendering to PDF. \\ \\ Unfortunately, due to this it means that links in SVG files cannot realistically be supported in the PDF output.+    * Added initial support for [[plugin:dw2pdf|DW2PDF plugin]] ([[https://github.com/restlessminded/dokuwiki-plugin-svgEmbed/issues/9|GitHub issue #9]]).  See [[#export_to_pdf_with_dw2pdf|the section on this]] for more information.
   * **2020-06-07**   * **2020-06-07**
     * Made change to make compatible with Hogfather RC2.     * Made change to make compatible with Hogfather RC2.
Line 267: 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.  This does not limit DokuWiki functionality since, technically, it doesn't support SVGZ either.
  
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
  
-None.  If you find a bug, please [[http://github.com/restlessminded/dokuwiki-plugin-svgembed/issues|submit a bug]] at the [[http://github.com/restlessminded/dokuwiki-plugin-svgembed|project's github]].+  * Currently, SVG file positioning may be an issue with the DW2PDF integration.  I will be working on this at a future date. 
 + 
 +If you find a bug, please [[https://github.com/restlessminded/dokuwiki-plugin-svgembed/issues|submit a bug]] at the [[https://github.com/restlessminded/dokuwiki-plugin-svgembed|project's github]].
  
  
Line 286: Line 306:
 >> <del>I have confirmed your other issue reported on github regarding flickering when you try to edit a section; that one is confusing, I'm going to have to look into that one some more.  I have seen it with some other plugins and certain stylesheet alterations, too.</del> >> <del>I have confirmed your other issue reported on github regarding flickering when you try to edit a section; that one is confusing, I'm going to have to look into that one some more.  I have seen it with some other plugins and certain stylesheet alterations, too.</del>
 >>  >> 
->> <del>--- [[user>Restless|Michael Bowers]] //2019-11-25 19:11//</del>+>> <del>--- [[user>Restless|Emma Bowers]] //2019-11-25 19:11//</del>
 >>> <del>I think these issues are fixed in my latest commit.  Please update and test.</del> >>> <del>I think these issues are fixed in my latest commit.  Please update and test.</del>
->>>  <del>--- [[user>Restless|Michael Bowers]] //2019-11-26 01:55//</del>+>>>  <del>--- [[user>Restless|Emma Bowers]] //2019-11-26 01:55//</del>
 > <del>One more thing: The media manager indicates that the SVG file is not in use. Therefore, there is a certain danger that it will be accidentally deleted. \\  --- [[user>juergen_aus_zuendorf|Juergen_aus_Zuendorf]] //2019-11-26 12:54//</del> > <del>One more thing: The media manager indicates that the SVG file is not in use. Therefore, there is a certain danger that it will be accidentally deleted. \\  --- [[user>juergen_aus_zuendorf|Juergen_aus_Zuendorf]] //2019-11-26 12:54//</del>
 >> <del>You are a harsh taskmaster... and I appreciate it!  :-)</del> >> <del>You are a harsh taskmaster... and I appreciate it!  :-)</del>
Line 294: Line 314:
 >> <del>I'll get on it when I get to the office.</del> >> <del>I'll get on it when I get to the office.</del>
 >> >>
->>  <del>--- [[user>Restless|Michael Bowers]] //2019-11-26 14:56//</del>+>>  <del>--- [[user>Restless|Emma Bowers]] //2019-11-26 14:56//</del>
 >> >>
 >> <del>Fixed it in a new commit.  Let me know what else you may find!</del> >> <del>Fixed it in a new commit.  Let me know what else you may find!</del>
 >> >>
->>  <del>--- [[user>Restless|Michael Bowers]] //2019-11-26 22:32//</del>+>>  <del>--- [[user>Restless|Emma Bowers]] //2019-11-26 22:32//</del>
  
  
plugin/svgembed.1623251806.txt.gz · Last modified: 2021-06-09 17:16 by Restless

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki