Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:dokuwiki

dokuwiki

TODO:

Release 2013-05-10a "Weatherwax"

以前用 vector 模板有 site_notice 功能, 可实现访问任何页面时能随机打印一些 (矫情的) 话的功能.

这个版本的模板 dokuwiki 没有 site_notice, 但可修改 tagline 功能实现.

wiki/lib/tpl/dokuwiki/tpl_header.php
<p class="claim">
  <?php
    // echo $conf['tagline'];
    // tagline 是一个 dokuwiki 页面
    tpl_include_page($conf['tagline'], 1, 1);
  ?>
</p>

构造 dokuwiki 格式的链接

a bookmarklet let you get current page's dokuwiki-syntax-link

javascript:
  window.prompt("Copy to clipboard: Ctrl+C, Enter", 
		"[["+location.href+"|"+document.title+"]]");
  window.focus();
 
// or in short
javascript:window.prompt("Copy%20to%20clipboard:%20Ctrl+C,%20Enter",%20"[["+location.href+"|"+document.title+"]]");window.focus();

关于“网页中复制到剪贴板”功能的讨论: How to copy to the clipboard in JavaScript? - Stack Overflow

init & backup

  • Error 403 after installed lighttpd and dokuwiki
$ apt-get install php5-cgi
$ lighttpd-enable-mod fastcgi fastcgi-php
  • Settings cannot save

make the conf directory writable1)

  • Configs
/etc/dokuwiki/local.php
$conf['template'] = 'vector';
$conf['useheading'] = '1';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['htmlok'] = 1;
$conf['userewrite'] = '2';
$conf['useslash'] = 1;

CLI Tools

脚本位置: <yourWiki>/bin/

indexer.php

Allows you to update the search index.

Usage: indexer.php <options>
  
  Updates the searchindex by indexing all new or changed pages
  when the -c option is given the index is cleared first.
  
  OPTIONS
      -h, --help     show this help and exit
      -c, --clear    clear the index before updating
      -q, --quiet    don't produce any output

This needs to be run as the appropriate user and possibly the right directory to work. e.g. www-data in ~www-data Under debian lenny

wantedpages.php

Usage: wantedpages.php [wiki:namespace]
  
  Outputs a list of wanted pages (pages which have
  internal links but do not yet exist).
  
  If the optional [wiki:namespace] is not provided,
  defaults to the root wiki namespace
  
  OPTIONS
      -h, --help get help

ref

Plugins

seqdia

在 dokuwiki 使用 websequencediagrams.com

安装:

$ cd dokuwiki/lib/plugins
$ git clone https://github.com/RaD/dokuwiki-seqdia seqdia

使用:

<seqdia modern-blue>
Alice->Bob: Authentication Request
Bob-->Alice: Authentication Response
</seqdia>

效果:

wrap

plugin:wrap

基本用途是对某块文本增加样式, 但更常用的是辅助列表/表格嵌套.

  1. 列表嵌表格
    表格表格
    表格嵌列表
    • 列表
      • 列表
  2. 列表
<WRAP box 350px right>
  - 列表嵌表格 <WRAP>
^表格^表格^
|表格嵌列表|<WRAP>
  * 列表
    * 列表
</WRAP>|
</WRAP>
  - 列表
</WRAP>

flash

plugin:flash

example:

<flash left http://player.youku.com/player.php/sid/XMTgzNzgxMDEy/v.swf>
// 标签内必须有空行
</flash>

simpleindex

语法和使用

<simpleindex n1,ns2,ns3>

ns1,ns2,ns3 是要排除的命名空间。仅支持顶级命名空间。

最好在使用 simpleindex 的页面加上 ~~NOCACHE~~ 控制宏。

mathjax

Mathjax plugin adds MathJax to your wiki pages to let you easily write mathematical formulas that will be typeset and displayed cleanly. It is written to be as simple as possible; it loads and configures the script, and no more.

FIXME 此插件启用后便会在全站启用, 可能造成某些页面混乱. 暂无解决方法, 需自行编写扩展解决.

other dokuwiki sites

1)
The config manager wants to save the old config to a backup before making any changes. Either make the conf directory writable or add an empty local.php.bak and change it's permissions as well. http://forum.dokuwiki.org/thread/320
it/dokuwiki.txt · Last modified: 2016/02/17 20:09 by admin