Edit History Actions

moin

Notizen zu MoinMoin

Allgemeine Infos und Links: MoinMoin

Alle MoinMoin Seiten als HTML speichern

MoinMoin/script/moin.py --config-dir=path/to/wiki/config --wiki-url=localhost:8055 export dump  --target-dir=path/to/output/dir

Danach Modern-Theme (wiki/htdocs/modern) und logo.png nach path/to/output/dir kopieren.

Bei bedarf, die HTML Dateien mit einem Python Script überarbeiten (z.B. Logo und Datum entfernen):

   1 import os, re
   2 
   3 def makeFileList(root, regexp):
   4     """searches all files matching regexp, recursively in root"""
   5     filemask = re.compile(regexp)
   6     result = []
   7     for r, d, f in os.walk(root):
   8         for fname in f:
   9             if filemask.match(fname):
  10                 result.append(os.path.join(
  11                     os.path.abspath(r),
  12                     fname)
  13                 )
  14     return result
  15 
  16 l = makeFileList('path/to/output/dir', '.*\.html?')
  17 
  18 for fn in l:
  19     f = open(fn,'r')
  20     text = f.read()
  21 
  22     # Remove logo:
  23     text = re.sub(r'<td>\s*<img src="logo.png">\s*</td>',"",text)
  24 
  25     # Remove date:
  26     text = re.sub(r'<hr>\n*.*?\n*</body>',"<hr>\n</body>",text)
  27 
  28     f.close()
  29     # Replace the files content with modified version
  30     f = open(fn,'w')
  31     f.write(text)
  32     f.close()


CategoryMoinMoin