Move templating into scripts dir

There's no real need for this to be at the top level.
This commit is contained in:
Richard van der Hoff 2017-11-08 08:37:56 +00:00
parent d9285cf5b5
commit a38d4fc68e
18 changed files with 17 additions and 18 deletions

View file

@ -28,8 +28,6 @@ Structure of this repository
- ``scripts``: scripts to generate formatted versions of the - ``scripts``: scripts to generate formatted versions of the
documentation, typically HTML. documentation, typically HTML.
- ``specification``: the specification split up into sections. - ``specification``: the specification split up into sections.
- ``templating``: the templates and templating system used to
generate the spec.
.. _OpenAPI: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md .. _OpenAPI: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
.. _JSON Schema: http://json-schema.org/ .. _JSON Schema: http://json-schema.org/

View file

@ -52,7 +52,7 @@ func main() {
walker := makeWalker(dir, w) walker := makeWalker(dir, w)
paths := []string{"api", "changelogs", "event-schemas", "scripts", paths := []string{"api", "changelogs", "event-schemas", "scripts",
"specification", "templating"} "specification"}
for _, p := range paths { for _, p := range paths {
filepath.Walk(path.Join(dir, p), walker) filepath.Walk(path.Join(dir, p), walker)

View file

@ -30,7 +30,7 @@ import yaml
scripts_dir = os.path.dirname(os.path.abspath(__file__)) scripts_dir = os.path.dirname(os.path.abspath(__file__))
templating_dir = os.path.join(os.path.dirname(scripts_dir), "templating") templating_dir = os.path.join(scripts_dir, "templating")
api_dir = os.path.join(os.path.dirname(scripts_dir), "api") api_dir = os.path.join(os.path.dirname(scripts_dir), "api")
sys.path.insert(0, templating_dir) sys.path.insert(0, templating_dir)

View file

@ -273,7 +273,7 @@ def addAnchors(path):
def run_through_template(input_files, set_verbose, substitutions): def run_through_template(input_files, set_verbose, substitutions):
args = [ args = [
'python', 'build.py', 'python', script_dir+'/templating/build.py',
"-o", tmp_dir, "-o", tmp_dir,
"-i", "matrix_templates", "-i", "matrix_templates",
] ]
@ -288,10 +288,7 @@ def run_through_template(input_files, set_verbose, substitutions):
log("EXEC: %s" % " ".join(args)) log("EXEC: %s" % " ".join(args))
log(" ==== build.py output ==== ") log(" ==== build.py output ==== ")
subprocess.check_call( subprocess.check_call(args)
args,
cwd=os.path.join(docs_dir, "templating"),
)
""" """
Extract and resolve groups for the given target in the given targets listing. Extract and resolve groups for the given target in the given targets listing.

View file

@ -25,23 +25,27 @@ from collections import OrderedDict
import logging import logging
import json import json
import os import os
import os.path
import re import re
import subprocess import subprocess
import sys import sys
import urllib import urllib
import yaml import yaml
matrix_doc_dir=reduce(lambda acc,_: os.path.dirname(acc),
range(1, 5), os.path.abspath(__file__))
HTTP_APIS = { HTTP_APIS = {
"../api/application-service": "as", os.path.join(matrix_doc_dir, "api/application-service"): "as",
"../api/client-server": "cs", os.path.join(matrix_doc_dir, "api/client-server"): "cs",
"../api/identity": "is", os.path.join(matrix_doc_dir, "api/identity"): "is",
"../api/push-gateway": "push", os.path.join(matrix_doc_dir, "api/push-gateway"): "push",
} }
EVENT_EXAMPLES = "../event-schemas/examples" EVENT_EXAMPLES = os.path.join(matrix_doc_dir, "event-schemas/examples")
EVENT_SCHEMA = "../event-schemas/schema" EVENT_SCHEMA = os.path.join(matrix_doc_dir, "event-schemas/schema")
CORE_EVENT_SCHEMA = "../event-schemas/schema/core-event-schema" CORE_EVENT_SCHEMA = os.path.join(matrix_doc_dir, "event-schemas/schema/core-event-schema")
CHANGELOG_DIR = "../changelogs" CHANGELOG_DIR = os.path.join(matrix_doc_dir, "changelogs")
TARGETS = "../specification/targets.yaml" TARGETS = os.path.join(matrix_doc_dir, "specification/targets.yaml")
ROOM_EVENT = "core-event-schema/room_event.yaml" ROOM_EVENT = "core-event-schema/room_event.yaml"
STATE_EVENT = "core-event-schema/state_event.yaml" STATE_EVENT = "core-event-schema/state_event.yaml"