Skip to content

Commit

Permalink
Add custom header to hide status in generated HTML
Browse files Browse the repository at this point in the history
Add a custom HTML header for use in the generated HTML version of the
document. This allows us to:
1. not display a Status -- status isn't something we've typically used in
   TUF and the options available to us in bikeshed don't quite fit our use
2. display the specification version more prominently in the sub-heading,
   alongside the last modified date

Signed-off-by: Joshua Lock <[email protected]>
  • Loading branch information
joshuagl committed Jan 22, 2021
1 parent c5354b8 commit 3fa355b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ SHELL=/bin/bash -o pipefail
.PHONY: local

local: tuf-spec.md
bikeshed spec tuf-spec.md tuf-spec.html --md-Text-Macro="COMMIT-SHA LOCAL COPY"
bikeshed spec tuf-spec.md tuf-spec.html
2 changes: 1 addition & 1 deletion check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
LAST_MODIFIED_PATTERN = "Date: %Y-%m-%d\n"
LAST_MODIFIED_LINENO = 6

VERSION_PATTERN = r"^Version: \*\*(\d*)\.(\d*)\.(\d*)\*\*$"
VERSION_PATTERN = r"^Text Macro: VERSION (\d*)\.(\d*)\.(\d*)$"
VERSION_LINENO = 19

class SpecError(Exception):
Expand Down
25 changes: 25 additions & 0 deletions header.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>[TITLE]</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<style data-fill-with="stylesheet">
</style>
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"></p>
<h1 id="title" class="p-name no-ref">[TITLE]</h1>
<h2 id="subtitle" class="no-num no-toc no-ref"> Version: [VERSION] <br/>
Last modified: <time class="dt-updated" datetime="[ISODATE]">[DATE]</time></h2>
<div data-fill-with="spec-metadata"></div>
<div data-fill-with="warning"></div>
<p class='copyright' data-fill-with='copyright'></p>
<hr title="Separator for header">
</div>

<div data-fill-with="at-risk"></div>

<nav data-fill-with="table-of-contents" id="toc"></nav>
<main>
7 changes: 4 additions & 3 deletions tuf-spec.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<pre class='metadata'>
Title: The Update Framework Specification
Shortname: TUF
Status: LS-COMMIT
Status: LS
Abstract: A framework for securing software update systems.
Date: 2020-12-11
Editor: Justin Cappos, NYU
Expand All @@ -13,11 +13,12 @@ Repository: theupdateframework/specification
Mailing List: https://groups.google.com/forum/?fromgroups#!forum/theupdateframework
Indent: 2
Boilerplate: copyright no, conformance no
Local Boilerplate: header yes
Markup Shorthands: css no, markdown yes
Metadata Include: This version off, Abstract off
Text Macro: VERSION 1.0.17
</pre>

Version: **1.0.17**

We strive to make the specification easy to implement, so if you come across
any inconsistencies or experience any difficulty, do let us know by sending an
email to our [mailing
Expand Down

0 comments on commit 3fa355b

Please sign in to comment.