version=pmwiki-2.2.66 ordered=1 urlencoded=1
author=gb
charset=UTF-8
csum=+no space following the comma (when listing targets)
name=PmWiki.PageFileFormat
rev=57
targets=PmWiki.Passwords,SiteAdmin.Status,Cookbook.ImportText,Cookbook.AdminByShell,Cookbook.PageTopStore,Category.PmWikiDeveloper
text=(:Summary:Create wiki formatted pages in bulk and for upload to your pmwiki site:)%0aYou may have many documents that you would like to use a local program to format in a format PmWiki can display.%0a%0aYou could open each document and copy/paste the content to new pmwiki pages or you could format the document in advance and upload it using an FTP client.%0a%0aOnly two lines are necessary in a PmWiki page file:%0a%0a->[@%0aversion=pmwiki-2.1.0 urlencoded=1%0atext=Markup text%0a@]%0a%0a"version=" tells PmWiki that the values are urlencoded.  The actual value doesn't matter, as long as "urlencoded=1" appears somewhere in the line.%0a%0a"text=" ''needs'' to have the markup text with newlines converted to "%250a" and percent signs converted to "%2525".%0a%0a-> In addition, ''PmWiki writes'' pages with '%3c' encoded as "%253c" (to help with security), but it doesn't require that %3c's be encoded that way in order to be able to read the page. More conversions are possible to be added in the future.%0a%0aIn order to let the [@(:pagelist :)@] markup work, make sure the filename begins with an uppercase letter.%0a%0aIn order to have the [@(:pagelist link= ... :)@] markup on other pages list this page, a third attribute is required:%0a%0a->[@%0atargets=GroupName1.Pagename1,GroupName2.Pagename2,...%0a@]%0a%0a"targets=" is a comma delimited list of all links from the current page (no space following the comma).%0a%0a----%0a%0aKeys you could see in a raw PmWiki file:%0a%0a:'''version''': Version of PmWiki used to create the file %25comment%25 More??? (ordered, urlencoded)%25%25%0a:'''agent''': Author's browser when saving the page%0a:'''author''': Last author to save page%0a:'''charset''': The character encoding of the page text%0a:'''csum''': Change summary%0a:'''ctime''': Page creation time%0a:'''description''':Page description. Used to fill [@%3cmeta name='description' />@] if set via[@(:description page'sdecription text:)@]%0a:'''host''': Host created this page%0a:'''name''': Name of the page (e.g., [@Main.WikiSandbox@])%0a:'''passwdattr''': encrypted version of the password required to change [[PmWiki/Passwords|attributes]]%0a:'''passwdedit''': encrypted version of the password required to edit %0a:'''passwdread''': encrypted version of the password required to read%0a:'''passwdupload''': encrypted version of the password required to upload%0a:'''rev''': Number of times the page has been edited%0a:'''targets''': Targets for links in the page%0a:'''text''': The page's wiki markup%0a:'''time''': Time the page was last saved (seconds since 1 Jan 1970 00:00 UTC)%0a:'''title''': Page title set via [@(:title The Page Title:)@].%0a:'''newline''': Character used for newlines (deprecated)%0a:'''updatedto''': The version to which PmWiki has been updated to by [@upgrades.php@] (only on [[SiteAdmin.Status]])%0a%0aBelow these you will see information used to keep track of the page's revision history.%0a%0a!![[#creating]] Creating a Page for Distribution%0a%0aA simple way to create a wikipage file to use for distribution (for example with a recipe or a skin) is to create the page with PmWiki and then use a text editor to delete all lines but ''version'', ''text'', and ''ctime''.  Example:%0a%0a->[@%0aversion=pmwiki-2.1.0 ordered=1 urlencoded=1%0atext=This is a line.%250aThis is another.%0actime=1142030000%0a@]%0a%0a[[#history]]%0a!! Keeping track of page history%0a%0aInside of a page file, PmWiki stores the latest version of the markup text, and uses this to render the page.  The page history is kept as a sequence of differences between the latest version of the page and each previous version.%0a%0aPmWiki normally puts the page history at the end of each page file in reverse chronological sequence, and sets the "ordered=1" items in the header.  If an operation needs only the most recent version of a page, then PmWiki will stop reading and processing a page file at the point where the history begins, potentially saving a lot of time and memory.  If the "ordered=1" flag isn't present, PmWiki makes no assumptions about the ordering of items in the pagefile and processes the entire file.%0a%0a!! Load pages from text files%0aSee [[Cookbook: Import text]]. {Cookbook/ImportText$:Summary}%0a%0a!! Unix utility to extract wiki text%0a%0aThe following unix script (tested on MacOSX) will extract and decode the current text from a wiki file:%0a%0a->[@%0a#!/bin/tcsh%0a# wtext - extract wiki text%0a#%0a# wtext wikifile > output%0a%0aset fn = "$1"%0aif ("$fn" == "") then%0a  echo "need input file parameter"%0a  exit 999%0aendif%0aif (! -f $fn) then%0a  echo "$fn does not exist"%0a  exit 999%0aendif%0arm sedin.$$ >& /dev/null%0aset ch = `grep ^newline= $fn | cut -d= -f2`%0aif ("$ch" == "") set ch = "%250a"%0acat %3c%3ceof > sedin.$$%0as/^text=//%0as/$ch/\%0a/g%0as/%253c/%3c/g%0as/%2525/%25/g%0aeof%0agrep "^text=" "$1" | sed -f sedin.$$%0arm sedin.$$ >& /dev/null%0a@]%0a%0a!!See also%0a* [[Cookbook:AdminByShell]] [-A collection of ways to assist sysadmin of pmwiki using shell tools-]%0a* [[Cookbook:PageTopStore]] [-A PageStore alternative which doesn't mangle page contents when viewed outside PmWiki-]%0a%0aCategories: [[!PmWiki Developer]]
time=1406843262
