Comments (6)
Ah, you even reference that functionality already. Cool then, yeah, I could definitely extend this to function args.
from bikeshed.
For posterity: I can confirm that I do see the desired diagnostic errors using this style if there's a name mismatch.
interface FooInterface {
readonly attribute DOMString? fooAttr;
};
dictionary BarDictionary {
required DOMString? barMember;
};
And either
<dl dfn-type=attribute dfn-for=FooInterface>
<dt><dfn>fooAttr</dfn>
<dd>...
</dl>
<dl dfn-type=dict-member dfn-for=BarDictionary>
<dt><dfn>barMember</dfn>
<dd>...
</dl>
or
* <dfn attribute for=FooInterface>fooAttr</dfn>
<span data-attribute-info for="FooInterface/fooAttr"></span> ...
* <dfn dict-member for=BarDictionary>barMember</dfn>
<span data-dict-member-info for="BarDictionary/barMember"></span> ...
(Feature creep: support putting data-info
on the <dfn>
itself to get the content appended, to avoid repetition.)
from bikeshed.
Yeah, I'm open to having more than one rendering option here. We could stick with a table, but have the descriptions take up an entire second row underneath each entry, or render as a dl similar to what you're doing manually right now. Feel free to explore what markup you might want, and I'll see what I can do about it. (Not for a bit, tho - I'm busy this week and on vacation next week.)
from bikeshed.
Hmm, tho also, I already have support for doing this sort of auto-checking/filling with dls if you're referencing attributes (or dict members), like you can do:
<dl dfn-type=attribute dfn-for=Foo>
: <dfn>bar</dfn>
:: Description of Foo.bar
...
</dl>
and your dt
will automatically get the type, whether it's readonly or nullable, and its default value.
I don't see why I couldn't extend this to method arguments, too.
from bikeshed.
The WG preferred <UL>
styling over <DL>
and <TABLE>
. So adding a function arg variant like data-attribute-info
and data-dict-member-info
would be the minimal change and let us control the presentation rather than having to bake it into Bikeshed.
But I should see if <span data-attribute-info for="FooInterface/fooAttr"></span>
emits errors if there's no match, as that's an important part of maintainability...
from bikeshed.
If it doesn't I can fix that.
from bikeshed.
Related Issues (20)
- Option to omit spec's status HOT 2
- Improper deduping when for values have different casing, and anchor is from anchor block HOT 4
- Printed examples are illegible HOT 1
- MDN boxes obscure text when printed HOT 2
- Generate a "Changes" section from commit history HOT 1
- ability to embed external files HOT 5
- Document diff mode
- [Diff mode] Allow clicking on variables that are in modified text
- Markdown table support HOT 1
- Strange rendering/scrollable IDL boxes HOT 14
- Make the list of w3c groups easier to maintain / update HOT 2
- Incorrect "This Version" link when using fully qualified Status HOT 1
- text macro in metadata definition does not work correctly
- Detect broken automatic internal links when definition changes
- Lint to avoid putting newlines in links or variables HOT 2
- backticks don't work inside of the link text HOT 1
- Curly apostrophes not consistent HOT 1
- Tracking-vector image should be marked darkmode-aware HOT 1
- Inference of `function` type and functional `type`
- Ref-hints are broken in the dark theme HOT 2
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 bikeshed.