Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
output
schema/validate
code-of-conduct.md
version.md
25 changes: 25 additions & 0 deletions .tool/version-doc.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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')
Expand Down