Permalink
Browse files

version: include version in produced docs (#406)

Fixes #398

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
  • Loading branch information...
1 parent 9630bf7 commit 4941dba4a85cf61114e9fa7944212fc009d5522c @vbatts vbatts committed May 2, 2016
Showing with 30 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +25 −0 .tool/version-doc.go
  3. +4 −0 Makefile
View
@@ -1,3 +1,4 @@
output
schema/validate
code-of-conduct.md
+version.md
View
@@ -0,0 +1,25 @@
+// +build ignore
+
+package main
+
+import (
+ "fmt"
+ "html/template"
+ "os"
+
+ "github.com/opencontainers/runtime-spec/specs-go"
+)
+
+var markdownTemplateString = `
+
+**Specification Version:** *{{.}}*
+
+`
+
+var markdownTemplate = template.Must(template.New("markdown").Parse(markdownTemplateString))
+
+func main() {
+ if err := markdownTemplate.Execute(os.Stdout, specs.Version); err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ }
+}
View
@@ -2,6 +2,7 @@
DOCKER ?= $(shell which docker)
# These docs are in an order that determines how they show up in the PDF/HTML docs.
DOC_FILES := \
+ version.md \
README.md \
code-of-conduct.md \
principles.md \
@@ -45,6 +46,9 @@ output/docs.html: $(DOC_FILES)
code-of-conduct.md:
curl -o $@ https://raw.githubusercontent.com/opencontainers/tob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md
+version.md: ./specs-go/version.go
+ go run ./.tool/version-doc.go > $@
+
HOST_GOLANG_VERSION = $(shell go version | cut -d ' ' -f3 | cut -c 3-)
# this variable is used like a function. First arg is the minimum version, Second arg is the version to be checked.
ALLOWED_GO_VERSION = $(shell test '$(shell /bin/echo -e "$(1)\n$(2)" | sort -V | head -n1)' == '$(1)' && echo 'true')

0 comments on commit 4941dba

Please sign in to comment.