summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-01-21 13:27:26 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-01-21 13:27:26 +0100
commit95a9578ab7d3b5437c41372b41fe6db8983ae8bf (patch)
tree353c88d7be5598b1bd460d8bbf9f9d488c40f06b /Makefile
parentf33c190c8c66dd6017a1ac221a3238cd29f639e1 (diff)
Distribute highlight.js with our documentation.
- For C code fragments, we use the highlight.js highlighter to apply syntax highlighting. Previously, highlight.js was only used in the FFI documentation, and was loaded from a CDN. - We now distribute highlight.js with our documentation. This is done in the 'doc' make target. - This helps to protect the privacy of users viewing the documentation. - Unfortunately, highlighting no longer works when viewing the documentation locally in a browser using the file:// scheme.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 3 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6d83e0e5..78a2748f 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,6 @@ CARGO_TARGET_DIR ?= $(shell pwd)/target
CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
# The tests to run.
CARGO_TEST_ARGS ?= --all
-FFI_RUSTDOCFLAGS ?= --html-in-header ffi/rustdoc.head.html
# Signing source distributions.
SIGN_WITH ?= XXXXXXXXXXXXXXXX
@@ -62,13 +61,10 @@ examples:
# Documentation.
.PHONY: doc
doc:
+ RUSTDOCFLAGS="$$RUSTDOCFLAGS --html-in-header doc/highlight.js/9.12.0/inc.html" \
CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
- $(CARGO) doc $(CARGO_FLAGS) --no-deps --all
- env RUSTDOCFLAGS="$(FFI_RUSTDOCFLAGS)" \
- CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
- $(CARGO) doc $(CARGO_FLAGS) --no-deps \
- --package sequoia-ffi \
- --package sequoia-openpgp-ffi
+ $(CARGO) doc $(CARGO_FLAGS) --no-deps --all
+ cp --recursive doc/highlight.js $(CARGO_TARGET_DIR)/doc
.PHONY: deploy-doc
deploy-doc: doc