WICG / WICG/webmonetization

Format rest of specs

Open
#686 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

specification
Dominant language
HTML
Stars
607
Forks
166
Avg merge
2d 7h
Merged PRs (30d)
7

Description

In https://github.com/WICG/webmonetization/commit/cbb2bee6d98750d959fc068b5b7fb10b7e2d42dc I added a format command for the Web Monetization spec. This does not yet include the Extension API spec, or the Flows spec.

These specs use includes, which are a bit tricky with tidy-html. In the end we want all index.html and includes to be formatted accordingly. The only way to somewhat format the includes was to add the following tidyconfig options:

omit-optional-tags: yes
doctype: omit

With this, it does not add a full HTML skeleton to the includes, however, that has issues that will need to be solved:

  • We need to decide if omitting optional end tags is something we are okay with (we for example use quite a lot of p tags)
  • tidyhtml adds an empty <title> to each include, which we don't want
  • There is a bug in the media-example.html include if we apply formatting. For audio and video tags the link tag is a child node. For picture it gets moved out.
<picture srcset="cat.jpeg" onmonetization="sayThanks(this)"></picture>
<link rel="monetization" href="https://example.com/images/pay">

--

WIP branch: https://github.com/MichaelKohler/webmonetization/tree/wip-format-specs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the format command from commit cbb2bee6d98750d959fc068b5b7fb10b7e2d42dc and the WIP branch, then inspect the Extension API and Flows specs, their index.html files, and includes. Check the tidyconfig options and media-example.html behavior before deciding how optional tags and empty titles should be handled. Done means all index.html files and includes are formatted without the incorrect picture/link structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.