DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:explain

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:explain [2015-07-18 22:31] – made external link internal achplugin:explain [2024-01-08 16:01] (current) Aleksandr
Line 1: Line 1:
-====== Explain a Term ======+====== Explain a Term Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       : syntax type       : syntax
-lastupdate : 2015-02-26+lastupdate : 2019-01-23
 compatible :  compatible : 
 depends    :  depends    : 
Line 13: Line 13:
 tags       : terms, definitions tags       : terms, definitions
  
-downloadurl: http://github.com/cosmocode/explain/zipball/master +downloadurl: https://github.com/cosmocode/explain/zipball/master 
-bugtracker : http://github.com/cosmocode/explain/issues +bugtracker : https://github.com/cosmocode/explain/issues 
-sourcerepo : http://github.com/cosmocode/explain/+sourcerepo : https://github.com/cosmocode/explain/
 ---- ----
  
 Just like for the acronyms you can define a file containing a table which declares terms, a short explanation and two links to a longer definition. This automatically works for all those terms in the whole wiki. Just like for the acronyms you can define a file containing a table which declares terms, a short explanation and two links to a longer definition. This automatically works for all those terms in the whole wiki.
 +
 +[[https://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ https://www.cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]]
  
 ===== Download and Installation ===== ===== Download and Installation =====
-[[http://www.cosmocode.de/en/open-source/dokuwiki-plugins/|{{ http://cosmocode.de/static/img/dokuwiki/dwplugins.png?recache|A CosmoCode Plugin}}]] 
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the URL given above. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Syntax ===== ===== Syntax =====
Line 37: Line 38:
   * "//second URL//" the second URL is used, if your actual position is already inside of the first URL, in the example above, if you are actually on page //%%Introduction:Definitions%%//. Use the second URL to link to a more detailed or external definition. E.g. "//%%http://en.wikipedia.org/wiki/carpe_diem%%//"   * "//second URL//" the second URL is used, if your actual position is already inside of the first URL, in the example above, if you are actually on page //%%Introduction:Definitions%%//. Use the second URL to link to a more detailed or external definition. E.g. "//%%http://en.wikipedia.org/wiki/carpe_diem%%//"
  
-//Note:// Comments are not allowed. Empty lines are allowed.+//Note:// Lines starting with # are treated as comments. Empty lines are allowed.
  
 ===== Example ===== ===== Example =====
Line 85: Line 86:
 Edward Barker Edward Barker
  
----- +==== Edit the conf/explain.conf File as a Dokuwiki Page via Symlink ====
-Base on the style of plugins, I have changed the CSS to plugins/explain/style.css as below: +
-<code css> +
-  div.dokuwiki a.explain { +
-    color: __black__; +
-    border-bottom: 1px dotted __black__; +
-    padding-top: 0; +
-  } +
-   +
-  div.dokuwiki a.explain:hover { +
-    background-color: __light__; +
-  } +
-</code> +
-I have also changed the code a little bit to use comma separated instead of TAB separated s.t. the file can be soft linked to the pages and edit via dokuwiki, just like the hint for the standard acronyms.conf editing.+
  
 +The file can be [[https://www.namecheap.com/support/knowledgebase/article.aspx/9561/29/how-to-create-a-symbolic-link-in-cpanel |symlinked]] / soft linked to a page and edited via dokuwiki.  The same can be done for the hints of the standard acronyms.conf editing.
 +
 +The TAB character can't be used for editing within the browser, as it just skips to the next field.  The solution is to change the delimiter from a TAB to something else.\\
 +Thanks to https://www.fiverr.com/dvdias\\
 +Instead of the CSV code below, I chose to use 4 whitespace characters as the delimiter, by changing line 53 from:\\
 +    $parts = explode("\t", $line);
 +to:
 +    $parts = explode("    ", $line);
 +
 +Which is a lot easier than the CSV code below.  Maybe needs deleting as it is for a much older version of explain plugin?  I can't say I understand the purpose.
 <code php> <code php>
 <?php <?php
Line 220: Line 218:
 </code> </code>
  
 +Base on the style of plugins, I have changed the CSS to plugins/explain/style.css as below:
 +<code css>
 +  div.dokuwiki a.explain {
 +    color: __black__;
 +    border-bottom: 1px dotted __black__;
 +    padding-top: 0;
 +  }
 +  
 +  div.dokuwiki a.explain:hover {
 +    background-color: __light__;
 +  }
 +</code>
  
-Ken Cheung 2007-04-30+Ken Cheung 2007-04-30\\ 
 +Marcos Reyes 2019-08-01
  
 ==== regular expressions ==== ==== regular expressions ====
Line 329: Line 340:
  
 --Art Carlson, Max Planck Institute of Biochemistry, Munich, Germany, 2015-07-13 --Art Carlson, Max Planck Institute of Biochemistry, Munich, Germany, 2015-07-13
 +
 +==== Very simple ODT-Plugin support ====
 +At the moment, the terms are not exported via the plugin [[plugin:odt]]. Fixed it.
 +
 +<code php>
 +    public function render($format, Doku_Renderer $renderer, $data) {
 +        if(is_null($data['desc'])) {
 +            $renderer->doc .= hsc($data['content']);
 +            return true;
 +        }
 +        if ($format == 'xhtml') {
 +            $renderer->doc .= '<a class="explain"';
 +            if(($data['target']) !== '') {
 +                $renderer->doc .= ' href="' . hsc($data['target']) . '"';
 +            }
 +            $renderer->doc .= '>' . hsc($data['content']);
 +            if ($data['desc'] !== '') {
 +                $renderer->doc .= '<span class="tooltip">'.hsc($data['desc']).'</span>';
 +            }
 +            $renderer->doc .= '</a>';
 +            return true;
 +        }
 +        // generate output for ODT export
 +        if ($format == 'odt') {
 +            $renderer->doc .= hsc($data['content']);
 +            return true;
 +        }
 +        return false;
 +    }
 +</code>
 +
 +-- Alois Hockenschlohe, Germany
 +
 +==== Ignore this Word ====
 +
 +I love the plugin, thank you! One question, or maybe it's a request... Some terms may be used in the 'English' sense of the word, when it is the second instance of the term it doesn't matter but when it is the first it will be highlighted. This is expected behaviour but incorrect in terms of this particular use case. Is there a way to 'mark' a term as 'ignore this' so it isn't highlighted and the next instance of the term is?
 +
 +[[user>lizat|Liz T]] //2020-12-03//
 +
  
  
plugin/explain.1437251463.txt.gz · Last modified: 2015-07-18 22:31 by ach

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