plugin:chem
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
plugin:chem [2010-09-16 20:55] – [Chem plugin] 24.77.9.78 | plugin:chem [2020-12-01 15:49] – Hogfather ok saggi | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Chem plugin | + | ====== Chem Plugin |
---- plugin ---- | ---- plugin ---- | ||
Line 6: | Line 6: | ||
email : i.obataya@gmail.com | email : i.obataya@gmail.com | ||
type : syntax | type : syntax | ||
- | lastupdate : 2008-09-29 | + | lastupdate : 2017-10-19 |
- | compatible : 2006/ | + | compatible : 2009-12-25 |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
tags : formula chemistry science | tags : formula chemistry science | ||
+ | |||
+ | downloadurl: | ||
+ | sourcerepo : https:// | ||
---- | ---- | ||
- | |||
- | [[http:// | ||
- | |||
- | ^ ZIP file ^ | ||
- | |{{http:// | ||
- | |||
- | **These two download links are broken.** | ||
This DokuWiki plugin formats a molecular formula easily. | This DokuWiki plugin formats a molecular formula easily. | ||
Line 29: | Line 25: | ||
The latest version supports to export Open Document format using [[plugin: | The latest version supports to export Open Document format using [[plugin: | ||
- | =====Examples===== | + | ===== Examples ===== |
- | C< | + | |
- | < | + | |
- | Na< | + | | C< |
- | <code>< | + | | |
+ | | C<sub>2</ | ||
+ | | Cl< | ||
+ | | Al< | ||
- | C< | + | ====== |
- | < | + | |
- | + | ||
- | Cl< | + | |
- | < | + | |
- | + | ||
- | Al< | + | |
- | < | + | |
- | + | ||
- | ====== | + | |
The original plugin works very fine. | The original plugin works very fine. | ||
Line 70: | Line 58: | ||
</ | </ | ||
What do you think ? | What do you think ? | ||
- | --- //[[ikuo_obataya@symplus.co.jp|iobataya]] 2010/04/21 05:45// | + | --- //iobataya 2010/04/21 05:45// |
- | __syntax.php__: | + | My server moved to new place. |
- | <code php> | + | --- [[user> |
- | <?php | + | |
- | /* | + | |
- | description : Plugin Chem: formatting chemical format | + | |
- | author | + | |
- | email : ikuo_obataya@symplus.co.jp | + | |
- | lastupdate | + | |
- | license | + | |
- | */ | + | |
- | if(!defined(' | + | |
- | if(!defined(' | + | |
- | require_once(DOKU_PLUGIN.' | + | |
- | class syntax_plugin_chem extends DokuWiki_Syntax_Plugin { | + | |
- | function getInfo(){ | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | function getType(){ return ' | ||
- | function getAllowedTypes() { return array(' | ||
- | function getSort(){ return 158; } | ||
- | function connectTo($mode) { $this-> | ||
- | function postConnect() { $this-> | ||
- | |||
- | function handle($match, | ||
- | switch ($state) { | ||
- | case DOKU_LEXER_ENTER | ||
- | case DOKU_LEXER_UNMATCHED :return array($state, | ||
- | case DOKU_LEXER_EXIT | ||
- | } | ||
- | return array(); | ||
- | } | ||
- | function render($mode, | + | Source code was moved to GitHub |
- | if($mode == ' | + | |
- | list($state, | + | |
- | switch ($state) { | + | |
- | case DOKU_LEXER_ENTER: | + | |
- | case DOKU_LEXER_UNMATCHED: | + | |
- | if($mode==' | + | |
- | // xhtml | + | |
- | $renderer-> | + | |
- | } | + | |
- | if($mode == ' | + | |
- | // Open document format | + | |
- | $renderer-> | + | |
- | } | + | |
- | break; | + | |
- | case DOKU_LEXER_EXIT: | + | |
- | } | + | |
- | return true; | + | |
- | } | + | |
- | return false; | + | |
- | } | + | |
- | + | ||
- | | + | |
- | $pattern = array( "/ | + | |
- | " | + | |
- | " | + | |
- | "/ | + | |
- | "/ | + | |
- | + | ||
- | "/ | + | |
- | "/ | + | |
- | "/ | + | |
- | + | ||
- | "/ | + | |
- | "/ | + | |
- | "/ | + | |
- | $replace = array( " | + | |
- | " | + | |
- | " | + | |
- | "< | + | |
- | "< | + | |
- | + | ||
- | "< | + | |
- | "< | + | |
- | "< | + | |
- | + | ||
- | "< | + | |
- | " | + | |
- | "& | + | |
- | return preg_replace($pattern, | + | |
- | } | + | |
- | + | ||
- | + | ||
- | function getOdtChemFormat($raw){ | + | |
- | $c = $this-> | + | |
- | $pattern = array( "/< | + | |
- | "/< | + | |
- | $replace = array( "< | + | |
- | "< | + | |
- | return preg_replace($pattern, | + | |
- | } | + | |
- | + | ||
- | + | ||
- | } | + | |
- | ?> | + | |
- | </ | + | |
+ | SS 2015-12-13: Doesn' | ||
+ | This tool is simply great! Love it:) Just a small suggestion, can we have a button in the toolbar in forum posts? I mean a small button in the toolbar with italic/ | ||
+ | >Now you can find a benzene button in a tool bar ;-) | ||
+ | >Clear cache of web browser after update the plugin. Cache of javascripts are sticky. | ||
+ | > --- [[user> |
plugin/chem.txt · Last modified: 2023-10-30 23:38 by Klap-in