Editing (syntax), Administrating (managing installation), Extending (via programming)

pump-up your PmWiki-Fu!

SSL support

  • make sure content is served with Protocol-relative URL
    • i.e. //website.tld/path/to/mycontent rather than https://website.tld/path/to/mycontent or http://website.tld/path/to/mycontent
    • including in particular the skin, the PubDirUrl and SkinDirUrl configurations but also localmap.txt and icon previews for localmaps

Modern(ish) version

  1. unpack pmwiki latest
    1. add configuration file, fix path in it and in the httpd configuration file
  2. unpack pmwiki bootstrap skin in ./pub/skins/bootstrap-fluid
    1. configure $Skin = 'bootstrap-fluid';
  3. install Cookbook:Ape

Editing (syntax, ...)

Typically this only require writing access to some part of the PmWiki.

Administrating (managing recipes, ...)

Typically this require ssh access to the PmWiki installation and some understand of PmWiki mechanisms.

@] despite free disk space df

  • check inodes via df -i
    • if nothing is free check for the largest consuming inode directory (typically /var/lib/php5/)

Specific usage cookbooks

Out of date (01/03/2011) raw list of cookbooks I was then using Path:/pub/cookbook-list.txt

  • Cookbook:AddUrlSchemes Add the desired schemes as new InterMap
  • rank content
    • Cookbook:StarRanker
    • consider Object/GroupHeader or Object/GroupFooter
    • PageList for rated and yet non rater object
    • rating per user
  • page creation simplified
  • handle slide shows
    • Cookbook:SlideShow (see also my comment as I had problems during the installation)
    • do not forget the little menu on the bottom right corner
      • bugs regarding notes and link to separate slide ( #slideX )
    • see the resulting Slideshows
  • display graphs
  • display equations
  • displaying wiki updates within another page
    • from external wikis Cookbook:PmFeed
    • for internal pages (:include Site.AllRecentChanges lines=5:)
      • this can be done per group too (:include {$Group}.RecentChanges lines=5:)
  • PmWiki is dependable on PHP limitations : backtracking limit bug
  • when you manipulate account and password, remember that
    • PmWiki remembers that and treats you as an admin from then on (thus not prompting for an edit password) it remembers you as an admin until you logout (?action=logout) or completely shut down the browser

Extending (programming, ...)

Typically this require ssh access to the PmWiki installation and programming skills. See my pmwiki_recipes.

  • naive parsing
    • grep -a "text=" wiki.d/Fabien.Principle | sed "s/%0a/\n/g" | sed "s/*/<li>/g" | sed 's/!!!/<h3>/'
    • does not start/close the page
    • does not close tags
  • include a wiki page within another website
    • members can then edit a specific group of a wiki and make it appear as part of a larger website
    • ini_set('display_errors',0);ini_set('display_errors',0); $pagename="SiteInternet.Bibliographie"; @$_REQUEST['n'] = $pagename; chdir('../wiki'); include_once('pmwiki.php');
    • alternatively one can do file_get_content(wiki_url?action=print); with parameters
    • hide the wiki aspect via (:noheader:)(:nofooter:)(:noleft:)(:noright:)(:notitle:)(:noaction:)
  • avoid loading previous edition
    • READPAGE_CURRENT in ReadPage()/RetrieveAuthPage() cf PmWiki:Functions
      • applied to the 2 visualization recipes on books and contacts
      • but not used in the the timeline visualization since older edits do matter
  • creating your own markup
    • cf PmWiki:CustomMarkup
    • note that the $when condition does matter a lot
      • e.g. if ones tries to match multiple lines with the /s or /m regex modifier after the fulltext event, nothing will appear since lines have already been splitted
  • rendering a page or part of page in a recipe
  • access to pmWiki variables from within a recipe
  • creating custom Markup()
  • preventing escaping thanks to Keep()
  • getting pages thanks to ListPages("Pattern.");
  • Read the content of a page
    	$pagename = "MyGroup.MyPage";
    	//getting the content of the page
    	$pagecontent = RetrieveAuthPage($pagename, 'read', $authprompt = 'false', READPAGE_CURRENT);
    	//focusing on content, not meta-data
    	$content = $pagecontent['text']
    
  • how to query via PmWiki:EditingAPI
    • PmWiki is designed like a library that can be called from PHP scripts -- not really.
    • typically I (pmichaud) suggest that other packages use the HTTP interface to manipulate the wiki
    • it's been very stable -- few changes over minor upgrades
  • any "official" effort to use nicely DataPortability formats?
    • PmWiki can output RSS and RDF but beyond that, no.
  • Get pages and remove the system ones
    	// update with content
    	$cleandata = ListPages("/Oimp\./e");
    	//General cleaning
    	$cleandata = MatchPageNames($cleandata,array('-*.*RecentChanges,-*.GroupFooter,-*.GroupHeader'));
    
  • is there a way to query an instance remotely? e.g. having access to global variable remotely, to do the inverse of the include function and thus benefit from PageList() and other functions on the remote wiki.d/

Starting point for Development section of the documentation

See also

To do

  • consider Cookbook:SkinAlternative Skin your pages within your wiki itself, rather than using downloadable skins
  • get PTV value per page version
  • To Add to my PmWiki:Profiles.Utopiah
  • Use post to query pmwiki tutorial to add data by SMS to Test.Test?
    • else do a Recipe that would periodically check (easier but maybe more resources greedy and less responsive)
  • clarify the MarkUp()/Keep() difficulties with Ajax
  • list all the functionnalities required and see what recipe is the more adapted
    • try to only do recipe that are Seedea-dependant
  • modify the editor thanks to one of the several solutions
    • write a MarkUp and modify Site.EditForm
    • add javascript to handle the textarea which already has an id="text" (thus $('text') with scriptaculous) and use a pmwiki keyword for page listing (no need to write PHP then)
    • modify $HTMLHeaderFmt[]
  • PmWiki:Subversion including fully-automated and hassle-free upgrade/backup process

Note

My notes on Tools gather what I know or want to know. Consequently they are not and will never be complete references. For this, official manuals and online communities provide much better answers.