差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

dokuwiki:ja:export [2006/11/11] – 作成 administratordokuwiki:ja:export [2022/03/12] (現在) – 外部編集 127.0.0.1
行 1: 行 1:
 +====== ページのエクスポート ======
  
 +Single wiki pages can be exported to different formats by adding an appropriate "do" parameter to the URL. The following export Options are available currently:
 +
 +  * ''export_raw''
 +    * Returns the pages's source as ''text/plain''
 +    * Example: http://wiki.splitbrain.org/wiki:export?do=export_raw
 +  * ''export_xhtml''
 +    * Returns the rendered page as simple XHTML without any navigational elements
 +    * Example: http://wiki.splitbrain.org/wiki:export?do=export_xhtml
 +  * ''export_xhtmlbody''
 +    * Returns the rendered XHTML of the page only.
 +    * No head or body tags are added. No contenttype headers are sent.
 +    * Useful to include the rendered output into some other website
 +    * Example: http://wiki.splitbrain.org/wiki:export?do=export_xhtmlbody
 +
 +You can specify the ''do'' parameter as an HTTP header called ''X-DOKUWIKI-DO'', too. This may usefull for creating a static dump with a website spider.
 +
 +For exporting other formats refer to the [[wiki:discussion:exporting|Exporting Discussion]] page.
 +
 +//Is there a way to export only the __table of contents__? for the newsflash on ourhomepage (www.brooklynroadrunners.org) this would suffice, referring to the full news story. The programming has already been done, just a way to bring it up?//  -- Geert
 +
 +
 +
 +===== Export multiple pages to HTML =====
 +
 +For exporting multiple pages or whole [[namespaces]] have a look at the [[http://sourceforge.net/project/showfiles.php?group_id=109345&package_id=161552&release_id=366868|offline-doku]] script by [[pacha.shevaev@gmail.com|Pavel Shevaev]].
 +
 +> Unfortunatelly offline-doku does not handle plugin content correctly. Does anyone knows a solution for that? 
 +>> Pavel's script requires php >4.3. for those who don't want to upgrade change line ~46 
 +<code>from
 +$tokens = $parser->parse(file_get_contents($file));
 +to
 +$fp = fopen($file, "rb");
 +$buffer = fread($fp, filesize($file));
 +fclose($fp);
 +$tokens = $parser->parse($buffer);</code>
 +
 +Here's an example command line using [[http://pavuk.sourceforge.net/man.html|Pavuk]] for exporting all pages:
 +
 +<code>
 +pavuk -dont_leave_site -noRobots -index_name "index.html" -httpad "+X_DOKUWIKI_DO: export_xhtml" -cookie_file cookies.txt -cookie_send -skip_rpattern "(.*\?do=(diff|revisions|backlink|index|export_.*))|feed\.php.*" -tr_chr_chr "?&*:" _ -post_update -fnrules F "*" "%h/%d/%b%E" http://wiki.splitbrain.org
 +</code>
 +
 +Simply change the URL at the end of the command.  Also, this command handles ACL restrictions using a cookie file.  Copy the "cookies.txt" file from your web browser's profile to allow the script to login using your credentials.
 +
 +-> see also related page [[wiki:discussion:exporting_website]]