diff --git a/index.html b/index.html index 3bf846d..55745ac 100644 --- a/index.html +++ b/index.html @@ -66,14 +66,36 @@ ], postProcess: [ () => { - // relabel each principle, and lose the numbering, delabel principle summary - for (let label of document.querySelectorAll('div.practice > a.marker > bdi, #bp-summary > ul > li > a.marker > bdi')) { - label.textContent = 'Principle'; + // Remove the nested Best Practices Summary header. + document.querySelector('#best-practices-summary > div.header-wrapper').remove(); + const bpSummarySection = document.querySelector('#best-practices-summary'); + bpSummarySection.replaceWith(...bpSummarySection.children); + document.querySelector('ol:not(:has(ol)):has(a[href="#best-practices-summary"])').remove(); + // Renumber principles by their sections. + const principleSections = new Set(); + for (let label of document.querySelectorAll('div.practice > a.marker > bdi')) { + principleSections.add(label.closest('section:has(bdi.secno)')); } - // I hate markdown + for (const section of principleSections) { + const principleLabels = section.querySelectorAll('div.practice > a.marker > bdi'); + let index = 1; + for (const label of principleLabels) { + let labelText = `Principle ${section.querySelector('bdi.secno').textContent.trim()}` + if (principleLabels.length > 1) { + labelText += `.${index}`; + index++; + } + label.textContent = labelText; + const linkTarget = label.closest('div').querySelector('span.practicelab').id; + document.querySelector(`#bp-summary > ul > li > a.marker[href='#${linkTarget}'] > bdi`) + .textContent = labelText; + } + } + // Remove empty

s. for (let p of document.querySelectorAll('div.practice > p')) { if (/^\s*$/.test(p.textContent)) p.remove(); } + // Add audience chips. const audienceNames = { websites: 'websites', 'user-agents': 'user agents', @@ -100,9 +122,6 @@ }); prac.append(audDiv); } - for (let el of document.querySelectorAll('#bp-summary h2, #toc a[href="#bp-summary"]')) { - el.innerHTML = el.innerHTML.replace('Best Practices Summary', 'Principles Summary'); - } } ], localBiblio: { @@ -538,6 +557,14 @@ .audience-websites { background-color: gold; } .audience-user-agents { background-color: mediumspringgreen; } .audience-api-designers { background-color: mistyrose; } + + ul:has(#include-websites) li { list-style:none } + + /* Show summary principles if their audience is selected. */ + #bp-summary li:has(.practicelab) { display: none } + #bp-summary ul:has(#include-websites:checked) + ul li:has(.audience-websites) { display: list-item; } + #bp-summary ul:has(#include-user-agents:checked) + ul li:has(.audience-user-agents) { display: list-item; } + #bp-summary ul:has(#include-api-designers:checked) + ul li:has(.audience-api-designers) { display: list-item; } @@ -627,6 +654,21 @@ +

+ +## List of Principles {#principle-list} + +This section is a list of all the privacy principles, +with links to their longer explanations in the rest of the document. + +Which audiences should be included? + +* +* +* + +
+ # An Introduction to Privacy on the Web {#intro} This is a document containing technical guidelines. However, in order to put those guidelines in context we @@ -2351,8 +2393,6 @@ -
-
# Conformance