)
研究/教育向けのプラグインと、一般向けのプラグインを作っています。すべてGPL2ライセンスですので自由にお使いください。
最近のものはGitHubにレポジトリがあります。
Dokuwiki公式サイト
主にライフサイエンス用のプラグイン。
このDokuWikiプラグインは、ページ内にタブコントロールを配置します。タブにはWiki内のページを指定し、クリックによって表示できます。AJAXでページ遷移なしに表示を切り替えられます。
{{tabinclude>start,*/chem_plugin,/pubmed_plugin|Plugin for PubMed}}
This DokuWiki plugin formats a molecular formula by using 'chem' tag.
Appearance | DokuWiki code | memo |
---|---|---|
C2H6 | <chem>C2H6</chem> | |
Na2HPO4 12H2O | <chem>Na2HPO4 12H2O</chem> | |
Al2(SO4)3 | <chem>Al2(SO4)3</chem> | Using brackets |
C2H5O2-Na+ | <chem>C2H5O2|-Na+</chem> | Inserted a pipe before a formal charge. |
Cl2H6N2Pt2+ | <chem>Cl2H6N2Pt2+</chem> | Formal charge number before +/-. |
[(C6H4)2]412+ | <chem>[(C6H4)2]4|12+</chem> | Using several combinations |
Usage of seperation between atom-numbers and charge-numbers
Appearance | code | memo |
---|---|---|
SO42- | <chem>SO4|2-</chem> | Correctly formated |
SO42- | <chem>SO42-</chem> | Needs a pipe between 4 and 2. |
SO4 2- | <chem>SO4 2-</chem> | Undesired white space |
You can install by using 'Manager Plugins' in Admin tools. Download URL is available at https://www.dokuwiki.org/plugin:chem.
(Kibi posted bug-fix and made some extension for isotope expression in the previous system of DW. Since a 'discussion plugin' is not deployed in this current DW, I pasted his/her comment here. Thanks, Kibi — i.obataya 2009/11/11 19:17)
I've made some improvements to your plugin: now it can handle not only charge number of ion, but oxidation state: N-3, N-1, N0, N+1, N+3, H2+1S+6O3-2S-2
Fixed error with “+” in equation: 2H2 + O2 ⇒ 2H2O
Fixed error with alternative formulas like Anion2Cation3
Added support of isotope numbers: 238U, 2239Pu
All you need is replace function getChemFormat with that:
function getChemFormat($raw){ $pattern = array("/([A-Za-z\]\)]+)(0)/", "/[\|]?([0-9]*)[\^]/", "/([^ ][\]\)]?)[\|]?(([\-\+][0-9]*)|([0-9]*[\-\+]))/", "/([A-Z]|[a-z]|\)|\])([1-9][0-9]*)/"); $replace = array("\${1}<sup>\${2}</sup>", "<sup>\${1}</sup>", "\${1}<sup>\${2}</sup>","\${1}<sub>\${2}</sub>"); return preg_replace($pattern,$replace,$raw); }
The examples ahead would be like this:
タブに表示するページをコンマで区切って並べます。
{{tabinclude>page1,page2,page3, ...}}
最初のページが読み込み時に表示されます。読み込み時に表示されるページを指定したい場合は、「*」(アスタリスク)をページ名の前に付けます。 次の例ではpage2が表示されます。
{{tabinclude>page1,*page2,page3,..}}
タブに表示される名前は、ページの最初の見出しです。見出しがない場合はページIDが表示されます。さらに、個々に指定したい場合は「|」(パイプ)を使って指定できます。表示名を指定したリンクを作る時と同じ文法です。
{{tabinclude>page1|Top page,page2|Second page,page3,..}}
このタブコントロールは、jQueryを使用していますが、jQuery tab UIは使用していません。文字色や背景色はテンプレートで指定されたものに準拠するようになっています。テンプレートの配色は、lib/tpl/(テンプレート)/style.iniで指定されています。たとえば、この中の色を変えれば、テンプレート全体の色が変わり、タブコントロールの色も同様に変わります。タブコントロールだけ個別にスタイルを変えたい場合は、lib/plugins/tabinclude/style.cssを変更します。
以下のテンプレートでの表示は無難なものでした。
You can install this plugin with standard method in Admin→Manage Plugins. If you want to install manually, rename extracted zip folder to 'tabinclude' to place in lib/plugins/ directory.
<float icon(compass)>
</float>