GithubHelp home page GithubHelp logo

Comments (9)

annevk avatar annevk commented on June 15, 2024

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.

annevk avatar annevk commented on June 15, 2024

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.

annevk avatar annevk commented on June 15, 2024

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.

domenic avatar domenic commented on June 15, 2024

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.

annevk avatar annevk commented on June 15, 2024

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.

annevk avatar annevk commented on June 15, 2024

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.

annevk avatar annevk commented on June 15, 2024

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.

domenic avatar domenic commented on June 15, 2024

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.

tobie avatar tobie commented on June 15, 2024

LMK if there's any changes I need to make on the PR PReview side.

from html-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.