Skip to content

Commit

Permalink
Merge pull request #60 from ralfhandl/1.0.0-abstract
Browse files Browse the repository at this point in the history
Use Abstract section for Abstract
  • Loading branch information
lornajane authored Oct 8, 2024
2 parents 0e3fc04 + fce71f7 commit cb8f3fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/md2html/md2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function preface(title,options) {
preface += `<h1 id="title">${title.split('|')[0]}</h1>`;
preface += `<p class="copyright">Copyright © ${options.publishDate.getFullYear()} the Linux Foundation</p>`;
preface += `<section class="notoc" id="abstract"><h2>${abstract}</h2>\n`;
preface += options.intro.join('\n');
preface += options.abstract.join('\n');
preface += '</section>';
preface += '<section class="override" id="sotd" data-max-toc="0">';
preface += '<h2>Status of This Document</h2>';
Expand Down Expand Up @@ -180,17 +180,23 @@ let inTOC = false;
let inDefs = false;
let inCodeBlock = false;
let indents = [0];
let inIntro = false;
argv.intro = [];
let inAbstract = false;
argv.abstract = [];

// process the markdown
for (let l in lines) {
let line = lines[l];

// extract Introduction section for abstract
if (line.startsWith('## Introduction')) inIntro = true;
else if (line.startsWith('#')) inIntro = false;
else if (inIntro) argv.intro.push(line);
// extract Abstract
if (line.startsWith('## Abstract')) {
inAbstract = true;
line = '';
}
else if (line.startsWith('#')) inAbstract = false;
else if (inAbstract) {
argv.abstract.push(line);
line = '';
}

// remove TOC from older spec versions, respec will generate a new one
if (line.startsWith('## Table of Contents')) inTOC = true;
Expand Down
4 changes: 4 additions & 0 deletions versions/1.0.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Overlay Specification

## Abstract

The Overlay specification defines a way of creating documents that contain information to be merged with an [[OpenAPI]] Description at some later point in time, for the purpose of updating the OpenAPI description with additional information.

## Version 1.0.0

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [BCP 14](https://tools.ietf.org/html/bcp14) [RFC2119](https://tools.ietf.org/html/rfc2119) [RFC8174](https://tools.ietf.org/html/rfc8174) when, and only when, they appear in all capitals, as shown here.
Expand Down

0 comments on commit cb8f3fc

Please sign in to comment.