KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
4.8KB

  1. #!/usr/bin/env python3
  2. import os
  3. manualPages = (
  4. "kxstudio_introduction",
  5. "kxstudio_and_free_software",
  6. "downloading_and_booting_kxstudio",
  7. "installing_kxstudio",
  8. "package_management",
  9. "video_drivers",
  10. "included_and_recommended_apps",
  11. "linux_audio_overview",
  12. "alsa_and_kxstudio",
  13. "cadence_introduction",
  14. "jack_configuration",
  15. "simple_claudia_studio",
  16. "latency",
  17. "wineasio_and_reaper",
  18. "useful_links_and_getting_help"
  19. )
  20. for page in manualPages:
  21. print(page)
  22. tmppage = "tmp_%s" % page
  23. webpage = "http://www.wiki.linuxmusicians.com/doku.php?id=%s" % page
  24. #os.system("wget %s -O %s" % (webpage, tmppage))
  25. tmppageFd = open(tmppage, "r")
  26. tmppageRead = tmppageFd.read().strip()
  27. tmppageFd.close()
  28. # remove initial html code
  29. readPart1 = tmppageRead.split("<!-- wikipage start -->", 1)[1].strip()
  30. # remove TOC, if any
  31. readPart2 = readPart1.split("<!-- TOC END -->", 1)[-1].strip()
  32. # remove final html code
  33. readPart3 = readPart2.split("<!-- wikipage stop -->", 1)[0].strip()
  34. # remove first part of the page, we want the title
  35. readPart4 = readPart3.split("<h1><a name=", 1)[1].strip()
  36. # get the title
  37. kxPageTitle = readPart4.split(">", 1)[1].split("</a>", 1)[0].strip()
  38. # remove initial bits of html code (title)
  39. readPart5 = readPart4.split("</h1>", 1)[1].strip()
  40. # html cleanup
  41. readPart6 = readPart5.replace("<h2><a name=", "<h2><span name=").replace("</a></h2>", "</span></h2>")
  42. readPart7 = readPart6.replace("/lib/exe/", "http://www.wiki.linuxmusicians.com/lib/exe/")
  43. # custom mods
  44. readPart8 = readPart7.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=jack_configuration&amp;cache=cache&amp;media=cadence-jack-settings.png",
  45. "http://kxstudio.sourceforge.net/screenshots/cadence-jacksettings2.png")
  46. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=cadence-jack-settings.png",
  47. "http://kxstudio.sourceforge.net/screenshots/cadence-jacksettings2.png")
  48. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=cadence_introduction&amp;cache=cache&amp;media=cadence.png",
  49. "http://kxstudio.sourceforge.net/screenshots/cadence1.png")
  50. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=cadence.png",
  51. "http://kxstudio.sourceforge.net/screenshots/cadence1.png")
  52. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=simple_claudia_studio&amp;cache=cache&amp;media=claudia2.png",
  53. "http://kxstudio.sourceforge.net/screenshots/claudia-qtractor.png")
  54. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=claudia2.png",
  55. "http://kxstudio.sourceforge.net/screenshots/claudia-qtractor.png")
  56. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=alsa_and_kxstudio&amp;cache=cache&amp;media=kmixer.png",
  57. "http://kxstudio.sourceforge.net/screenshots/kmix.png")
  58. readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=kmixer.png",
  59. "http://kxstudio.sourceforge.net/screenshots/kmix.png")
  60. readPart8 = readPart8.replace(" The &#039;UAC3553B&#039; tab displays controls for a USB audio device whilst &#039;Playback Streams&#039; can be ignored unless you are using PulseAudio.",
  61. "")
  62. readPart8 = readPart8.replace("as &#039;Mic&#039; and &#039;Mic Boost&#039; do", "as &#039;Beep&#039; does")
  63. readPart8 = readPart8.replace("<a href=\"/doku.php?id=", "<a href=\"<?php echo $ROOT; ?>/Documentation:Manual:")
  64. kxPageContent = '<?php\n'
  65. kxPageContent += '$PAGE_TITLE = "KXStudio";\n'
  66. kxPageContent += '$PAGE_TYPE = "NONKXSTUDIO";\n'
  67. kxPageContent += '$PAGE_SOURCE_1 = ARRAY("/Documentation", "/Documentation", "/Documentation:Manual:%s");\n' % page
  68. kxPageContent += '$PAGE_SOURCE_2 = ARRAY("Documentation", "Manual", "%s");\n' % kxPageTitle
  69. kxPageContent += 'include_once("includes/header.php");\n'
  70. kxPageContent += '?>\n'
  71. kxPageContent += '\n'
  72. kxPageContent += readPart8
  73. kxPageContent += '\n'
  74. kxPageContent += '\n'
  75. kxPageContent += '<p><br/></p>\n'
  76. kxPageContent += '\n'
  77. kxPageContent += '<?php\n'
  78. kxPageContent += 'include_once("includes/footer.php");\n'
  79. kxPageContent += '?>\n'
  80. pageFd = open("Documentation:Manual:%s.php" % page, "w")
  81. pageFd.write(kxPageContent)
  82. pageFd.close()