Skip to content

Commit

Permalink
v3.9.2: Don't emit ECMA-style title boilerplate unless stage or versi…
Browse files Browse the repository at this point in the history
…on are specified.
  • Loading branch information
bterlson committed Dec 19, 2016
1 parent 9903196 commit 5e2f57c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ecmarkup",
"version": "3.9.1",
"version": "3.9.2",
"description": "Custom element definitions and core utilities for markup that specifies ECMAScript and related technologies.",
"main": "lib/ecmarkup.js",
"typings": "lib/ecmarkup.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions spec/index.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<!doctype html>
<meta charset="utf8">
<title>Ecmarkup</title>
<script src="ecmarkup.js"></script>
<link rel="stylesheet" href="elements.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/solarized_light.min.css">
<pre class=metadata>
repository: https://github.com/bterlson/ecmarkup
assets: none
copyright: false
title: Ecmarkup Specification
</pre>
<emu-biblio href="./biblio.json"></emu-biblio>
<h1>Ecmarkup Documentation</h1>
<emu-intro id="intro">
<h1>Introduction</h1>
<p><a href="https://github.com/bterlson/ecmarkup">Ecmarkup</a> is a number of custom elements and a toolchain suitable for formally specifying semantics for ECMAScript proposals.</p>
Expand Down
12 changes: 6 additions & 6 deletions src/Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,8 @@ export default class Spec {
this.opts.date = new Date();
}

if (this.opts.stage) {
if (this.opts.stage != undefined) {
this.opts.stage = String(this.opts.stage);
} else if (this.opts.status === 'proposal') {
this.opts.stage = '0';
} else {
this.opts.stage = null;
}

if (!this.opts.location) {
Expand Down Expand Up @@ -404,7 +400,7 @@ export default class Spec {
const title = this.opts.title;
const shortname = this.opts.shortname;
const stage = this.opts.stage;

if (this.opts.copyright) {
if (status !== 'draft' && status !== 'standard' && !this.opts.contributors) {
utils.logWarning('Contributors not specified, skipping copyright boilerplate. Specify contributors in your frontmatter metadata.');
Expand All @@ -428,6 +424,10 @@ export default class Spec {
this.doc.body.insertBefore(h1, this.doc.body.firstChild);
}

if (version == undefined && stage == undefined) {
return;
}

// version string, ala 6th Edition July 2016 or Draft 10 / September 26, 2015
let versionText = '';
if (version) {
Expand Down
2 changes: 1 addition & 1 deletion test/date.html.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<head><meta charset="utf-8"><title>test title!</title></head><body><div id="spec-container"><h1 class="version">July 2014</h1><h1 class="title">test title!</h1>
<head><meta charset="utf-8"><title>test title!</title></head><body><div id="spec-container"><h1 class="title">test title!</h1>

<p>Some body content</p>

Expand Down
1 change: 1 addition & 0 deletions test/proposal-copyright.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
toc: false
date: 2014-09-26
assets: none
stage: 0
contributors: Brian Terlson, Ecma International
</pre>

0 comments on commit 5e2f57c

Please sign in to comment.