From 1c15fe67c72b4591feaceeffec0951e34a6c2e46 Mon Sep 17 00:00:00 2001 From: clsr Date: Fri, 18 Aug 2017 14:08:04 +0200 Subject: Initial commit --- templates/content.html | 97 ++++++++++++++++++++++++++++++++++++++++++ templates/page.html | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 templates/content.html create mode 100644 templates/page.html (limited to 'templates') diff --git a/templates/content.html b/templates/content.html new file mode 100644 index 0000000..73f18c7 --- /dev/null +++ b/templates/content.html @@ -0,0 +1,97 @@ +{{- if eq .Name "section" "content" -}} +{{- if .Title}} +
+ {{- inc .Title -}} + + {{- with .Title -}} + {{- if $l := lanchor -}} + {{.}}ΒΆ + {{- if $s := sanchor}}{{if ne $s $l}}{{end}}{{end -}} + + {{- end -}} + {{- end -}} + + {{- range .Children -}} + {{- template "content.html" . -}} + {{- end -}} + {{- dec -}} +
+{{else -}} +{{- range .Children -}} + {{- template "content.html" . -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- if eq .Name "list" -}} +{{if .Ordered}} + {{- range .Children -}} + {{- if eq .Name "list" -}} + {{- template "content.html" . -}} + {{- else -}} +
  • {{- template "content.html" . -}}
  • + {{- end -}} + {{- end -}} +{{- if .Ordered}}{{else}}{{end -}} +{{- end -}} + +{{- if eq .Name "table" -}} + + {{- range .Rows -}} + {{- template "content.html" . -}} + {{- end -}} +
    +{{- end -}} + +{{- if eq .Name "header" -}} + + {{- range .Children -}} + {{template "content.html" .}} + {{- end -}} + +{{- end -}} + +{{- if eq .Name "row" -}} + + {{- range .Children -}} + {{template "content.html" .}} + {{- end -}} + +{{- end -}} + +{{- if eq .Name "embed" -}} +
    + {{- if eq .Type "image/png" "image/jpeg" "image/webp" "image/*" -}} + {{with .Description}}{{.}}{{else}}embedded {{.Type}}{{end}} + {{- end -}} + {{- if eq .Type "video/mp4" "video/webm" "video/*" -}} + + {{- end -}} + {{- if not (eq .Type "image/png" "image/jpeg" "image/webp" "image/*" "video/mp4" "video/webm" "video/*") -}} +

    + Embedded {{.Type}} content: {{.URL}} +

    + {{- end -}} + {{- with .Description}}
    {{.}}
    {{end -}} +
    +{{- end -}} + +{{- if eq .Name "text" -}} + {{- if eq .Format "" "plain"}}{{range .Contents.Paragraphs -}} +

    {{.}}

    + {{- end}}{{end -}} + {{- if eq .Format "fmt" -}} + {{- range .Contents.Paragraphs -}} + {{- cnmfmt . -}} + {{- end -}} + {{- end -}} + {{- if not (eq .Format "" "plain" "fmt") -}} +
    {{.Contents.Text}}
    + {{- end -}} +{{- end -}} + +{{- if eq .Name "raw" -}} +
    {{.Contents}}
    +{{- end -}} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..0f89e2d --- /dev/null +++ b/templates/page.html @@ -0,0 +1,112 @@ + + + + + + {{with .Doc.Title}}{{.}}{{else}} {{end}} + + + + {{if .Highlight}}{{end}} + + +
    + {{if .Browser -}} +
    + + +
    + {{- end}} + + {{with .Doc.Title}}

    {{.}}

    {{end -}} + + {{with .Doc.Links -}} + + {{- end -}} + + {{with .Site -}} + + {{- end -}} + + {{if .Toc.Children -}} + + {{- end}} +
    + +
    + {{- with .Doc.Content}} + {{- range .Children}} + {{- template "content.html" .}} + {{- end}}{{end}} +
    + + + + {{if .Highlight}} + {{end}} + + -- cgit