1
0
Fork 0
This commit is contained in:
hkernbach 2015-08-24 11:44:31 +02:00
commit e2727c7297
4 changed files with 24 additions and 21 deletions

View File

@ -58,9 +58,9 @@ build-book:
done
python generateMdFiles.py $(NAME) ppbooks/
cd ppbooks/$(NAME) && sed -ie 's/VERSION_NUMBER/v$(newVersionNumber)/g' styles/header.js
cd ppbooks/$(NAME) && sed -ie 's/VERSION_NUMBER/v$(newVersionNumber)/g' README.md
cd ppbooks/$(NAME) && sed -ie 's/VERSION_NUMBER/v$(newVersionNumber)/g' book.json
cd ppbooks/$(NAME) && sed -i -e 's/VERSION_NUMBER/v$(newVersionNumber)/g' styles/header.js
cd ppbooks/$(NAME) && sed -i -e 's/VERSION_NUMBER/v$(newVersionNumber)/g' README.md
cd ppbooks/$(NAME) && sed -i -e 's/VERSION_NUMBER/v$(newVersionNumber)/g' book.json
test -d books/$(NAME) || mkdir -p books/$(NAME)

View File

@ -1,6 +1,8 @@
{
"gitbook": ">=2.0.0",
"title": "ArangoDB VERSION_NUMBER Documentation",
"author": "ArangoDB GmbH",
"description": "Official manual for ArangoDB - the multi-model NoSQL database",
"language": "en",
"plugins":["expandable-chapters", "addcssjs"],
"pdf": {

View File

@ -16,17 +16,17 @@ def replaceCode(pathOfFile, newVersionNumber):
s=f.read()
f.close()
f=open(pathOfFile,'w')
lines = s.replace("<a href=\"../Blueprint-Graphs/README.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/README.html\">")
lines = lines.replace("<a href=\"../Blueprint-Graphs/VertexMethods.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/VertexMethods.html\">")
lines = lines.replace("<a href=\"../Blueprint-Graphs/GraphConstructor.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/GraphConstructor.html\">")
lines = lines.replace("<a href=\"../Blueprint-Graphs/EdgeMethods.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/EdgeMethods.html\">")
lines = lines.replace("<a href=\"../HttpGraphs/README.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/README.html\">")
lines = lines.replace("<a href=\"../HttpGraphs/Vertex.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/Vertex.html\">")
lines = lines.replace("<a href=\"../HttpGraphs/Edge.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/Edge.html\">")
lines = lines.replace("<a href=\"../ModuleGraph/README.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/README.html\">")
lines = lines.replace("<a href=\"../ModuleGraph/GraphConstructor.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/GraphConstructor.html\">")
lines = lines.replace("<a href=\"../ModuleGraph/VertexMethods.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/VertexMethods.html\">")
lines = lines.replace("<a href=\"../ModuleGraph/EdgeMethods.html\">","<a class=\"fa fa-exclamation-triangle\" style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/EdgeMethods.html\">")
lines = s.replace("<a href=\"../Blueprint-Graphs/README.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/README.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../Blueprint-Graphs/VertexMethods.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/VertexMethods.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../Blueprint-Graphs/GraphConstructor.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/GraphConstructor.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../Blueprint-Graphs/EdgeMethods.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../Blueprint-Graphs/EdgeMethods.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../HttpGraphs/README.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/README.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../HttpGraphs/Vertex.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/Vertex.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../HttpGraphs/Edge.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../HttpGraphs/Edge.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../ModuleGraph/README.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/README.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../ModuleGraph/GraphConstructor.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/GraphConstructor.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../ModuleGraph/VertexMethods.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/VertexMethods.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
lines = lines.replace("<a href=\"../ModuleGraph/EdgeMethods.html\">","<a style=\"color:rgba(240,210,0,1)\" href=\"../ModuleGraph/EdgeMethods.html\"><i class=\"fa fa-exclamation-triangle\"></i> ")
#lines = lines.replace("!CHAPTER","#")
lines = re.sub("!CHAPTER\s+" + "(.*)", r"<h1>\g<1></h1>", lines)
#lines = lines.replace("!SECTION","##")

View File

@ -72,7 +72,7 @@ def walk_on_files(inDirPath, outDirPath):
for file in files:
if file.endswith(".mdpp"):
inFileFull = os.path.join(root, file)
outFileFull = os.path.join(outDirPath, re.sub(r'mdpp$', 'md', inFileFull));
outFileFull = os.path.join(outDirPath, re.sub(r'mdpp$', 'md', inFileFull))
print "%s -> %s" % (inFileFull, outFileFull)
_mkdir_recursive(os.path.join(outDirPath, root))
mdpp = open(inFileFull, "r")
@ -80,7 +80,7 @@ def walk_on_files(inDirPath, outDirPath):
MarkdownPP.MarkdownPP(input=mdpp, output=md, modules=MarkdownPP.modules.keys())
mdpp.close()
md.close()
findStartCode(md, outFileFull);
findStartCode(md, outFileFull)
def findStartCode(fd,full_path):
inFD = open(full_path, "r")
@ -135,8 +135,9 @@ def replaceTextInline(text, pathOfFile, searchText):
print '*' * 80
print text
exit(1)
rePattern = r'\s*@startDocuBlockInline\s+'+ searchText +'.*@endDocuBlock\s' + searchText
match = re.search(rePattern, text, flags=re.DOTALL);
rePattern = r'(?s)\s*@startDocuBlockInline\s+'+ searchText +'.*@endDocuBlock\s' + searchText
# (?s) is equivalent to flags=re.DOTALL but works in Python 2.6
match = re.search(rePattern, text)
if (match == None):
print "failed to match with '%s' for %s in file %s in: \n%s" % (rePattern, searchText, pathOfFile, text)
@ -145,9 +146,9 @@ def replaceTextInline(text, pathOfFile, searchText):
subtext = match.group(0)
if (len(re.findall('@startDocuBlock', subtext)) > 1):
print "failed to snap with '%s' on end docublock for %s in %s our match is:\n%s" % (rePattern, searchText, pathOfFile, subtext)
exit(1);
exit(1)
return re.sub(rePattern, dokuBlocks[1][searchText], text, flags=re.DOTALL)
return re.sub(rePattern, dokuBlocks[1][searchText], text)
################################################################################
# Read the docublocks into memory
@ -186,7 +187,7 @@ def readNextLine(line):
def loadDokuBlocks():
state = STATE_SEARCH_START
f=open("allComments.txt", 'rU')
count = 0;
count = 0
for line in f.readlines():
if state == STATE_SEARCH_START:
state = readStartLine(line)