diff --git a/scripts/md2html/md2html.js b/scripts/md2html/md2html.js
index ef95f67761..d177a5bd3c 100644
--- a/scripts/md2html/md2html.js
+++ b/scripts/md2html/md2html.js
@@ -120,7 +120,7 @@ function preface(title,options) {
preface += `
${title.split('|')[0]}
`;
preface += `Copyright © ${options.publishDate.getFullYear()} the Linux Foundation
`;
preface += `${abstract}
`;
- preface += 'The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.';
+ preface += options.intro.join('\n');
preface += '';
preface += '';
preface += 'Status of This Document
';
@@ -183,11 +183,24 @@ let inTOC = false;
let inDefs = false;
let inCodeBlock = false;
let indents = [0];
+let inIntro = false;
+argv.intro = [];
// process the markdown
for (let l in lines) {
let line = lines[l];
+ // fix version 2.0
+ if (line.startsWith('## (fka')) line = line.substring(3);
+
+ // extract Introduction section for abstract
+ if (line.startsWith('## Introduction')) { inIntro = true; line = ''; }
+ else if (line.startsWith('#')) inIntro = false;
+ else if (inIntro) {
+ argv.intro.push(line);
+ line = '';
+ }
+
// remove TOC from older spec versions, respec will generate a new one
if (line.startsWith('## Table of Contents')) inTOC = true;
else if (line.startsWith('#')) inTOC = false;
diff --git a/tests/md2html/fixtures/basic-new.html b/tests/md2html/fixtures/basic-new.html
index f9fecd4a12..d77dc5263a 100644
--- a/tests/md2html/fixtures/basic-new.html
+++ b/tests/md2html/fixtures/basic-new.html
@@ -1,4 +1,8 @@
-OpenAPI Specification v30.0.1 | Introduction, Definitions, & MoreOpenAPI Specification v30.0.1
Copyright © 3001 the Linux Foundation
What is the OpenAPI Specification?
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interface descriptions have done for lower-level programming, the OpenAPI Specification removes guesswork in calling a service.Status of This Document
The source-of-truth for this specification is the HTML file referenced above as This version.
+OpenAPI Specification v30.0.1 | Introduction, Definitions, & MoreOpenAPI Specification v30.0.1
Copyright © 3001 the Linux Foundation
What is the OpenAPI Specification?
+The contents of the Introduction section will become the abstract.
+It may contain of multiple lines.
+It may have multiple paragraphs.
+Status of This Document
The source-of-truth for this specification is the HTML file referenced above as This version.
Heading 1
Text for first chapter