mirror of
https://github.com/jomjol/AI-on-the-edge-device-docs.git
synced 2025-12-10 13:36:56 +03:00
.
This commit is contained in:
@@ -13,7 +13,7 @@ parameterOverviewFile = "../docs/Parameters.md"
|
||||
parameterOverviewTemplateFile = "./templates/overview.md"
|
||||
|
||||
def appendParameterFile(folder, file):
|
||||
print(folder, file)
|
||||
#print(folder, file)
|
||||
|
||||
with open(file, 'r') as parameterFileHandle:
|
||||
parameterDoc = parameterFileHandle.read()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
For each parameter which can be found in the config file,
|
||||
create a markdown file with a templated contentf it does not exist yet.
|
||||
create a markdown file with a templated content it does not exist yet.
|
||||
The files are grouped in sub folders representing the config sections.
|
||||
"""
|
||||
|
||||
@@ -8,12 +8,14 @@ import os
|
||||
import configparser
|
||||
import urllib.request
|
||||
|
||||
|
||||
configFileUrl = "https://raw.githubusercontent.com/jomjol/AI-on-the-edge-device/rolling/sd-card/config/config.ini"
|
||||
|
||||
parameterDocsFolder = "parameter-pages"
|
||||
parameterTemplateFile = "./templates/parameter.md"
|
||||
|
||||
# Fetch default config file from URL
|
||||
print("Fetching %r..." % configFileUrl)
|
||||
with urllib.request.urlopen(configFileUrl) as response:
|
||||
content = response.read().decode("utf-8")
|
||||
|
||||
@@ -39,7 +41,7 @@ with open(parameterTemplateFile, 'r') as parameterTemplateFileHandle:
|
||||
parameterTemplate = parameterTemplateFileHandle.read()
|
||||
|
||||
|
||||
|
||||
print("For each section/parameter, check if there is already a documentation page in the folder %r..." % (os.getcwd() + "/" + parameterDocsFolder))
|
||||
for section in config:
|
||||
if section != "DEFAULT":
|
||||
#print(section)
|
||||
@@ -60,6 +62,7 @@ for section in config:
|
||||
parameterDocFile = subFolder + '/' + parameter + ".md"
|
||||
|
||||
if not os.path.exists(parameterDocFile): # File does not exist yet, generate template
|
||||
print("%r does not exit yet, generating a templated file for it" % (os.getcwd() + "/" + parameterDocFile))
|
||||
with open(parameterDocFile, 'w') as paramFileHandle:
|
||||
content = parameterTemplate
|
||||
content = content.replace("$NAME", parameter)
|
||||
|
||||
Reference in New Issue
Block a user