差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 | |||
wiki:syntax:页面名 [2020/11/15 01:39] 限速四十 ↷ 页面名由wiki:syntax:链接地址改为wiki:syntax:页面名 |
wiki:syntax:页面名 [2021/03/06 11:44] (当前版本) A135(2) 移除无关内容 |
||
---|---|---|---|
行 1: | 行 1: | ||
- | 以下内容为根据英文的[[..pagename]]翻译并修改得到。 | + | ====== 页面与页面名 |
- | + | DokuWiki由若干页面组成,各个页面会位于不同的[[wiki: | |
- | + | ||
- | + | ||
- | ===== 页面名和命名空间 | + | |
- | + | ||
- | + | ||
- | 你可以将命名空间描述成文件夹,页面名描述成其中的文件。 | + | |
因此,页面名'' | 因此,页面名'' | ||
行 12: | 行 6: | ||
< | < | ||
- | 根级命名空间 (总是存在的) | + | |
| | | | ||
+-- ' | +-- ' | ||
行 26: | 行 20: | ||
< | < | ||
- | 根级命名空间 (总是存在的) | + | |
| | | | ||
+-- ' | +-- ' | ||
行 34: | 行 28: | ||
</ | </ | ||
- | + | ===== 创建页面 ===== | |
- | + | ||
- | ===== 创建页面名 ===== | + | |
当浏览器请求一个尚不存在的页面名之时,DokuWiki会给你提供选项让你创建它(这取决于你的访问权限)。你可以在另一个DokuWiki页面中创建一个链接,然后让浏览器访问该链接,从而创建新的页面。 | 当浏览器请求一个尚不存在的页面名之时,DokuWiki会给你提供选项让你创建它(这取决于你的访问权限)。你可以在另一个DokuWiki页面中创建一个链接,然后让浏览器访问该链接,从而创建新的页面。 | ||
行 43: | 行 34: | ||
- | ===== 删除页面名 ===== | + | ===== 删除页面 ===== |
如果你编辑一个页面名并移除其中的所有内容,那么,DokuWiki会删除该页面。 | 如果你编辑一个页面名并移除其中的所有内容,那么,DokuWiki会删除该页面。 | ||
- | |||
- | ===== 解决中文文件名乱码问题GBK格式 ===== | ||
- | 1.修改文件 \conf\local.php \\ | ||
- | 在末尾增加 | ||
- | |||
- | $conf[' | ||
- | 2.文件 \inc\pageutils.php \\ | ||
- | 修改utf8_encodeFN函数 | ||
- | <code php> | ||
- | function utf8_encodeFN($file, | ||
- | global $conf; | ||
- | if($conf[' | ||
- | |||
- | if($safe && preg_match('# | ||
- | return $file; | ||
- | } | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | |||
- | // | ||
- | if($conf[' | ||
- | return mb_convert_encoding($file,' | ||
- | } | ||
- | |||
- | $file = urlencode($file); | ||
- | $file = str_replace(' | ||
- | return $file; | ||
- | } | ||
- | |||
- | </ | ||
- | 修改utf8_decodeFN函数 | ||
- | <code php> | ||
- | function utf8_decodeFN($file){ | ||
- | global $conf; | ||
- | if($conf[' | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | // | ||
- | if($conf[' | ||
- | return mb_convert_encoding($file,' | ||
- | } | ||
- | |||
- | return urldecode($file); | ||
- | } | ||
- | </ | ||
- | |||
- | 文件名将会用GBK格式保存.将不会存在utf-8乱码的情况 | ||
- | 但是索引和媒体管理器的树状目录会乱码 | ||
- | ===== 解决中文文件名乱码问题UTF-8格式 ===== | ||
- | 在conf\local.php配置文件中添加一行配置 $conf[' | ||
- | |||
- | 详情参见[[config: | ||
- | |||
- | ==== 伺服器環境 ==== | ||
- | * MacOSX Snow Leopard 10.6.2 | ||
- | * Apache2.0.54 | ||
- | * PHP5.3.1 | ||
- | ===================== | ||
- | |||
- | 经过分析, | ||
- | |||
- | 另外两种方法参看这里: | ||
- | http:// | ||
- | |||
- | file: " | ||
- | <code php> | ||
- | function utf8_encodeFN($file, | ||
- | if($safe && preg_match('# | ||
- | return $file; | ||
- | } | ||
- | /* 把这个部分注释掉 | ||
- | $file = urlencode($file); | ||
- | $file = str_replace(' | ||
- | */ | ||
- | return $file; | ||
- | } | ||
- | } | ||
- | |||
- | if(!function_exists(' | ||
- | /** | ||
- | * URL-Decode a filename | ||
- | * | ||
- | * This is just a wrapper around urldecode | ||
- | * | ||
- | * @author Andreas Gohr < | ||
- | * @see urldecode | ||
- | */ | ||
- | function utf8_decodeFN($file){ | ||
- | //$file = urldecode($file); | ||
- | return $file; | ||
- | } | ||
- | } | ||
- | |||
- | //同样, | ||
- | |||
- | |||
- | </ | ||
- | |||
- | 这样, | ||
- | ====== Windows XP | ||
- | |||
- | * WinXP SP3 | ||
- | * Apache2.2.8 | ||
- | * PHP5.2.6 | ||
- | ===================== | ||
- | |||
- | |||
- | 修改\inc\pageutils.php中utf8_encodeFN、utf8_decodeFN两个函数 | ||
- | |||
- | 以下是我的修改 | ||
- | <code php> | ||
- | function utf8_encodeFN($file, | ||
- | global $conf; | ||
- | if($conf[' | ||
- | | ||
- | return $file;} | ||
- | |||
- | if($safe && preg_match('# | ||
- | return $file; | ||
- | } | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | |||
- | $file = urlencode($file); | ||
- | $file = str_replace(' | ||
- | return $file; | ||
- | } | ||
- | |||
- | function utf8_decodeFN($file){ | ||
- | global $conf; | ||
- | if($conf[' | ||
- | | ||
- | return $file;} | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | |||
- | return urldecode($file); | ||
- | } | ||
- | </ | ||
- | =====如果要跨系统使用===== | ||
- | 可以这样改: | ||
- | <code php> | ||
- | function utf8_encodeFN($file, | ||
- | global $conf; | ||
- | // | ||
- | if($conf[' | ||
- | if(eregi(' | ||
- | $file=mb_convert_encoding($file," | ||
- | } | ||
- | return $file; | ||
- | } | ||
- | |||
- | if($safe && preg_match('# | ||
- | return $file; | ||
- | } | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | |||
- | $file = urlencode($file); | ||
- | $file = str_replace(' | ||
- | return $file; | ||
- | } | ||
- | |||
- | function utf8_decodeFN($file){ | ||
- | global $conf; | ||
- | // | ||
- | if($conf[' | ||
- | if(eregi(' | ||
- | $file=mb_convert_encoding($file," | ||
- | } | ||
- | return $file; | ||
- | } | ||
- | |||
- | if($conf[' | ||
- | return SafeFN:: | ||
- | } | ||
- | |||
- | return urldecode($file); | ||
- | } | ||
- | </ | ||
- | =====windows系统中文乱码自动转换程序===== | ||
- | <code python> | ||
- | """ | ||
- | dokuwiki转码程序。(请将本程序保存为utf8文本) | ||
- | 作用:将dokuwiki默认的编码方式编码生成的目录名、文件名,统一转换为可识别的中文。 | ||
- | 要求python版本大于等于3.4 | ||
- | """ | ||
- | |||
- | from pathlib import Path | ||
- | from urllib.parse import unquote | ||
- | |||
- | wikipath = ' | ||
- | |||
- | rootpath = Path(wikipath) | ||
- | rootpath = rootpath / ' | ||
- | |||
- | def pathRename(path): | ||
- | newname = path.parent / unquote(path.name) | ||
- | path.rename(newname) | ||
- | |||
- | def dealpath(path): | ||
- | allpath = path.glob(' | ||
- | for p in allpath: | ||
- | if p.is_file(): | ||
- | elif p.is_dir(): # 如果是目录 | ||
- | dealpath(p) # 先对目录下的所有内容改名 | ||
- | pathRename(p) # 再对该目录改名 | ||
- | |||
- | print(' | ||
- | dealpath(rootpath) | ||
- | print(' | ||
- | </ | ||
- | 使用时,设置下wikipath即可。注意python版本至少是3.4。 |