mirror of https://gitee.com/bigwinds/arangodb
Doc - Take whatever line endings and turn them into LF in generation (#5714)
This commit is contained in:
parent
8c586a1a91
commit
0aa1ae24b3
|
@ -15,12 +15,12 @@ Here is a quick guide how to start:
|
|||
|
||||
You successfully launched an ArangoDB instance on AWS.
|
||||
|
||||

|
||||

|
||||
|
||||
The ArangoDB Web-Interface can be reached using the **Access Software** button or via public instance IP and the Port 8529 (e.g.: http://12.13.14.15:8529)
|
||||
The default user is `root` and the password is the `Instance ID` (You can find the Instance ID on the instance list).
|
||||
|
||||

|
||||

|
||||
|
||||
If you want to learn more about ArangoDB, start with the [ArangoDB First Steps][../../Manual/GettingStarted/index.html] in our Documentation or try one of our [Tutorials][5] or Cookbook recipes.
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ https://vmdepot.msopentech.com/
|
|||
|
||||
type in "ArangoDB", select the version you require and press "Create Virtual Machine".
|
||||
|
||||

|
||||

|
||||
|
||||
Follow the instructions given there and within minutes you have a running ArangoDB
|
||||
instance in Microsoft Azure. You will receive an email as soon as your machine
|
||||
|
|
|
@ -171,15 +171,15 @@ on the mesos master.
|
|||
If you now switch to the Marathon console on port `8080`, you should see apps, namely
|
||||
`/guesser/database/arangodb` and `/guesser/frontend/node`.
|
||||
|
||||

|
||||

|
||||
|
||||
If you access port `32222`, you should see the ArangoDB console.
|
||||
|
||||

|
||||

|
||||
|
||||
And finally, on port `32211`, you can play the guesser game.
|
||||
|
||||

|
||||

|
||||
|
||||
### Scaling Up
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ right click on `This PC` in the tree on the left, choose `Properties` in the ope
|
|||
in the Popup `Environment Variables`, another popup opens, in the `System Variables` part you click `New`,
|
||||
And variable name: `ICU_DATA` to the value: `c:\\Windows`
|
||||
|
||||

|
||||

|
||||
|
||||
Running Unit tests (Optional)
|
||||
---------------------------
|
||||
|
|
|
@ -337,7 +337,7 @@ We will inspect the syslog to revalidate nothing went wrong:
|
|||
|
||||
Now we start `kcollectd` to view the values in the RRD file:
|
||||
|
||||

|
||||

|
||||
|
||||
Since we started putting values in just now, we need to choose 'last hour' and zoom in a little more to inspect the values.
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ Now we restart collectd with `/etc/init.d/collectd restart`, watch the syslog fo
|
|||
|
||||
We can inspect our values with kcollectd:
|
||||
|
||||

|
||||

|
||||
|
||||
**Author:** [Wilfried Goesgens](https://github.com/dothebart)
|
||||
|
||||
|
|
|
@ -404,11 +404,13 @@ function build-book()
|
|||
if ditaa --help > /dev/null; then
|
||||
echo "${STD_COLOR} - generating ditaa images${RESET}"
|
||||
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
||||
mkdir -p $(dirname "ppbooks/${image//ditaa/png}")
|
||||
ditaa "${image}" "ppbooks/${image//ditaa/png}"
|
||||
done
|
||||
else
|
||||
echo "${ERR_COLOR} - generating FAKE ditaa images - no ditaa installed${RESET}"
|
||||
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
||||
mkdir -p $(dirname "ppbooks/${image//ditaa/png}")
|
||||
cp "../../js/node/node_modules/mocha/images/error.png" \
|
||||
"ppbooks/${image//ditaa/png}"
|
||||
done
|
||||
|
@ -427,14 +429,10 @@ function build-book()
|
|||
|
||||
(
|
||||
cd "ppbooks/${NAME}"
|
||||
mkdir -p styles
|
||||
cp -a "../../${NAME}/styles/"* styles/
|
||||
)
|
||||
WD=$(pwd)
|
||||
echo "${STD_COLOR} - copying images${RESET}"
|
||||
find "${NAME}" -name "*.png" | while IFS= read -r pic; do
|
||||
cd "${WD}/ppbooks"
|
||||
cp "${WD}/${pic}" "${pic}"
|
||||
done
|
||||
|
||||
echo "${STD_COLOR} - generating MD-Files${RESET}"
|
||||
python ../Scripts/generateMdFiles.py \
|
||||
|
@ -495,8 +493,6 @@ function build-book()
|
|||
rm -f "./books/${NAME}/FOOTER.html"
|
||||
echo "${STD_COLOR} - deleting markdown files in output (gitbook 3.x bug)"
|
||||
find "./books/${NAME}/" -type f -name "*.md" -delete
|
||||
echo "${STD_COLOR} - putting in deprecated items ${RESET}"
|
||||
python ../Scripts/deprecated.py || exit 1
|
||||
|
||||
book-check-markdown-leftovers "${NAME}"
|
||||
}
|
||||
|
@ -566,7 +562,7 @@ function check-docublocks()
|
|||
grep -v '.*#.*:.*' \
|
||||
>> /tmp/rawindoc.txt
|
||||
|
||||
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawindoc.txt |sort -u > /tmp/indoc.txt
|
||||
sed -e "s;\r$;;" -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawindoc.txt |sort -u > /tmp/indoc.txt
|
||||
|
||||
set +e
|
||||
grep -R '^@startDocuBlock' ../DocuBlocks --include "*.md" |grep -v aardvark > /tmp/rawinprog.txt
|
||||
|
@ -587,7 +583,7 @@ function check-docublocks()
|
|||
set -e
|
||||
echo "Generated: startDocuBlockInline errorCodes">> /tmp/rawinprog.txt
|
||||
|
||||
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawinprog.txt |sort > /tmp/inprog_raw.txt
|
||||
sed -e "s;\r$;;" -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawinprog.txt |sort > /tmp/inprog_raw.txt
|
||||
sort -u < /tmp/inprog_raw.txt > /tmp/inprog.txt
|
||||
|
||||
if test "$(wc -l < /tmp/inprog.txt)" -ne "$(wc -l < /tmp/inprog_raw.txt)"; then
|
||||
|
@ -671,6 +667,10 @@ function build-dist-books()
|
|||
{
|
||||
set -x
|
||||
set -e
|
||||
if test -z "${OUTPUT_DIR}"; then
|
||||
echo "please specify --outputDir"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf books ppbooks
|
||||
PIDFILE=/tmp/xvfb_20_0.pid
|
||||
if test "${isCygwin}" -eq 0 -a -z "${DISPLAY}"; then
|
||||
|
|
|
@ -2,6 +2,7 @@ import os
|
|||
import sys
|
||||
import re
|
||||
import inspect
|
||||
import io
|
||||
|
||||
validExtensions = (".cpp", ".h", ".js", ".md")
|
||||
# specify the paths in which docublocks are searched. note that js/apps/* must not be included because it contains js/apps/system/
|
||||
|
@ -28,7 +29,7 @@ def file_content(filepath):
|
|||
""" Fetches and formats file's content to perform the required operation.
|
||||
"""
|
||||
|
||||
infile = open(filepath, 'r')
|
||||
infile = io.open(filepath, 'r', encoding='utf-8', newline=None)
|
||||
filelines = tuple(infile)
|
||||
infile.close()
|
||||
|
||||
|
@ -91,7 +92,7 @@ def example_content(filepath, fh, tag, blockType, placeIntoFilePath):
|
|||
blockCount = 0;
|
||||
|
||||
# read in the context, split into long and short
|
||||
infile = open(filepath, 'r')
|
||||
infile = io.open(filepath, 'r', encoding='utf-8', newline=None)
|
||||
for line in infile:
|
||||
if first:
|
||||
if blockType == "arangosh" and not line.startswith("arangosh>"):
|
||||
|
@ -177,8 +178,8 @@ def example_content(filepath, fh, tag, blockType, placeIntoFilePath):
|
|||
shortable = False
|
||||
|
||||
# write example
|
||||
fh.write("\n")
|
||||
fh.write("<div id=\"%s_container\">\n" % tag)
|
||||
fh.write(unicode("\n"))
|
||||
fh.write(unicode("<div id=\"%s_container\">\n" % tag))
|
||||
|
||||
longTag = "%s_long" % tag
|
||||
shortTag = "%s_short" % tag
|
||||
|
@ -187,35 +188,35 @@ def example_content(filepath, fh, tag, blockType, placeIntoFilePath):
|
|||
shortToggle = "$('#%s').hide(); $('#%s').show();" % (shortTag, longTag)
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\" style=\"Display: none;\">\n" % (longTag, longToggle))
|
||||
fh.write(unicode("<div id=\"%s\" onclick=\"%s\" style=\"Display: none;\">\n" % (longTag, longToggle)))
|
||||
else:
|
||||
fh.write("<div id=\"%s\">\n" % longTag)
|
||||
fh.write(unicode("<div id=\"%s\">\n" % longTag))
|
||||
|
||||
if blockType != "AQL":
|
||||
fh.write("<pre>\n")
|
||||
fh.write("%s" % longText)
|
||||
fh.write("</pre>\n")
|
||||
fh.write("</div>\n")
|
||||
fh.write(unicode("<pre>\n"))
|
||||
fh.write(unicode("%s" % longText))
|
||||
fh.write(unicode("</pre>\n"))
|
||||
fh.write(unicode("</div>\n"))
|
||||
|
||||
if shortable:
|
||||
fh.write("<div id=\"%s\" onclick=\"%s\">\n" % (shortTag, shortToggle))
|
||||
fh.write(unicode("<div id=\"%s\" onclick=\"%s\">\n" % (shortTag, shortToggle)))
|
||||
if blockType != "AQL":
|
||||
fh.write("<pre>\n")
|
||||
fh.write("%s" % short)
|
||||
fh.write(unicode("<pre>\n"))
|
||||
fh.write(unicode("%s" % short))
|
||||
|
||||
if blockType == "arangosh":
|
||||
fh.write("</pre><div class=\"example_show_button\">show execution results</div>\n")
|
||||
fh.write(unicode("</pre><div class=\"example_show_button\">show execution results</div>\n"))
|
||||
elif blockType == "curl":
|
||||
fh.write("</pre><div class=\"example_show_button\">show response body</div>\n")
|
||||
fh.write(unicode("</pre><div class=\"example_show_button\">show response body</div>\n"))
|
||||
elif blockType == "AQL":
|
||||
fh.write("</pre><div class=\"example_show_button\">show query result</div>\n")
|
||||
fh.write(unicode("</pre><div class=\"example_show_button\">show query result</div>\n"))
|
||||
else:
|
||||
fh.write("</pre><div class=\"example_show_button\">show</div>\n")
|
||||
fh.write(unicode("</pre><div class=\"example_show_button\">show</div>\n"))
|
||||
|
||||
fh.write("</div>\n")
|
||||
fh.write(unicode("</div>\n"))
|
||||
|
||||
fh.write("</div>\n")
|
||||
fh.write("\n")
|
||||
fh.write(unicode("</div>\n"))
|
||||
fh.write(unicode("\n"))
|
||||
|
||||
|
||||
def fetch_comments(dirpath):
|
||||
|
@ -224,8 +225,8 @@ def fetch_comments(dirpath):
|
|||
global fullSuccess
|
||||
global validExtensions
|
||||
comments_filename = "allComments.txt"
|
||||
fh = open(comments_filename, "a")
|
||||
shouldIgnoreLine = False;
|
||||
fh = io.open(comments_filename, "a", encoding="utf-8", newline="")
|
||||
shouldIgnoreLine = False
|
||||
|
||||
for root, directories, files in os.walk(dirpath):
|
||||
for filename in files:
|
||||
|
@ -234,7 +235,7 @@ def fetch_comments(dirpath):
|
|||
filepath = os.path.join(root, filename)
|
||||
file_comments = file_content(filepath)
|
||||
for comment in file_comments:
|
||||
fh.write("\n<!-- filename: %s -->\n" % filepath)
|
||||
fh.write(unicode("\n<!-- filename: %s -->\n" % filepath))
|
||||
for _com in comment:
|
||||
_text = re.sub(r"//(/)+\s*\n", "<br />\n", _com) # place in temporary brs...
|
||||
_text = re.sub(r"///+(\s+\s+)([-\*\d])", r" \2", _text)
|
||||
|
@ -244,7 +245,7 @@ def fetch_comments(dirpath):
|
|||
if not shouldIgnoreLine:
|
||||
if ("@startDocuBlock" in _text) or \
|
||||
("@endDocuBlock" in _text):
|
||||
fh.write("%s\n\n" % _text)
|
||||
fh.write(unicode("%s\n\n" % _text))
|
||||
elif ("@EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@EXAMPLE_ARANGOSH_RUN" in _text or \
|
||||
"@EXAMPLE_AQL" in _text):
|
||||
|
@ -269,22 +270,22 @@ def fetch_comments(dirpath):
|
|||
fullSuccess = False
|
||||
print "Could not find the generated example for " + _filename + " found in " + filepath
|
||||
else:
|
||||
fh.write("%s\n" % _text)
|
||||
fh.write(unicode("%s\n" % _text))
|
||||
elif ("@END_EXAMPLE_ARANGOSH_OUTPUT" in _text or \
|
||||
"@END_EXAMPLE_ARANGOSH_RUN" in _text or \
|
||||
"@END_EXAMPLE_AQL" in _text):
|
||||
shouldIgnoreLine = False
|
||||
else:
|
||||
fh.write("\n")
|
||||
fh.write(unicode("\n"))
|
||||
fh.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
errorsFile = open("../../lib/Basics/errors.dat", "r")
|
||||
commentsFile = open("allComments.txt", "w")
|
||||
commentsFile.write("@startDocuBlock errorCodes \n")
|
||||
errorsFile = io.open("../../lib/Basics/errors.dat", "r", encoding="utf-8", newline=None)
|
||||
commentsFile = io.open("allComments.txt", "w", encoding="utf-8", newline="")
|
||||
commentsFile.write(unicode("@startDocuBlock errorCodes \n"))
|
||||
for line in errorsFile:
|
||||
commentsFile.write(line + "\n")
|
||||
commentsFile.write("@endDocuBlock \n")
|
||||
commentsFile.write(unicode(line + "\n"))
|
||||
commentsFile.write(unicode("@endDocuBlock \n"))
|
||||
commentsFile.close()
|
||||
errorsFile.close()
|
||||
for i in searchPaths:
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
def walk_on_files(dirpath, newVersionNumber):
|
||||
for root, dirs, files in os.walk(dirpath):
|
||||
for file in files:
|
||||
if file.endswith(".html"):
|
||||
full_path= os.path.join(root, file)
|
||||
replaceCode(full_path, newVersionNumber)
|
||||
return
|
||||
|
||||
def replaceCode(pathOfFile, newVersionNumber):
|
||||
f=open(pathOfFile,"rU")
|
||||
if f:
|
||||
lines=f.read()
|
||||
f.close()
|
||||
f=open(pathOfFile,'w')
|
||||
#lines = lines.replace("!CHAPTER","#")
|
||||
lines = re.sub("!CHAPTER\s+" + "(.*)", r"<h1>\g<1></h1>", lines)
|
||||
#lines = lines.replace("!SECTION","##")
|
||||
lines = re.sub("!SECTION\s+" + "(.*)", r"<h2>\g<1></h2>", lines)
|
||||
#lines = lines.replace("!SUBSECTION","###")
|
||||
lines = re.sub("!SUBSECTION\s+" + "(.*)", r"<h3>\g<1></h3>", lines)
|
||||
#lines = lines.replace("!SUBSUBSECTION","####")
|
||||
lines = re.sub("!SUBSUBSECTION\s+" + "(.*)", r"<h4>\g<1></h4>", lines)
|
||||
lines = lines.replace("VERSION_NUMBER", newVersionNumber)
|
||||
f.write(lines)
|
||||
f.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
path = ["Documentation/Books/books/Manual"]
|
||||
g = open(os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, "ArangoDB/../../VERSION")))
|
||||
if g:
|
||||
newVersionNumber=g.read()
|
||||
g.close
|
||||
for i in path:
|
||||
dirpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir,"ArangoDB/../../"+i))
|
||||
print "Tagging deprecated files"
|
||||
walk_on_files(dirpath, newVersionNumber)
|
|
@ -2,7 +2,8 @@ import sys
|
|||
import re
|
||||
import os
|
||||
import json
|
||||
|
||||
import io
|
||||
import shutil
|
||||
|
||||
RESET = '\033[0m'
|
||||
def make_std_color(No):
|
||||
|
@ -344,6 +345,8 @@ have_RESTREPLYBODY = re.compile(r"@RESTREPLYBODY")
|
|||
have_RESTSTRUCT = re.compile(r"@RESTSTRUCT")
|
||||
remove_MULTICR = re.compile(r'\n\n\n*')
|
||||
|
||||
RXIMAGES = re.compile(r".*\!\[([\d\s\w\/\. ()-]*)\]\(([\d\s\w\/\.-]*)\).*")
|
||||
|
||||
def _mkdir_recursive(path):
|
||||
sub_path = os.path.dirname(path)
|
||||
if not os.path.exists(sub_path):
|
||||
|
@ -478,20 +481,20 @@ def walk_on_files(inDirPath, outDirPath):
|
|||
for file in files:
|
||||
if file.endswith(".md") and not file.endswith("SUMMARY.md"):
|
||||
count += 1
|
||||
inFileFull = os.path.join(root, file)
|
||||
outFileFull = os.path.join(outDirPath, inFileFull)
|
||||
nextInFileFull = os.path.join(root, file)
|
||||
nextOutFileFull = os.path.join(outDirPath, nextInFileFull)
|
||||
if fileFilter != None:
|
||||
if fileFilter.match(inFileFull) == None:
|
||||
if fileFilter.match(nextInFileFull) == None:
|
||||
skipped += 1
|
||||
# print "Skipping %s -> %s" % (inFileFull, outFileFull)
|
||||
continue;
|
||||
# print "%s -> %s" % (inFileFull, outFileFull)
|
||||
print "%s -> %s" % (nextInFileFull, nextOutFileFull)
|
||||
_mkdir_recursive(os.path.join(outDirPath, root))
|
||||
findStartCode(inFileFull, outFileFull)
|
||||
findStartCode(nextInFileFull, nextOutFileFull, inDirPath)
|
||||
print STD_COLOR + "Processed %d files, skipped %d" % (count, skipped) + RESET
|
||||
|
||||
def findStartCode(inFileFull, outFileFull):
|
||||
inFD = open(inFileFull, "r")
|
||||
def findStartCode(inFileFull, outFileFull, baseInPath):
|
||||
inFD = io.open(inFileFull, "r", encoding="utf-8", newline=None)
|
||||
textFile = inFD.read()
|
||||
inFD.close()
|
||||
#print "-" * 80
|
||||
|
@ -519,7 +522,32 @@ def findStartCode(inFileFull, outFileFull):
|
|||
raise
|
||||
#print "9" * 80
|
||||
#print textFile
|
||||
outFD = open(outFileFull, "w")
|
||||
|
||||
def analyzeImages(m):
|
||||
imageLink = m.groups()[1]
|
||||
inf = os.path.realpath(os.path.join(os.path.dirname(inFileFull), imageLink))
|
||||
outf = os.path.realpath(os.path.join(os.path.dirname(outFileFull), imageLink))
|
||||
bookDir = os.path.realpath(baseInPath)
|
||||
depth = len(inFileFull.split(os.sep)) - 1 # filename + book directory
|
||||
assets = os.path.join((".." + os.sep)*depth, baseInPath, "assets")
|
||||
# print(inf, outf, bookDir, depth, assets)
|
||||
|
||||
outdir = os.path.dirname(outf)
|
||||
if not os.path.exists(outdir):
|
||||
_mkdir_recursive(outdir)
|
||||
if os.path.commonprefix([inf, bookDir]) != bookDir:
|
||||
assetDir = os.path.join(outdir, assets)
|
||||
if not os.path.exists(assetDir):
|
||||
os.mkdir(assetDir)
|
||||
outf=os.path.join(assetDir, os.path.basename(imageLink))
|
||||
imageLink = os.path.join((".." + os.sep)* (depth - 1), "assets",os.path.basename(imageLink))
|
||||
|
||||
if not os.path.exists(outf):
|
||||
shutil.copy(inf, outf)
|
||||
return str('![' + m.groups()[0] + '](' + imageLink + ')')
|
||||
|
||||
textFile = re.sub(RXIMAGES,analyzeImages, textFile)
|
||||
outFD = io.open(outFileFull, "w", encoding="utf-8", newline="")
|
||||
outFD.write(textFile)
|
||||
outFD.close()
|
||||
#JSF_put_api_replication_synchronize
|
||||
|
@ -605,7 +633,7 @@ def readNextLine(line):
|
|||
|
||||
def loadDokuBlocks():
|
||||
state = STATE_SEARCH_START
|
||||
f=open("allComments.txt", 'rU')
|
||||
f = io.open("allComments.txt", "r", encoding="utf-8", newline=None)
|
||||
count = 0
|
||||
for line in f.readlines():
|
||||
if state == STATE_SEARCH_START:
|
||||
|
@ -684,7 +712,7 @@ def loadProgramOptionBlocks():
|
|||
output = []
|
||||
|
||||
# Load program options dump and convert to Python object
|
||||
with open(programOptionsDump, 'r') as fp:
|
||||
with io.open(programOptionsDump, 'r', encoding='utf-8', newline=None) as fp:
|
||||
try:
|
||||
optionsRaw = json.load(fp)
|
||||
except ValueError as err:
|
||||
|
@ -759,7 +787,7 @@ if __name__ == '__main__':
|
|||
if len(sys.argv) > 5 and sys.argv[5].strip() != '':
|
||||
print STD_COLOR + "filtering Docublocks: " + sys.argv[5] + RESET
|
||||
blockFilter = re.compile(sys.argv[5])
|
||||
f=open(swaggerJson, 'rU')
|
||||
f = io.open(swaggerJson, 'r', encoding='utf-8', newline=None)
|
||||
swagger= json.load(f)
|
||||
f.close()
|
||||
loadDokuBlocks()
|
||||
|
|
Loading…
Reference in New Issue