WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.04k stars 166 forks source link

Links go to inconsistent places #2316

Closed rtoy closed 3 years ago

rtoy commented 3 years ago

Describe the issue

Go to https://webaudio.github.io/web-audio-api/#AudioContext. The section heading has a link for "AudioContext". Click it. This takes you to https://webaudio.github.io/web-audio-api/#audiocontext, the IDL definition for AudioContext. This also happens for OfflineAudioContext and others.

Now visit https://webaudio.github.io/web-audio-api/#audionode, and click on the "AudioNode" link in the section heading. This doesn't take you to the IDL for AudioNode.

Not sure what is the right behavior here. It is kind of convenient if the link takes you to the IDL for the node.

padenot commented 3 years ago

A simple case of missing interface and lt attributes on h3.

skratchdot commented 3 years ago

Yeah- on our call I was just seeing:

<h3 class="heading settled" data-level="1.2" id="AudioContext" />

and later:

<dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export="" id="audiocontext" />

But I misread what was going on for the "AudioNode". I feel like there are some inconsistencies in the markup in our index.bs file.

I have a commit that might standardize the markup for the interfaces, but I need to generate the index.html and do some "double checking":

https://github.com/skratchdot/web-audio-api/commit/4865c0b348c06f338627ec15bc575596758e780e

rtoy commented 3 years ago

If you create a pull request to this repo, you should get a preview/diff automatically generated so you can see if your changes look right; you don't need to install bikeshed. (Installing bikeshed is much easier these days.) Bikeshed also has a web service that you can use. However, both of these are missing some important things (because the include files aren't uploaded). Fortunately, your changes don't modify those things.

skratchdot commented 3 years ago

If you create a pull request to this repo, you should get a preview/diff automatically generated so you can see if your changes look right; you don't need to install bikeshed. (Installing bikeshed is much easier these days.) Bikeshed also has a web service that you can use. However, both of these are missing some important things (because the include files aren't uploaded). Fortunately, your changes don't modify those things.

Yeah- I just updated my gh-pages branch and found out:

If we want the behavior of AudioContext, then all the h3 nodes should look like:

<h3 id="NameOfInterface">

If we want them to work like AudioNode, then all the h3 nodes should like like:

<h3 interface lt="NameOfInterface">
skratchdot commented 3 years ago

It seems like when you add the interface and lt attributes, you loose the "hot linking to the idl" for some reason. I need to read up about what the lt attribute does. EDIT: it's "linking text": https://tabatkins.github.io/bikeshed/#dfn-contract

skratchdot commented 3 years ago

I wrote a little script that writes the h3 tags to a "standard format": https://github.com/skratchdot/web-audio-api/blob/gh-pages/index-with.sh

(obviously we wouldn't check that file into the repo- but i wanted to check it in to show you).

Here are the behaviors:

<h3 id="NameOfInterface">: https://projects.skratchdot.com/web-audio-api/index-with-id.html

https://projects.skratchdot.com/web-audio-api/index-with-id.html#AudioContext https://projects.skratchdot.com/web-audio-api/index-with-id.html#audiocontext https://projects.skratchdot.com/web-audio-api/index-with-id.html#AudioNode https://projects.skratchdot.com/web-audio-api/index-with-id.html#audionode

<h3 interface lt="NameOfInterface">: https://projects.skratchdot.com/web-audio-api/index-with-lt.html

https://projects.skratchdot.com/web-audio-api/index-with-lt.html#AudioContext https://projects.skratchdot.com/web-audio-api/index-with-lt.html#audiocontext https://projects.skratchdot.com/web-audio-api/index-with-lt.html#AudioNode https://projects.skratchdot.com/web-audio-api/index-with-lt.html#audionode

padenot commented 3 years ago

The "with id" seem more useful maybe ? The "with lt" does nothing with CamelCase hashes.

skratchdot commented 3 years ago

Okay. I think I figured out a way to have all the id/lt/interface attributes and the functionality of the "with id" version.

I updated the script to generate 2 new "types": https://github.com/skratchdot/web-audio-api/blob/68c3ca0689d95e6a61aa5f90e569ff5e1e62494a/index-with.sh#L19-L32

<h3 interface lt="NameOfInterface" id="NameOfInterface">: https://projects.skratchdot.com/web-audio-api/index-with-both.html

https://projects.skratchdot.com/web-audio-api/index-with-both.html#AudioContext https://projects.skratchdot.com/web-audio-api/index-with-both.html#audiocontext https://projects.skratchdot.com/web-audio-api/index-with-both.html#AudioNode https://projects.skratchdot.com/web-audio-api/index-with-both.html#audionode

<h3 interface lt="nameofinterface" id="NameOfInterface">: https://projects.skratchdot.com/web-audio-api/index-with-both-lcase.html

https://projects.skratchdot.com/web-audio-api/index-with-both-lcase.html#AudioContext https://projects.skratchdot.com/web-audio-api/index-with-both-lcase.html#audiocontext https://projects.skratchdot.com/web-audio-api/index-with-both-lcase.html#AudioNode https://projects.skratchdot.com/web-audio-api/index-with-both-lcase.html#audionode

So perhaps the "with both lcase" variant is the best to go with :shrug:

I'll submit a PR just in case. Feel free to close it or ask for changes/edits.

rtoy commented 3 years ago

"with both lcase" looks good. Not sure what "both lcase" means, though. The id is camel case, and the lt is lower case.

The current spec is kind of funny since every node already has a self link to the left of the heading, so having the node go to itself is not as useful as going to the corresponding IDL for the node.

skratchdot commented 3 years ago

"with both lcase" looks good. Not sure what "both lcase" means, though. The id is camel case, and the lt is lower case.

the naming i came up was not very good. i should've stuck with numbers or something :) i just meant it has "both the id and lt attributes, and the lt attribute's value is lowercase".