Skip to content

Commit f822473

Browse files
committed
Update bower components to get support for DTS stage
1 parent 62b7d91 commit f822473

File tree

15 files changed

+409
-74
lines changed

15 files changed

+409
-74
lines changed
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "cxx-html-doc-framework",
3-
"version": "0.2.1",
43
"description": "A set of custom HTML elements to make writing well-formatted C++ papers and ISO documents easier.",
54
"main": "framework.html",
65
"homepage": "https://github.com/cplusplus/html-doc-framework",
@@ -15,14 +14,13 @@
1514
"polymer": "Polymer/polymer#0.2.4",
1615
"core-ajax": "Polymer/core-ajax#0.2.4"
1716
},
18-
"_release": "0.2.1",
17+
"_release": "8044bdba33",
1918
"_resolution": {
20-
"type": "version",
21-
"tag": "0.2.1",
22-
"commit": "f567d595dd091a3584b77c44829af37809605ee5"
19+
"type": "commit",
20+
"commit": "8044bdba330e9c22060f7bfe084f2c108f988c3d"
2321
},
24-
"_source": "git://github.com/cplusplus/html-doc-framework.git",
25-
"_target": "~0.2.1",
26-
"_originalSource": "cplusplus/html-doc-framework",
22+
"_source": "git@github.com:jaredhoberock/html-doc-framework.git",
23+
"_target": "8044bdba330e9c22060f7bfe084f2c108f988c3d",
24+
"_originalSource": "[email protected]:jaredhoberock/html-doc-framework",
2725
"_direct": true
2826
}

bower_components/cxx-html-doc-framework/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ Wraps the title page of an ISO document. The title page takes a
5252
them) `CD`, `DTS`, `TS`, etc. The title page recognizes several
5353
nested elements that describe the document.
5454

55+
#### `<cxx-project-number>`
56+
57+
The ISO project number for this TS or IS. Find this on https://isocpp.org/std/status.
58+
5559
#### `<cxx-docnum>`
5660

5761
The D or N number for the document.
@@ -94,14 +98,20 @@ number, and formats and links the `id`.
9498
### `<cxx-ednote>`
9599

96100
An editor's note that won't appear in the final published document.
97-
This is formatted as a separate box on the side of the document.
101+
This is formatted as a separate box on the side of the document,
102+
unless it's marked with class="para", in which case it's formatted as a normal paragraph in a box.
98103

99104

100105
### `<cxx-email>`
101106

102107
Must contain an email address as text, and wraps it into an
103108
appropriate `mailto:` link.
104109

110+
### `<w-br>`
111+
112+
Introduces a soft line-break inside an otherwise-nowrap context. This works in
113+
Firefox and Prince, where <wbr> fails, in addition to other browsers.
114+
105115
### `<cxx-function>`
106116

107117
Describes a C++ library function. Several nested elements help

bower_components/cxx-html-doc-framework/base.css

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ limitations under the License.
2020
@bottom-left { content: string(current-section, last); font-size: 10pt; }
2121
@bottom-right { content: counter(page); font-size: 10pt; }
2222
}
23-
cxx-titlepage { page: title; page-break-after: always; }
24-
@page title {
23+
@page :first {
2524
@top-left { content: "© ISO 2014 — All rights reserved"; }
2625
@top-right { content: normal; }
2726
@bottom-left { content: normal; }
2827
@bottom-right { content: normal; }
2928
}
3029

30+
body { margin: 0; }
31+
3132
@media screen {
3233
body { max-width: 7in;
3334
/* Make room for paragraph numbers. */
@@ -65,6 +66,8 @@ cxx-toc::shadow h1 { bookmark-level: 2; }
6566
cxx-clause h1 { bookmark-level: 2; }
6667
cxx-clause cxx-section h1 { bookmark-level: 3; }
6768
cxx-clause cxx-section cxx-section h1 { bookmark-level: 4; }
69+
/* The <h2> is a subtitle, which shouldn't get a PDF bookmark. */
70+
cxx-titlepage::shadow h2 { bookmark-level: none; }
6871

6972
*::shadow .section-number { string-set: current-section "§ " content(); }
7073

@@ -83,6 +86,28 @@ pre {
8386
margin-bottom: .5em;
8487
}
8588

89+
* /deep/ wbr::after {
90+
white-space: normal;
91+
content: '\200B';
92+
}
93+
* /deep/ code {
94+
/* Make inline code avoid line wraps unless we override it with <wbr>. */
95+
white-space: nowrap;
96+
}
97+
* /deep/ pre code {
98+
/* Keep block-code wrapping according to its context. */
99+
white-space: inherit;
100+
}
101+
102+
* /deep/ table {
103+
border-collapse: collapse;
104+
}
105+
* /deep/ td, th {
106+
padding-left: .2em;
107+
padding-right: .2em;
108+
border: thin solid black;
109+
}
110+
86111
/* Use an em-dash for the list bullet.
87112
'print' is a proxy for supporting ::marker. */
88113
@media screen {
@@ -101,6 +126,9 @@ pre {
101126
ul li::marker {
102127
content: "\2014";
103128
}
129+
[is=cxx-table].list ul li::marker {
130+
content: none;
131+
}
104132
}
105133

106134
/* This is here rather than inside elements/toc.html because browsers

bower_components/cxx-html-doc-framework/bower.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "cxx-html-doc-framework",
3-
"version": "0.2.1",
43
"description": "A set of custom HTML elements to make writing well-formatted C++ papers and ISO documents easier.",
54
"main": "framework.html",
65
"homepage": "https://github.com/cplusplus/html-doc-framework",

bower_components/cxx-html-doc-framework/ednote.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
<template>
1818
<style>
1919
:host { display: block; }
20+
:host-context(body.cxx-pdts) { display: none; }
2021
aside { float: right; max-width: 40%;
2122
margin: 1ex;
2223
border: 1px dashed #888;
2324
padding: 1ex;
2425
background-color: #eee; }
26+
:host(.para) aside { float: none; max-width: none; }
2527
</style>
2628
<aside><strong>Editor's note:</strong> <content></content></aside>
2729
</template>

bower_components/cxx-html-doc-framework/figure.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<style>
2323
:host { margin-left: auto; margin-right: auto; }
2424
figcaption { white-space: nowrap; text-align: center; }
25-
/* @polyfill figcaption figcaption */
25+
polyfill-next-selector { content: 'figcaption figcaption' }
2626
::content figcaption { display: inline; }
2727

2828
</style>

bower_components/cxx-html-doc-framework/framework.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
<link rel="import" href="range.html"/>
4040
<link rel="import" href="codeblock.html"/>
4141
<link rel="import" href="grammar.html"/>
42+
<link rel="import" href="weak-break.html"/>

bower_components/cxx-html-doc-framework/function.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
:host {display:block; margin-top: .5em; margin-bottom: .5em;}
4141
dt { float: left; font-style: italic; font-weight: normal; padding-right: 1ex;}
4242
dd { margin-left: 0em; }
43-
/* @polyfill dd > ul, dd > ol */
43+
polyfill-next-selector { content: 'dd > ul, dd > ol' }
4444
::content > ul, ::content > ol { clear: left; }
4545
</style>
4646
<dt>{{heading}}:</dt><dd><content></content></dd>

bower_components/cxx-html-doc-framework/publish.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
limitations under the License.
1414
-->
1515

16-
<!-- This element creates a button that creates a standalone HTML version of
17-
the current page in a new window so you can save it.
18-
This will only work with the ShadowDOM polyfill, since you can't create
19-
ShadowDOM without script.
16+
<!-- This element creates a button that creates a link to a standalone HTML
17+
version of the current page.
18+
19+
This will only work with the ShadowDOM polyfill, but we'll eventually
20+
implement support for native ShadowDOM.
2021
2122
If the 'source' attribute is present, a "Sources at ..." comment
2223
will appear at the top of the result document.
@@ -26,7 +27,16 @@
2627
<style>
2728
:host {display: block;}
2829
</style>
29-
<button on-click="{{publish}}">Publish to new window</button>
30+
<template if="{{ !flattenedBlob }}">
31+
<button on-click="{{publish}}" disabled?="{{ publishing }}">Publish</button>
32+
</template>
33+
<template if="{{ flattenedBlob }}">
34+
<p>Published:</p>
35+
<ul>
36+
<li><a href="{{ flattenedBlob }}">Flattened document</a></li>
37+
<li><a href="{{ sectionIndex }}">Section index, in json suitable for &lt;cxx-foreign-index></a></li>
38+
</ul>
39+
</template>
3040
</template>
3141
<script src="publish.js"></script>
3242
</polymer-element>

bower_components/cxx-html-doc-framework/publish.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,47 @@ limitations under the License.
139139
});
140140
}
141141

142+
function buildSectionIndex(doc) {
143+
var result = {};
144+
doc.querySelectorAll('cxx-clause,cxx-section').array().forEach(function(section) {
145+
if (!section.id) {
146+
console.warn(section, 'is missing its id.');
147+
return;
148+
}
149+
if (!section.sec_num || section.sec_num == '?') {
150+
console.warn(section, 'is missing its number');
151+
return;
152+
}
153+
result[section.id] = section.sec_num;
154+
});
155+
return result;
156+
}
157+
142158
Polymer('cxx-publish-button', {
159+
publishing: false,
160+
flattenedBlob: null,
143161
publish: function() {
162+
if (this.publishing) {
163+
return;
164+
}
165+
this.publishing = true;
144166
var copyPromise = cloneStaticAndInline(document);
145167
var source = '';
146168
if (this.source) {
147-
var source = '<!-- Sources at ' + this.source + ' -->\n';
169+
source = '<!-- Sources at ' + this.source + ' -->\n';
148170
}
171+
var sectionIndex = buildSectionIndex(document);
149172
copyPromise.then(function(copy) {
150173
var published = new Blob(['<!DOCTYPE html>\n',
151174
source,
152175
copy.documentElement.outerHTML],
153176
{type: 'text/html'});
154-
window.open(URL.createObjectURL(published), '_blank');
155-
});
156-
}
177+
this.flattenedBlob = URL.createObjectURL(published);
178+
this.sectionIndex = encodeURI('data:application/json,' + JSON.stringify(sectionIndex));
179+
}.bind(this)).catch(function(e) {
180+
console.error(e);
181+
this.publishing = false;
182+
}.bind(this));
183+
},
157184
});
158185
})();

0 commit comments

Comments
 (0)