Tips and Instructional topics. Not for support questions.
Post a reply
figlfdev

- figlfdev
- Posts: 116
- Joined: Tue May 31, 2016 6:23 pm

## export didiwiki to html using a bash one-liner

Sun Oct 30, 2016 4:42 am

* sudo apt-get install didiwiki
* in the browser: http://127.0.0.1:8000
* edit the wiki, save, and run the following:

Code:
  `#public domain
  mkdir -p didisite ; for p in $(ls /var/lib/didiwiki) ; do wget -q -O- "http://127.0.0.1:8000/$p" | cat -A | rev | cut -b 2- | rev | egrep "<title|<\/title|<body|<html|<head|<\/head" > "didisite/$p.html" ; wget -q -O- "http://127.0.0.1:8000/$p" | cat -A | rev | cut -b 2- | rev | grep -v "\^$" | grep wikidata -A 1000000 | sed "s/<div/\n<div/g" | sed "s/WikiHome/index/g" | grep -v 'DidiWiki, Version' | sed "s/'>/\.html'>/g" >> "didisite/$p.html" ; done ; rm didisite/WikiHelp.html ; mv didisite/WikiHome.html didisite/index.html`

Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.