Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(w3c/templates/cgbg-sotd): reuse renderPreview #3106

Merged
merged 1 commit into from Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 2 additions & 25 deletions src/w3c/templates/cgbg-sotd.js
@@ -1,34 +1,11 @@
// @ts-check
import { l10n, renderPublicList } from "./sotd.js";
import { l10n, renderPreview, renderPublicList } from "./sotd.js";
import { html } from "../../core/import-maps.js";

export default (conf, opts) => {
return html`
<h2>${l10n.sotd}</h2>
${conf.isPreview
? html`<details class="annoying-warning" open="">
<summary>
This is a
preview${conf.prUrl && conf.prNumber
? html`
of pull request
<a href="${conf.prUrl}">#${conf.prNumber}</a>
`
: ""}
</summary>
<p>
Do not attempt to implement this version of the specification. Do
not reference this version as authoritative in any way.
${conf.edDraftURI
? html`
Instead, see
<a href="${conf.edDraftURI}">${conf.edDraftURI}</a> for the
Editor's draft.
`
: ""}
</p>
</details>`
: ""}
${conf.isPreview ? renderPreview(conf) : ""}
<p>
This specification was published by the
<a href="${conf.wgURI}">${conf.wg}</a>. It is not a W3C Standard nor is it
Expand Down
2 changes: 1 addition & 1 deletion src/w3c/templates/sotd.js
Expand Up @@ -127,7 +127,7 @@ export default (conf, opts) => {
`;
};

function renderPreview(conf) {
export function renderPreview(conf) {
const { prUrl, prNumber, edDraftURI } = conf;
return html`<details class="annoying-warning" open="">
<summary>
Expand Down