Documentation is available for the following versions: '
#for version in versions:
# content += ''+version+' | '
@@ -155,24 +159,24 @@ def mkNavigation(versions):
if version == 'devel':
content += '
'
else:
- content += '
'
+ content += ''
-
+
content += '
'
-
+
return content
# make sure some resources are put in the right place for the website
def mkResources(root_dir, web_root):
- # starter index.html (just a redirect to 'stable')
+ # starter index.html (just a redirect to 'stable')
os.system('cp ' + root_dir + 'resources/index.html ' + web_root + 'index.html ')
# Builds an index.md file of all the contributed repository documetation (if available)
@@ -181,20 +185,20 @@ def mkcontribmodsindex(contrib_mods, module_index_file, contrib_mods_files):
module_index += "===========================\n\n"
pages = {}
-
+
for page in contrib_mods_files:
s = page.split("/")
mod_name = s[len(s) -2]
page_name = s[len(s) -1]
-
+
if mod_name not in pages.keys():
pages[mod_name] = []
pages[mod_name].append(page_name)
-
+
for module in contrib_mods:
module_index += " * "+ module["name"] + "\n"
-
+
if module["description"] is not None:
module_index += ": " + module["description"] + "\n"
@@ -204,30 +208,30 @@ def mkcontribmodsindex(contrib_mods, module_index_file, contrib_mods_files):
for page in pages[module["short_name"]]:
module_index += " * Documentation: ["+ page + "](contrib_modules/"+ module["short_name"] + "/" + page +")\n"
except KeyError:
- # some modules do not have documentation, just ignore them
+ # some modules do not have documentation, just ignore them
pass
-
+
with open(module_index_file, 'w+') as f:
f.write(module_index)
# reads files and (sub)dirs from a given directory
def getListOfFiles(dirName):
- # create a list of file and sub directories
- # names in the given directory
+ # create a list of file and sub directories
+ # names in the given directory
listOfFile = os.listdir(dirName)
allFiles = list()
# Iterate over all the entries
for entry in listOfFile:
# Create full path
fullPath = os.path.join(dirName, entry)
- # If entry is a directory then get the list of files in this directory
+ # If entry is a directory then get the list of files in this directory
if os.path.isdir(fullPath):
allFiles = allFiles + getListOfFiles(fullPath)
else:
allFiles.append(fullPath)
-
+
return allFiles
-
+
################################################
#
# MAIN
@@ -276,7 +280,7 @@ def getListOfFiles(dirName):
for ssp_version in ssp_versions:
print("Working on: " + ssp_version)
#print("Repo Root: " + repo_root_dir)
-
+
version_dir = tempdir + ssp_version + "/"
#print("Version dir: " + version_dir)
getgitrepo('https://github.com/simplesamlphp/simplesamlphp.git', version_dir, repo_root_dir, ssp_version)
@@ -306,22 +310,22 @@ def getListOfFiles(dirName):
print("Working on: " + module["name"])
contrib_mod_dir = tempdir + "contrib_modules/" + module["name"] + "/"
contrib_mod_web_dir = site_root_dir + "contrib_modules" + "/"
-
- # We assume contributes modules live in the ssp repo and are named 'simplesamlphp-module-*'
+
+ # We assume contributes modules live in the ssp repo and are named 'simplesamlphp-module-*'
getgitrepo(module["html_url"], contrib_mod_dir, module["name"])
-
+
module_dir = os.path.join(contrib_mod_dir, module["name"], "docs/")
print(module_dir)
-
+
if os.path.isdir(module_dir):
module_output_dir = os.path.join(contrib_mod_web_dir, module["short_name"]+ "/")
parsefiles(module_dir, module_output_dir)
-
+
else:
print("No docs found for '" + module["name"] +"'")
-
+
# Now build an index of generated documents
-contrib_mods_files= getListOfFiles(site_root_dir + "contrib_modules" + "/")
+contrib_mods_files= getListOfFiles(site_root_dir + "contrib_modules" + "/")
mkcontribmodsindex(contrib_mods, module_index_file, contrib_mods_files)
md2html(module_index_file, site_root_dir + 'contributed_modules.html', 'contributed_modules.html')
'
content += ' Contributed modules'
content += '
'
-
+
content += '