wiki:syntax:页面名

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
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:syntax:命名空间|命名空间]]内。你可以将命名空间看作是文件夹,页面名看作是其中的文件。 
- +
- +
-===== 页面名和命名空间 ===== +
- +
- +
-你可以将命名空间描述成文件夹,页面名描述成其中的文件。 +
  
 因此,页面名''a:b:c'' 可描述为: 因此,页面名''a:b:c'' 可描述为:
行 12: 行 6:
 <file> <file>
  
-   根命名空间 (总是存在的)+   根命名空间 (总是存在的)
      |      |
      +-- 'a' 命名空间      +-- 'a' 命名空间
行 26: 行 20:
 <file> <file>
  
-   根命名空间 (总是存在的)+   根命名空间 (总是存在的)
      |      |
      +-- 'a' 命名空间      +-- 'a' 命名空间
行 34: 行 28:
 </file> </file>
  
- +===== 创建页面 =====
- +
-===== 创建页面名 ===== +
 当浏览器请求一个尚不存在的页面名之时,DokuWiki会给你提供选项让你创建它(这取决于你的访问权限)。你可以在另一个DokuWiki页面中创建一个链接,然后让浏览器访问该链接,从而创建新的页面。 当浏览器请求一个尚不存在的页面名之时,DokuWiki会给你提供选项让你创建它(这取决于你的访问权限)。你可以在另一个DokuWiki页面中创建一个链接,然后让浏览器访问该链接,从而创建新的页面。
  
行 43: 行 34:
  
  
-===== 删除页面名 ===== +===== 删除页面 =====
 如果你编辑一个页面名并移除其中的所有内容,那么,DokuWiki会删除该页面。 如果你编辑一个页面名并移除其中的所有内容,那么,DokuWiki会删除该页面。
- 
-===== 解决中文文件名乱码问题GBK格式 ===== 
-1.修改文件 \conf\local.php \\  
-在末尾增加 
- 
-  $conf['fnencode'] = 'gbk'; 
-2.文件 \inc\pageutils.php \\  
-修改utf8_encodeFN函数 
-<code php> 
-function utf8_encodeFN($file,$safe=true){ 
-    global $conf; 
-    if($conf['fnencode'] == 'utf-8') return $file; 
- 
-    if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){ 
-        return $file; 
-    } 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::encode($file); 
-    } 
- 
-   //新增下面这段代码 
-    if($conf['fnencode'] == 'gbk'){ 
-        return mb_convert_encoding($file,'gbk','UTF-8'); 
-    } 
-  
-    $file = urlencode($file); 
-    $file = str_replace('%2F','/',$file); 
-    return $file; 
-} 
- 
-</code> 
-修改utf8_decodeFN函数 
-<code php> 
-function utf8_decodeFN($file){ 
-    global $conf; 
-    if($conf['fnencode'] == 'utf-8') return $file; 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::decode($file); 
-    } 
-   //新增下面这段代码 
-    if($conf['fnencode'] == 'gbk'){ 
-        return mb_convert_encoding($file,'UTF-8','gbk'); 
-    } 
-  
-    return urldecode($file); 
-} 
-</code> 
- 
-文件名将会用GBK格式保存.将不会存在utf-8乱码的情况 
-但是索引和媒体管理器的树状目录会乱码 
-===== 解决中文文件名乱码问题UTF-8格式 ===== 
-在conf\local.php配置文件中添加一行配置 $conf['fnencode'] = 'utf-8'; 即可解决乱码问题。 
- 
-详情参见[[config:fnencode|config:fnencode]] 页面。 
- 
-==== 伺服器環境 ==== 
-  * MacOSX Snow Leopard 10.6.2 
-  * Apache2.0.54 
-  * PHP5.3.1 
-===================== 
- 
-经过分析,Dokuwiki是把文件名通过url_encode();之后再存储的... 
- 
-另外两种方法参看这里: 
-http://www.dokuwiki.org/zh-tw:pagename?do=show 
- 
-file: "\inc\utf8.php" 
-<code php> 
-    function utf8_encodeFN($file,$safe=true){ 
-        if($safe && preg_match('#^[a-zA-Z0-9/_\-.%]+$#',$file)){ 
-            return $file; 
-        } 
-        /* 把这个部分注释掉 
-        $file = urlencode($file); 
-        $file = str_replace('%2F','/',$file); 
-        */ 
-        return $file; 
-    } 
-} 
- 
-if(!function_exists('utf8_decodeFN')){ 
-    /** 
-     * URL-Decode a filename 
-     * 
-     * This is just a wrapper around urldecode 
-     * 
-     * @author Andreas Gohr <andi@splitbrain.org> 
-     * @see    urldecode 
-     */ 
-    function utf8_decodeFN($file){ 
-        //$file = urldecode($file); //再注释掉这个语句... 
-        return $file; 
-    } 
-} 
- 
-//同样, 
- 
- 
-</code> 
- 
-这样,文件名在我的系统上是正常显示了,不知道其他系统如何... 
-====== Windows XP   windows 2003下采用UTF-8格式文件名乱码的解决方法 ====== 
- 
-  * WinXP SP3 
-  * Apache2.2.8 
-  * PHP5.2.6 
-===================== 
- 
- 
-修改\inc\pageutils.php中utf8_encodeFN、utf8_decodeFN两个函数 
- 
-以下是我的修改 
-<code php> 
-function utf8_encodeFN($file,$safe=true){ 
-    global $conf; 
-    if($conf['fnencode'] == 'utf-8') { 
-      $file=mb_convert_encoding($file,"CP936","UTF-8"); 
- return $file;} 
- 
-    if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){ 
-        return $file; 
-    } 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::encode($file); 
-    } 
- 
-    $file = urlencode($file); 
-    $file = str_replace('%2F','/',$file); 
-    return $file; 
-} 
- 
-function utf8_decodeFN($file){ 
-    global $conf; 
-    if($conf['fnencode'] == 'utf-8') { 
-      $file=mb_convert_encoding($file,"UTF-8","CP936"); 
- return $file;} 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::decode($file); 
-    } 
- 
-    return urldecode($file); 
-} 
-</code> 
-=====如果要跨系统使用===== 
-可以这样改: 
-<code php> 
-function utf8_encodeFN($file,$safe=true){ 
-    global $conf; 
-    //if($conf['fnencode'] == 'utf-8') return $file; 
- if($conf['fnencode'] == 'utf-8'){ 
- if(eregi('win', PHP_OS)){ 
- $file=mb_convert_encoding($file,"CP936","UTF-8"); 
- } 
- return $file; 
- } 
- 
-    if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){ 
-        return $file; 
-    } 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::encode($file); 
-    } 
- 
-    $file = urlencode($file); 
-    $file = str_replace('%2F','/',$file); 
-    return $file; 
-} 
- 
-function utf8_decodeFN($file){ 
-    global $conf; 
-    //if($conf['fnencode'] == 'utf-8') return $file; 
- if($conf['fnencode'] == 'utf-8'){ 
- if(eregi('win', PHP_OS)){ 
- $file=mb_convert_encoding($file,"UTF-8","CP936"); 
- } 
- return $file; 
- } 
- 
-    if($conf['fnencode'] == 'safe'){ 
-        return SafeFN::decode($file); 
-    } 
- 
-    return urldecode($file); 
-} 
-</code> 
-=====windows系统中文乱码自动转换程序===== 
-<code python> 
-""" 
-dokuwiki转码程序。(请将本程序保存为utf8文本) 
-作用:将dokuwiki默认的编码方式编码生成的目录名、文件名,统一转换为可识别的中文。 
-要求python版本大于等于3.4 
-""" 
-  
-from pathlib import Path 
-from urllib.parse import unquote 
-  
-wikipath = 'd:/lzweb/wiki' # 请在这里设置好dokuwiki的安装目录 
-  
-rootpath = Path(wikipath) 
-rootpath = rootpath / 'data' 
-  
-def pathRename(path): # 对path进行转码 
-    newname = path.parent / unquote(path.name) 
-    path.rename(newname) 
-  
-def dealpath(path): # 对path下的全部文件和目录进行递归编码转换 
-    allpath = path.glob('*') # 遍历path下的第一层目录 
-    for p in allpath: 
-        if p.is_file(): pathRename(p) 
-        elif p.is_dir(): # 如果是目录 
-            dealpath(p) # 先对目录下的所有内容改名 
-            pathRename(p) # 再对该目录改名 
-              
-print('转码开始,请耐心等候...') 
-dealpath(rootpath) 
-print('完成全部转换。') 
-</code> 
-使用时,设置下wikipath即可。注意python版本至少是3.4。 
  • wiki/syntax/页面名.1605404355.txt.gz
  • 最后更改: 2020/11/15 01:39
  • 限速四十