Benutzer-Werkzeuge

Webseiten-Werkzeuge


importing_mediawiki_content_into_dokuwiki

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

importing_mediawiki_content_into_dokuwiki [2018-11-06 19:27]
fanir angelegt
importing_mediawiki_content_into_dokuwiki [2020-02-10 22:11] (aktuell)
fanir [Importing Mediawiki Content into Dokuwiki] code formatting
Zeile 14: Zeile 14:
   - Import users using yamdwe_users.py   - Import users using yamdwe_users.py
   - ''cd'' into your Dokuwiki installation directory   - ''cd'' into your Dokuwiki installation directory
-  - Add page titles from the page file names: ''for f in $(find data/pages/ -maxdepth 1 -type f) ; do t=$(echo $f | sed -E -e 's#^.+/(.+)\.txt$#\1#' -e 's#_# #g' -e 's#\b.#\u&#g')cp "$f" "$f.backup" sed -i "1i====== $t ======\\n" $f done''+  - Add page titles from the page file names: <code bash>for f in $(find data/pages/ -maxdepth 1 -type f) ; do 
 +    t=$(echo $f | sed -E -e 's#^.+/(.+)\.txt$#\1#' -e 's#_# #g' -e 's#\b.#\u&#g') 
 +    cp "$f" "$f.backup" 
 +    sed -i "1i====== $t ======\\n" $f 
 +done</code>
     - I only had pages in the root namespace, ''find data/pages/ -maxdepth 1 -type f'' finds all those     - I only had pages in the root namespace, ''find data/pages/ -maxdepth 1 -type f'' finds all those
     - The first ''sed'' builds the page title and uses extended regex (''-E''):     - The first ''sed'' builds the page title and uses extended regex (''-E''):
importing_mediawiki_content_into_dokuwiki.1541528831.txt.gz · Zuletzt geändert: 2018-11-06 19:27 von fanir