aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2018-10-17 15:50:18 +0200
committerClément Bénier <clement.benier@iot.bzh>2018-10-18 11:33:03 +0200
commitf0e40ed5a98495c7beba475c552cd449c9ee3498 (patch)
tree1824e600c2677640fbb37cf2b37dc0191c59049a
parent4fc602d4b47811b3b00f07124e27d51b1a9e997a (diff)
docs-agl conformity: make it working as docs-agl
Makefile: - add rules to clone doctools - add dependencies on doctools for each rule - add distclean rule to remove doctools repo docs.json: - add doctools section with url and version fetch.yml: - change fetching for former docs-agl source, it is now in docs-source repo Change-Id: I0f9c5c8b3cbf46cfd280f9db7fbe80a925460062 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rw-r--r--.gitignore1
-rw-r--r--Makefile40
-rw-r--r--content/tocs/apis_services/fetched_files.yml10
-rw-r--r--content/tocs/architecture/fetched_files.yml2
-rw-r--r--content/tocs/getting_started/fetched_files.yml8
-rw-r--r--docs.json6
6 files changed, 46 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index 8f0ac43..8f6dcc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ site/_data/all-pages.yml
site/_data/tocs
.fetch.ts
.LocalFetch.ts
+doctools
diff --git a/Makefile b/Makefile
index 21faf08..c1acae2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,35 @@
-DOCBUILD=../doctools/webdocs/docbuild
+DOCTOOLS=doctools
+DOCBUILD=$(DOCTOOLS)/docbuild
VERBOSE=--verbose
FETCHTS=.fetch.ts
LOCALFETCH=.LocalFetch.ts
+define GetFromConfig
+$(shell node -p "require('./docs.json').$(1)")
+endef
+
+DOCTOOLSREPO := $(call GetFromConfig,doctools.url)
+DOCTOOLSBRANCH := $(call GetFromConfig,doctools.version)
+
all: help
-help:
+help:
@echo "Usage:"
+ @echo "- make distclean: clean all generated files and repos"
@echo "- make clean: clean all generated files"
+ @echo "- make doctools: clone doctools repository"
@echo "- make fetch: fetch the site if necessary"
@echo "- make localFetch: fetch the site if necessary but use local file."
@echo "- make build: build the site"
@echo "- make push: push the built site"
@echo "- make serve: serve the site"
+.PHONY: distclean
+distclean: clean
+ rm -fr $(DOCTOOLS)
+
.PHONY: clean
clean:
$(DOCBUILD) $(VERBOSE) --clean
@@ -31,23 +45,29 @@ $(FETCHTS): $(wildcard content/toc/*/fetched_files.yml)
$(DOCBUILD) $(VERBOSE) $(LOCAL_FETCHTS) --fetch --force
touch $@
+prebuild:
+ @node -v && [ $$? -eq 0 ] || (echo "Please, make sure nodejs is installed" && false)
+ @jekyll -v && [ $$? -eq 0 ] || (echo "Please, make sure jekyll is installed" && false)
+
+.PHONY: doctools
+doctools: prebuild
+ echo $(DOCTOOLSREPO)
+ @test ! -d $(DOCTOOLS) && git clone -b $(DOCTOOLSBRANCH) $(DOCTOOLSREPO) $(DOCTOOLS) || true
+ @cd $(DOCTOOLS) && npm install
+
.PHONY: fetch
-fetch: $(FETCHTS)
+fetch: doctools $(FETCHTS)
@echo "Fetched files up to date."
-.PHONY: localFetch
-localFetch: $(LOCALFETCH) $(FETCHTS)
- @echo "Fetched files up to date and copy local file."
-
.PHONY: build
-build: $(FETCHTS)
+build: doctools $(FETCHTS)
$(DOCBUILD) $(VERBOSE) --build
.PHONY: push
-push: $(FETCHTS)
+push: doctools $(FETCHTS)
$(DOCBUILD) $(VERBOSE) --build --push
.PHONY: serve
-serve: $(FETCHTS)
+serve: doctools $(FETCHTS)
$(DOCBUILD) $(VERBOSE) --build --serve
diff --git a/content/tocs/apis_services/fetched_files.yml b/content/tocs/apis_services/fetched_files.yml
index 8f162ea..dec6e3f 100644
--- a/content/tocs/apis_services/fetched_files.yml
+++ b/content/tocs/apis_services/fetched_files.yml
@@ -251,8 +251,7 @@ repositories:
-
url_fetch: AGL_GITHUB_FETCH
- url_edit: AGL_GITHUB_EDIT
- git_name: "%project_source%/docs-agl"
+ git_name: "automotive-grade-linux/docs-sources"
git_commit: "AGL_GITHUB_BRANCH"
src_prefix: docs/app-framework
dst_prefix: af-binder
@@ -262,8 +261,7 @@ repositories:
label: Resources
-
url_fetch: AGL_GITHUB_FETCH
- url_edit: AGL_GITHUB_EDIT
- git_name: "%project_source%/docs-agl"
+ git_name: "automotive-grade-linux/docs-sources"
git_commit: "AGL_GITHUB_BRANCH"
src_prefix: docs/signaling
dst_prefix: signaling
@@ -290,7 +288,7 @@ repositories:
-
url_fetch: AGL_GITHUB_FETCH
url_edit: AGL_GITHUB_EDIT
- git_name: "%project_source%/docs-agl"
+ git_name: "automotive-grade-linux/docs-sources"
git_commit: "AGL_GITHUB_BRANCH"
src_prefix: docs/audio
dst_prefix: audio
@@ -333,7 +331,7 @@ repositories:
label: HALs
- source: high-level-api/TipsAndTricks/images/changeSound.png
- source: high-level-api/TipsAndTricks/images/MixerBaseMenu.png
--
+-
url_fetch: "GERRIT_FETCH"
git_name: apps/agl-service-homescreen-2017
git_commit: "master"
diff --git a/content/tocs/architecture/fetched_files.yml b/content/tocs/architecture/fetched_files.yml
index 8d36057..80fb3e9 100644
--- a/content/tocs/architecture/fetched_files.yml
+++ b/content/tocs/architecture/fetched_files.yml
@@ -51,7 +51,7 @@ repositories:
- source: agl_spec_v1.0_final.pdf
-
- git_name : "%project_source%/docs-agl"
+ git_name : "automotive-grade-linux/docs-sources"
src_prefix : docs/security-blueprint
dst_prefix: security
documents:
diff --git a/content/tocs/getting_started/fetched_files.yml b/content/tocs/getting_started/fetched_files.yml
index 0273923..0819215 100644
--- a/content/tocs/getting_started/fetched_files.yml
+++ b/content/tocs/getting_started/fetched_files.yml
@@ -23,7 +23,7 @@
# ------------------------------------
# url: "GERRIT_FETCH"
# git_commit: "master"
-# repositories:
+# repositories:
# -
# git_name: src/foo
# src_prefix: docs
@@ -42,9 +42,9 @@ url_edit : "AGL_GITHUB_EDIT"
git_commit : "AGL_GITHUB_BRANCH"
#dst_prefix : # destination_path = destination_prefix + (document.destination || document.source)
-repositories:
--
- git_name : "%project_source%/docs-agl"
+repositories:
+-
+ git_name : "automotive-grade-linux/docs-sources"
src_prefix : docs/getting-started
documents :
- source: source-code.md
diff --git a/docs.json b/docs.json
new file mode 100644
index 0000000..89a1930
--- /dev/null
+++ b/docs.json
@@ -0,0 +1,6 @@
+{
+ "doctools": {
+ "url": "https://github.com/automotive-grade-linux/docs-tools.git",
+ "version": "master"
+ }
+}