1
0
Fork 0

make examples is history now.

This commit is contained in:
Wilfried Goesgens 2016-02-10 11:21:08 +01:00
parent 3b12dc0c32
commit d2f8021d8e
3 changed files with 12 additions and 54 deletions

View File

@ -50,55 +50,6 @@ swagger:
@srcdir@/Documentation/DocuBlocks/Rest/ \
) > @srcdir@/js/apps/system/_admin/aardvark/APP/api-docs.json
## -----------------------------------------------------------------------------
## --SECTION-- EXAMPLES
## -----------------------------------------------------------------------------
################################################################################
### @brief generate examples
################################################################################
.PHONY: examples
examples:
@rm -f /tmp/arangodb.examples
rm -rf @srcdir@/Documentation/Books/ppbooks
python @srcdir@/Documentation/Scripts/generateExamples.py \
--outputDir @builddir@/Documentation/Examples \
--onlyThisOne "$(FILTER_EXAMPLE)" \
--outputFile /tmp/arangosh.examples.js \
--arangoshSetup @srcdir@/Documentation/Examples/setup-arangosh.js \
@srcdir@/Documentation/DocuBlocks \
@srcdir@/Documentation/Books/Users
if test -z "$(server.endpoint)"; then \
$(MAKE) start-server PID=$(PID) \
SERVER_START="--server.endpoint tcp://$(VOCHOST):$(VOCPORT) --server.disable-authentication true" \
PROTO=http ;\
@builddir@/bin/arangosh \
-s \
-c @srcdir@/etc/relative/arangosh.conf \
--server.password "" \
--server.endpoint tcp://$(VOCHOST):$(VOCPORT) \
--javascript.execute /tmp/arangosh.examples.js ;\
else \
@builddir@/bin/arangosh \
-s \
-c @srcdir@/etc/relative/arangosh.conf \
--server.password "" \
--server.endpoint $(server.endpoint) \
--javascript.execute /tmp/arangosh.examples.js ;\
fi
examples-inspect-file:
@echo "generating /tmp/allExamples.html"
@(printf "<html><head></head><body><pre>\n"; \
for thisExample in Documentation/Examples/*.generated; do \
printf "<hr>\n<h3>$$thisExample</h3>\n"; \
cat $$thisExample; \
done; \
printf "</pre></body></html>") > /tmp/allExamples.html
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------

View File

@ -0,0 +1,8 @@
#!/bin/sh
echo "generating /tmp/allExamples.html"
(printf "<html><head></head><body><pre>\n";
for thisExample in Documentation/Examples/*.generated; do
printf "<hr>\n<h3>$thisExample</h3>\n";
cat $thisExample;
done;
printf "</pre></body></html>") > /tmp/allExamples.html

View File

@ -447,18 +447,17 @@ Where to add new...
generate
--------
- `make examples` - on top level to generate Documentation/Examples
- `make examples FILTER_EXAMPLE=geoIndexSelect` will only produce one example - *geoIndexSelect*
- `make examples FILTER_EXAMPLE='MOD.*'` will only produce the examples matching that regex; Note that
- `./scripts/generateExamples --onlyThisOne geoIndexSelect` will only produce one example - *geoIndexSelect*
- `./scripts/generateExamples --onlyThisOne 'MOD.*'` will only produce the examples matching that regex; Note that
examples with enumerations in their name may base on others in their series - so you should generate the whole group.
- `make examples server.endpoint=tcp://127.0.0.1:8529` will utilize an existing arangod instead of starting a new one.
- `./scripts/generateExamples --server.endpoint tcp://127.0.0.1:8529` will utilize an existing arangod instead of starting a new one.
this does seriously cut down the execution time.
- alternatively you can use generateExamples (i.e. on windows since the make target is not portable) like that:
`./scripts/generateExamples
--server.endpoint 'tcp://127.0.0.1:8529'
--withPython 3rdParty/V8-4.3.61/third_party/python_26/python26.exe
--onlyThisOne 'MOD.*'`
- `make examples-inspect-file` generates a file where you can inspect all examples for readability.
- `./Documentation/Scripts/allExamples.sh` generates a file where you can inspect all examples for readability.
- `make swagger` - on top level to generate the documentation interactively with the server; you may use
[the swagger editor](https://github.com/swagger-api/swagger-editor) to revalidate whether
*js/apps/system/_admin/aardvark/APP/api-docs.json* is accurate.