Browse Source

added a script to convert the /docs to use local files (for offline)

Zeda Thomas 4 years ago
parent
commit
fac792268f
2 changed files with 75 additions and 0 deletions
  1. 34 0
      tools/imgmap.py
  2. 41 0
      tools/imgmap.txt

+ 34 - 0
tools/imgmap.py

@@ -0,0 +1,34 @@
+#!/usr/bin/python3
+# -*- coding: UTF-8 -*-
+
+import os
+
+# This code copies the markdown documents in the /docs folder to the
+# /localdocs folder, while converting image links to local links.
+# Basically, it makes a version of the readme that can be viewed offline.
+
+# generate the image map
+# first, open the imgmap.txt
+f = open("imgmap.txt",'r')
+s = f.read().split('\n')
+f.close()
+
+# Now lets generate a list
+imgmap = []
+for i in s:
+    if i != '':
+        imgmap += [i.split(' ')]
+
+# Now let's loop through all of the .md files in /docs and copy to /localdocs
+for root, dirs, files in os.walk(os.path.join("..", "docs")):
+    for file in files:
+        if file.endswith(".md"):
+            fn = os.path.join(root, file)
+            f = open(fn,'r')
+            s = f.read()
+            f.close()
+            for i in imgmap:
+                s=s.replace(i[0],"img/"+i[1])
+            f = open(fn.replace("docs","localdocs"),'w')
+            f.write(s)
+            f.close()

+ 41 - 0
tools/imgmap.txt

@@ -0,0 +1,41 @@
+https://i.imgur.com/w8HdE5Q.png img000.png
+https://i.imgur.com/yfXOz7P.png img001.png
+https://i.imgur.com/azgclwr.png img002.png
+https://i.imgur.com/wbWStSQ.png img003.png
+https://i.imgur.com/WiDA6Ib.png img004.png
+https://i.imgur.com/fPqKxCD.png img006.png
+https://i.imgur.com/JGllOAw.gif img007.gif
+https://i.imgur.com/r3ylxgN.png keycodes.png
+https://i.imgur.com/pxvzqNF.png img007.png
+https://i.imgur.com/K96TsgX.png img008.png
+https://i.imgur.com/s6WnO6N.png 004.png
+https://i.imgur.com/0c3FR7o.png 00N.png
+https://i.imgur.com/pZzJxQX.png 00M.png
+https://i.imgur.com/LxAaTR4.png 00I.png
+https://i.imgur.com/px7677d.png 008.png
+https://i.imgur.com/3ihVTvB.png 007.png
+https://i.imgur.com/CpcXi3e.png 00F.png
+https://i.imgur.com/XUNyFii.png 009.png
+https://i.imgur.com/Wp9I4RA.png 00J.png
+https://i.imgur.com/V2YY6bP.png 00L.png
+https://i.imgur.com/Abgbg9h.png 00G.png
+https://i.imgur.com/DTckrFW.gif 006.gif
+https://i.imgur.com/lgqyf1o.png 00H.png
+https://i.imgur.com/rvGAHYa.png 00K.png
+https://i.imgur.com/vIIqxSy.png 006.png
+https://i.imgur.com/y9tsl5u.png 001.png
+https://i.imgur.com/EZ8FunF.png 00C.png
+https://i.imgur.com/g1FIDbu.gif 003.gif
+https://i.imgur.com/TLgaTui.gif 005.gif
+https://i.imgur.com/8F4CDB5.png 00E.png
+https://i.imgur.com/xfj4S3t.png 00A.png
+https://i.imgur.com/m3Ovx4w.png 002.png
+https://i.imgur.com/khIQh7P.png 003.png
+https://i.imgur.com/zgm1WsY.png 000.png
+https://i.imgur.com/0mXpoJT.png 00B.png
+https://i.imgur.com/VWdzeX0.png 005.png
+https://i.imgur.com/ZyXrE6a.png 00D.png
+https://i.imgur.com/aRxTu8Y.gif 001.gif
+https://i.imgur.com/opfuGa1.gif 004.gif
+https://i.imgur.com/a4q4Hoc.gif 002.gif
+https://i.imgur.com/xcQMpKc.gif 000.gif