Comments (9)
Idea: use sed
to perform a series of replacements on source
. Then generate a new single-page copy from that. I think that should work for Commit Snapshots and Review Drafts. And it's pretty easy.
I think it should work for @tobie's whatpr work too.
from html-build.
FWIW, it seems reasonably doable in bash, but the newline situation is rather painful (not finished):
HTML_FAKE_SHA="alalaladjfkasd234j33242"
INPUT="source"
OUTPUT="new-source"
sed -e 's/<h2 id="living-standard" class="no-num no-toc">Living Standard/<h2 id="living-standard" class="no-num no-toc">Commit Snapshot/' \
-e "s/^ <title w-nodev>HTML Standard/ <title w-nodev>HTML Standard (Commit Snapshot $HTML_FAKE_SHA)/" \
-e 's/^ <h2 class="no-num no-toc" id="contents" w-nosplit w-nodev>Full table of contents<\/h2>/ <div data-fill-with="warning">\'$'\n'' <details class="annoying-warning" open=""><summary>This Is a Commit Snapshot of the Standard<\/summary>\'$'\n'" <p>This document contains the contents of the standard as of the <a href=\"https:\/\/github.com\/whatwg\/html\/commit\/$HTML_FAKE_SHA\">$HTML_FAKE_SHA commit<\/a>, and should only be used as a historical reference. This commit may not even have been merged into master.<\/p><p> Do not attempt to implement this version of the specification. Do not reference this version as authoritative in any way. Instead, see <a href=\"https:\/\/url.spec.whatwg.org\/\">https:\/\/url.spec.whatwg.org\/<\/a> for the living standard.<\/p><\/details><\/div><h2 class=\"no-num no-toc\" id=\"contents\" w-nosplit w-nodev>Full table of contents<\/h2>/" \
< "$INPUT" > "$OUTPUT"
diff -up "$INPUT" "$OUTPUT"
from html-build.
The reason I somewhat favor this over instructions to Wattsi is because the latter is build around the no-html/no-dev notion, which seem mutually exclusive? And Pascal is somewhat trickier to deal with than some replacements.
from html-build.
I don't think they're mutually exclusive; we have w-nosplit and w-nohtml, and the multipage versions are both "html" and "split" at the same time. We'd want to introduce a new type of thing, maybe w-noliving...
I think that might be technically nicer in a few ways, but in the end it's up to the person doing the work, and you've already made good progress.
from html-build.
Wattsi generates all the variants by default so I guess we'll have to modify it either way. 😟
A snapshot could indeed be generated alongside dev/ and multipage/. A Review Draft would be trickier. We'd basically need a new way to invoke Wattsi to make it only produce that for a given input.
In html/
I guess we'd have a similar review.sh
script that generates review-drafts/05-2018.wattsi
or some such? And whenever we process that we'd invoke wattsi
in such a way to only generate a singlepage.
from html-build.
My various WIP PRs against html/html-build/wattsi address 1-4 from OP. 5-6 are a little tricky due to HTML's unusual heading at the top. I'd prefer we address those in a follow-up.
from html-build.
So am I correct that addressing 5-6 would be adding some links to the HTML source and letting wattsi take care of putting the right data in them? And given that we already pass on the SHA wattsi wouldn't necessarily need API changes so this shouldn't affect whatpr, right?
from html-build.
That sounds about right, yeah. Although I'm not sure we pass the SHA to Wattsi vs. doing it at some other step?
from html-build.
LMK if there's any changes I need to make on the PR PReview side.
from html-build.
Related Issues (20)
- curls inside build.sh should retry a couple times
- Update highlighter once it updates widlparser
- Build does not fail on invalid Web IDL HOT 5
- Review Drafts have MDN in them; they should not HOT 2
- --password warning HOT 2
- MDN boxes sometimes have multiple entries for the same browser HOT 3
- Remove caniuse boxes in favor of MDN compat data boxes? HOT 9
- Build failing, potentially Python? HOT 2
- Migrate to Python 3 HOT 2
- Use Docker Hub pdfsizeopt instead of downloading from GitHub
- Document why macOS cannot do HTTP/2 by default HOT 2
- Consider a "fast mode" for local iteration HOT 3
- .pre-process-main.pl can be simplified or rolled into Wattsi HOT 2
- Add service worker support
- html-build repo is missing License text file
- "Improvements to the CI Docker build" broken PDF links HOT 1
- `.cache` folder is not created by `build.sh` HOT 1
- Docker build fails on M1 MacBook HOT 5
- Build failing locally when trying to send to server HOT 1
- Local build doesn't catch HTML parsing errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-build.