From 2a573f9caee04038edbbea31fc2a9df519acb1e1 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Thu, 27 Jul 2017 11:14:35 -0700 Subject: [PATCH 1/8] Add a prototype for asciidoc --- prototypes/prototype.adoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 prototypes/prototype.adoc diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc new file mode 100644 index 00000000..f298d104 --- /dev/null +++ b/prototypes/prototype.adoc @@ -0,0 +1,18 @@ +:author: Han Solo ; Frodo Baggins +:revremark: State: predraft + +:showtitle: +:toc: left +:numbered: +:icons: font + +//// + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + + Copyright 2017 +//// + + +# RFD From 13930a72b07e22be066b9cde36c7990872c18ef0 Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Thu, 27 Jul 2017 19:17:49 -0700 Subject: [PATCH 2/8] Revise the prototype asciidoc to match latest thinking. Chase @tRent's change in 390ccb4f339172eda4671812989c4ef61f04ea43. --- prototypes/prototype.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index f298d104..bbad1b8a 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -1,5 +1,6 @@ :author: Han Solo <han@example.com>; Frodo Baggins <frodo@example.com> -:revremark: State: predraft +:state: predraft +:revremark: State: {state} :showtitle: :toc: left @@ -14,5 +15,4 @@ Copyright 2017 <contribution> //// - # RFD <Number> <Title> From 3322f1aa1f23a0ff27993af9c7871c707898a191 Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Sat, 29 Jul 2017 17:09:23 -0700 Subject: [PATCH 3/8] Update asciidoc prototype to include both the desired front-matter and attributes. h/t to @jclulow for pointing the [`skip-front-matter`](http://asciidoctor.org/docs/user-manual/#front-matter-added-for-static-site-generators) attribute. --- prototypes/prototype.adoc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index bbad1b8a..3d07b507 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -1,11 +1,23 @@ +--- +authors: Han Solo <han@example.com>, Frodo Baggins <frodo@example.com> +state: predraft +--- :author: Han Solo <han@example.com>; Frodo Baggins <frodo@example.com> :state: predraft :revremark: State: {state} - +:docinfo: +:doctype: article +:icons: font +:idprefix: +:numbered: +:sectanchors: +:sectlinks: +:sectnums: +:sectnumlevels: 2 :showtitle: +:source-highlighter: pygments +:skip-front-matter: :toc: left -:numbered: -:icons: font //// This Source Code Form is subject to the terms of the Mozilla Public From 7bb02904f48f2cc800a9044df9743e0bb31036ec Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Sat, 29 Jul 2017 17:22:33 -0700 Subject: [PATCH 4/8] Remove the `skip-front-matter` attribute, add a stub section. The `skip-front-matter` attribute can only be passed in via the CLI: ```sh $ asciidoctor --attribute=skip-front-matter ... ``` --- prototypes/prototype.adoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index 3d07b507..e3562b62 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -2,6 +2,7 @@ authors: Han Solo <han@example.com>, Frodo Baggins <frodo@example.com> state: predraft --- += RFD <NUMBER> <Title> :author: Han Solo <han@example.com>; Frodo Baggins <frodo@example.com> :state: predraft :revremark: State: {state} @@ -16,7 +17,6 @@ state: predraft :sectnumlevels: 2 :showtitle: :source-highlighter: pygments -:skip-front-matter: :toc: left //// @@ -27,4 +27,5 @@ state: predraft Copyright 2017 <contribution> //// -# RFD <Number> <Title> +[[introduction]] +== Introduction From 3b3de51a64c4c8316522ca7efdb2883039fb688b Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Sat, 29 Jul 2017 17:39:06 -0700 Subject: [PATCH 5/8] Warn when an undefined attribute is referenced. Brought to you by: future self asking, "WTF isn't this the default behavior?" --- prototypes/prototype.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index e3562b62..f66f88f6 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -6,6 +6,7 @@ state: predraft :author: Han Solo <han@example.com>; Frodo Baggins <frodo@example.com> :state: predraft :revremark: State: {state} +:attribute-missing: warn :docinfo: :doctype: article :icons: font From ed62689a5df60dc05743ff2e0d689566d69361c4 Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Sun, 30 Jul 2017 03:27:16 -0700 Subject: [PATCH 6/8] Add keywords and a revnumber to the asciidoc prototype --- prototypes/prototype.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index f66f88f6..e869cd17 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -9,9 +9,13 @@ state: predraft :attribute-missing: warn :docinfo: :doctype: article +:hide-uri-scheme: :icons: font :idprefix: +:idseparator: - +:keywords: rfd, rfd <NUMBER, prototype, sample, keywords :numbered: +:revnumber: 0.1.0 :sectanchors: :sectlinks: :sectnums: @@ -19,6 +23,7 @@ state: predraft :showtitle: :source-highlighter: pygments :toc: left +:xrefstyle: full //// This Source Code Form is subject to the terms of the Mozilla Public From da40ee7ef363c2484569c200b2b830ad19f4a4bd Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Sun, 30 Jul 2017 04:10:17 -0700 Subject: [PATCH 7/8] Fix admonition icons when rendering on Github RFD's are going to need their own ghpages branch and joyent.github.io/rfd/rfd*.html needs to be a thing otherwise this won't render well by default. This is a start, and it improves the state of the world. --- prototypes/prototype.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index e869cd17..1cde4119 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -24,6 +24,13 @@ state: predraft :source-highlighter: pygments :toc: left :xrefstyle: full +ifdef::env-github[] +:tip-caption: :bulb: +:note-caption: :information_source: +:important-caption: :heavy_exclamation_mark: +:caution-caption: :fire: +:warning-caption: :warning: +endif::[] //// This Source Code Form is subject to the terms of the Mozilla Public From 4e5beb27b66e721df8b87c734c8e4de8affe55df Mon Sep 17 00:00:00 2001 From: Sean Chittenden <sean@chittenden.org> Date: Mon, 31 Jul 2017 21:11:07 -0700 Subject: [PATCH 8/8] Use the `include` macro to move the asciidoc front-matter to an external file. --- prototypes/front-matter.adoc | 24 ++++++++++++++++++++++++ prototypes/prototype.adoc | 27 ++------------------------- 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 prototypes/front-matter.adoc diff --git a/prototypes/front-matter.adoc b/prototypes/front-matter.adoc new file mode 100644 index 00000000..6b396c9e --- /dev/null +++ b/prototypes/front-matter.adoc @@ -0,0 +1,24 @@ +:revremark: State: {state} +:attribute-missing: warn +:docinfo: +:doctype: article +:hide-uri-scheme: +:icons: font +:idprefix: +:idseparator: - +:numbered: +:sectanchors: +:sectlinks: +:sectnums: +:sectnumlevels: 1 +:showtitle: +:source-highlighter: pygments +:toc: left +:xrefstyle: full +ifdef::env-github[] +:tip-caption: :bulb: +:note-caption: :information_source: +:important-caption: :heavy_exclamation_mark: +:caution-caption: :fire: +:warning-caption: :warning: +endif::[] diff --git a/prototypes/prototype.adoc b/prototypes/prototype.adoc index 1cde4119..d0295964 100644 --- a/prototypes/prototype.adoc +++ b/prototypes/prototype.adoc @@ -5,32 +5,9 @@ state: predraft = RFD <NUMBER> <Title> :author: Han Solo <han@example.com>; Frodo Baggins <frodo@example.com> :state: predraft -:revremark: State: {state} -:attribute-missing: warn -:docinfo: -:doctype: article -:hide-uri-scheme: -:icons: font -:idprefix: -:idseparator: - -:keywords: rfd, rfd <NUMBER, prototype, sample, keywords -:numbered: :revnumber: 0.1.0 -:sectanchors: -:sectlinks: -:sectnums: -:sectnumlevels: 2 -:showtitle: -:source-highlighter: pygments -:toc: left -:xrefstyle: full -ifdef::env-github[] -:tip-caption: :bulb: -:note-caption: :information_source: -:important-caption: :heavy_exclamation_mark: -:caution-caption: :fire: -:warning-caption: :warning: -endif::[] +:keywords: rfd <NUMBER>, prototype, sample, keywords +include::front-matter.adoc[] //// This Source Code Form is subject to the terms of the Mozilla Public