1====== symbols4odt Plugin ======
2
3---- plugin ----
4description: Provides symbols that can be exported into ODT files with the odt plugin. For example, the plugin can create checkboxes in wiki pages, as well as in an exported ODT file.
5author     : Thomas Schäfer
6email      : thomas@hilbershome.de
7type       : syntax
8lastupdate : 2021-11-01
9compatible : 2020-07-29 "Hogfather"
10depends    : odt
11conflicts  :
12similar    : shy
13tags       : export, odt, symbols
14
15downloadurl: https://github.com/ternite/dokuwiki-plugin-symbols4odt/archive/v0.8.zip
16bugtracker : https://github.com/ternite/dokuwiki-plugin-symbols4odt/issues
17sourcerepo : https://github.com/ternite/dokuwiki-plugin-symbols4odt
18donationurl:
19
20screenshot_img :
21----
22
23===== Installation =====
24
25Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.
26
27:!: **External requirements:** This plugin requires the following additional components that must be installed separately:
28  * [[odt]]
29
30===== What's it for? =====
31
32This plugin allows for the insertion of symbols that work both on wiki pages, as well as in exported ODT files.
33
34Originally, this plugin was intended for the insertion of soft hyphens. It was implemented to provide the functionality of the [[https://www.dokuwiki.org/plugin:shy|Shy Syntax Plugin]] plus an export implementation for ODT files created by the [[https://www.dokuwiki.org/plugin:odt|ODT Plugin]].
35
36The implementation was a more generic approach, so it can create more symbols in addition to soft hyphens. It has a generic syntax for the insertion of UTF8 symbols, and a specific syntax for adding soft hyphens, and check boxes.
37
38===== Syntax =====
39
40^ Syntax ^ Result ^ Alternative Syntax ^
41| <code>{{utf8symbol>CODE}}</code> | Generic function to insert a hexadecimal code of an UTF8 symbol. Inserting 26A0 (instead of CODE) will create the UTF8 symbol ''[[https://www.compart.com/de/unicode/U+26A0|&#x26A0]];'' (Warning Sign). | None. |
42| <code><checkbox></code> | Creates an empty checkbox. | <code><CHECKBOX></code> |
43| <code><checkbox_checked></code> | Creates a checked checkbox. | <code><CHECKBOX_CHECKED></code> |
44| <code><shy></code> | Create a soft hyphen, functional in wiki pages and ODT files. If inserted in the middle of a word, this indicates that a line break can be placed there, if necessary.  | <code><SHY></code><code><-></code><code>\-</code> |
45
46===== Configuration and Settings =====
47
48**No configuration settings available.**
49
50On the code level, the plugin is readily extendible by inserting patterns into the ''getPatterns()'' function inside the class ''syntax_plugin_symbols4odt'' (within the module's ''syntax.php'').
51
52This extension mechanicsm is explained in the following by example:
53
54<code>"checkbox_filled" => array(
55    "pattern"          => array('<checkbox_checked>','<CHECKBOX_CHECKED>'),
56    "substitute4XHTML" => "<input type='checkbox' checked/>",
57    "substitute4ODT"   => $this->getUTF8forHexadecimal('2612'),
58),</code>
59
60This entry is an element of the array stored in ''$this->patterns''.
61
62The first string, ''checkbox_filled'' is the name of the pattern, which will be used internally and must be unique in respect to the plugin's list of patterns. This string maps to an array that consists of 3 constituents.
63
64^ Constituent ^ Semantics ^
65| <code>"pattern"</code> | Maps to an array of strings that will be used within the [[https://www.dokuwiki.org/devel:syntax_plugins?s[]=handle#handle_method|handle() method]] of this plugin. In this example, the pattern "checkbox_filled" will count as a match if the parsed wiki text contains either the string "<checkbox_checked>", or "<CHECKBOX_CHECKED>". |
66| <code>"substitute4XHTML"</code> | In case of a match (see "pattern"), the string defined in ''substitute4XHTML'' will be given to the XHTML representation of the wiki page. HTML Tags are allowed, here, so take care of what you define here, and who accesses the syntax.php file. |
67| <code>"substitute4XODT"</code> | In case of a match (see "pattern"), the string defined in ''substitute4XODT'' will be given to the ODT export file. |
68
69You can access ''$this->getUTF8forHexadecimal($utfCode)'' to pass through UTF8 symbols. Inserting ''$utfCode = "26A0"'' will create the UTF8 symbol ''[[https://www.compart.com/de/unicode/U+26A0|&#x26A0]];'' (Warning Sign) as an HTML entity, which should nicely show both on XTML output, and on ODT output.
70
71===== Development =====
72
73[[https://github.com/ternite/dokuwiki-plugin-symbols4odt|Sources]] on github.
74
75=== Change Log ===
76
77  * **2021-11-01**
78    * v0.8 (Initial release)
79
80=== Known Bugs and Issues ===
81
82See [[https://github.com/ternite/dokuwiki-plugin-symbols4odt/issues|issue tracker]] on github.
83
84===== FAQ =====
85
86None, yet.
87
88===== Discussion =====
89
90Start here.