DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:symbols4odt

symbols4odt Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes

plugin 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.

Last updated on
2021-11-01
Provides
Syntax
Repository
Source
Requires
odt

Similar to shy

Tagged with export, odt, symbols

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

:!: External requirements: This plugin requires the following additional components that must be installed separately:

What's it for?

This plugin allows for the insertion of symbols that work both on wiki pages, as well as in exported ODT files. Supports using UTF8 codes that are translated to symbols.

Originally, this plugin was intended for the insertion of soft hyphens. It was implemented to provide the functionality of the Shy Syntax Plugin plus an export implementation for ODT files created by the ODT Plugin.

The 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.

Syntax

Syntax Result Alternative Syntax
{{utf8symbol>CODE}}
Generic function to insert a hexadecimal code of an UTF8 symbol. Inserting 26A0 (instead of CODE) will create the UTF8 symbol ⚠ (Warning Sign). None.
<checkbox>
Creates an empty checkbox.
<CHECKBOX>
<checkbox_checked>
Creates a checked checkbox.
<CHECKBOX_CHECKED>
<shy>
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.
<SHY>
<->
\-

Configuration and Settings

No configuration settings available.

On 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).

This extension mechanicsm is explained in the following by example:

"checkbox_filled" => array( 
    "pattern"          => array('<checkbox_checked>','<CHECKBOX_CHECKED>'),
    "substitute4XHTML" => "<input type='checkbox' checked/>",
    "substitute4ODT"   => $this->getUTF8forHexadecimal('2612'),
),

This entry is an element of the array stored in $this→patterns.

The 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.

Constituent Semantics
"pattern"
Maps to an array of strings that will be used within the 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>”.
"substitute4XHTML"
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.
"substitute4XODT"
In case of a match (see “pattern”), the string defined in substitute4XODT will be given to the ODT export file.

You can access $this→getUTF8forHexadecimal($utfCode) to pass through UTF8 symbols. Inserting $utfCode = “26A0” will create the UTF8 symbol &#x26A0; (Warning Sign) as an HTML entity, which should nicely show both on XTML output, and on ODT output.

Development

Sources on github.

Change Log

  • 2021-11-01
    • v0.8 (Initial release)

Known Bugs and Issues

See issue tracker on github.

FAQ

None, yet.

Discussion

Start here.

plugin/symbols4odt.txt · Last modified: by thomas-schaefer-nh

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