From 218cb633fa9e209a7f454be5302bdba0ef89c0cd Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 25 Sep 2016 16:51:18 +0200 Subject: [PATCH] Fixup manual-pages script for linuxaudio.org wiki --- _manual/create-manual-pages.py | 64 +++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/_manual/create-manual-pages.py b/_manual/create-manual-pages.py index da48627..755969f 100755 --- a/_manual/create-manual-pages.py +++ b/_manual/create-manual-pages.py @@ -45,40 +45,62 @@ for page in manualPages: # remove initial bits of html code (title) readPart5 = readPart4.split("", 1)[1].strip() - # html cleanup - readPart6 = readPart5.replace("

", "") - readPart7 = readPart6.replace("/lib/exe/", "http://www.wiki.linuxmusicians.com/lib/exe/") + # custom mods + readPart5 = readPart5.replace("/_detail/wiki/cadence.png?id=wiki%3Acadence_introduction", + "/screenshots/cadence1.png") + readPart5 = readPart5.replace("/_media/wiki/cadence.png", + "/screenshots/cadence1.png") - # FIXME: this should happen on the wiki too - readPart7 = readPart7.replace("kxstudio.sourceforge.net", "kxstudio.linuxaudio.org") + readPart5 = readPart5.replace("/_detail/wiki/cadence-wineasio.png?id=wiki%3Awineasio_and_reaper", + "/screenshots/cadence3.png") + readPart5 = readPart5.replace("/_media/wiki/cadence-wineasio.png", + "/screenshots/cadence3.png") - # custom mods - readPart8 = readPart7.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=jack_configuration&cache=cache&media=cadence-jack-settings.png", + readPart5 = readPart5.replace("/_detail/wiki/cadence-jack-settings.png?id=wiki%3Ajack_configuration", "/screenshots/cadence-jacksettings2.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=cadence-jack-settings.png", + readPart5 = readPart5.replace("/_media/wiki/cadence-jack-settings.png", "/screenshots/cadence-jacksettings2.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=cadence_introduction&cache=cache&media=cadence.png", - "/screenshots/cadence1.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=cadence.png", - "/screenshots/cadence1.png") - - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=simple_claudia_studio&cache=cache&media=claudia2.png", + readPart5 = readPart5.replace("/_detail/wiki/claudia2.png?id=wiki%3Asimple_claudia_studio", "/screenshots/claudia-qtractor.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=claudia2.png", + readPart5 = readPart5.replace("/_media/wiki/claudia2.png", "/screenshots/claudia-qtractor.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=alsa_and_kxstudio&cache=cache&media=kmixer.png", + readPart5 = readPart5.replace("/_detail/wiki/kmixer.png?id=wiki%3Aalsa_and_kxstudio", "/screenshots/kmix.png") - readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=kmixer.png", + readPart5 = readPart5.replace("/_media/wiki/kmixer.png", "/screenshots/kmix.png") - readPart8 = readPart8.replace(" The 'UAC3553B' tab displays controls for a USB audio device whilst 'Playback Streams' can be ignored unless you are using PulseAudio.", + k1 = '' + k2 = 'The kmix icon' + k3 = '' + readPart5 = readPart5.replace(k1+k2+k3, k2) + readPart5 = readPart5.replace('?w=500" class="mediacenter" alt="" width="500"', '" class="media" alt=""') + + # html cleanup + for i in range(2, 10): + readPart5 = readPart5.replace(" class=\"sectionedit%i\"" % i, "") + readPart5 = readPart5.replace("

", "") + readPart5 = readPart5.replace("

", "") + readPart5 = readPart5.replace("/_detail/wiki/", "http://wiki.linuxaudio.org/_detail/wiki/") + readPart5 = readPart5.replace("/_media/wiki/", "http://wiki.linuxaudio.org/_media/wiki/") + readPart5 = readPart5.replace('href="/wiki/', 'target="_blank" href="http://wiki.linuxaudio.org/wiki/') + readPart5 = readPart5.replace('title="wiki:', 'title="') + + # TODO: remove this + readPart5 = readPart5.replace('ALSA','ALSA') + readPart5 = readPart5.replace('DSP','DSP') + + # FIXME: this should happen on the wiki + readPart5 = readPart5.replace("kxstudio.sourceforge.net", "kxstudio.linuxaudio.org") + + readPart5 = readPart5.replace(" The 'UAC3553B' tab displays controls for a USB audio device whilst 'Playback Streams' can be ignored unless you are using PulseAudio.", "") - readPart8 = readPart8.replace("as 'Mic' and 'Mic Boost' do", "as 'Beep' does") + readPart5 = readPart5.replace("as 'Mic' and 'Mic Boost' do", "as 'Beep' does") - readPart8 = readPart8.replace("/Documentation:Manual:") + readPart5 = readPart5.replace("/Documentation:Manual:") + readPart5 = readPart5.replace("http://kxstudio.linuxaudio.org/", "/") kxPageContent = '\n' kxPageContent += '\n' - kxPageContent += readPart8 + kxPageContent += readPart5 kxPageContent += '\n' kxPageContent += '\n'