-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for <emu-example>
#28
Comments
I'd suggest |
Yeah, that's better. Only two notes:
|
Maybe then |
👍 |
Sounds good, I will add this (also add a type of "todo" which I've wanted!) @caridy you have use for yet? :-P |
ah, As for
I copied that markup from 262 to try to have the proper style for 402 tables, but I'm not sure this is the right way to do it. |
btw, when cross linking to tables defined like that, I'm getting warnings like this: |
Hmm, note that |
xrefs currently only work well with clauses. The rest is tracked by #24. Yes, emu should support figures and tables natively for numbering purposes. Today tables and figures (images) are numbered separately. Is it reasonable to say figures with any table children are table figures (labeled/xref'd as "Table n", globally indexed) or otherwise just plain figures (labeled/xref'd as "Figure n", globally indexed)? |
There is ambiguity between emu-note and figure, too, I suppose. Examples could also be figures. Just to confirm, is the following rational?
|
I would argue todo is redundant with bug/issue, but don't feel strongly. I kind of like I am not sure tables and figures are in the same category as note/todo/bug/example but maybe you weren't trying to say they were. |
I was basically wondering if tables/figures are in the same category. From a pure semantic html perspective, I think all of these are "figures". I don't think todo and issue are redundant. Maybe ideally they would be but I can see not wanting to make a tracking issue on GitHub for all known WIP stuff... @domenic you would suggest |
Semantically I think most of these are And yes, that was my suggestion for tables vs. images. |
I like having custom elements for things that will have magic in them. Talked with @domenic on IRC and we came up with the following:
Both emu-aside and emu-listing support the caption attribute as well which adds a custom text after the "Figure N" part of the text. This is where you would flag a listing as informative. How's this sound? |
👏 |
The appears to conflate two independent axes: The semantics of "aside" seem right for things like 'bug/issue' and 'todo', since those are outside the main flow of the document. They're basically annotations, and it would make sense to represent them in a sidebar. However, "aside" doesn't seem right for 'note' and 'example'. Note that the HTML says:
To me, 'note' and 'example' seem like parentheticals. It makes sense that To me, the name
So an emu-listing can be informative? But you defined it as normative. Here's a counter-proposal:
Then, within each of those contexts, you can have paragraphs and figures and tables and lists, as appropriate. If you want to invent |
I can see that. But I think your axis of whether something should be visible in the final document to be a good deciding factor (and an easy rubric for authors to apply). That said...
But this doesn't easily allow for auto-numbering of specific types of normative content (table 1, figure 2, etc) so part of the feature request here is to make it easy to assemble a document with these kinds of elements. But you could have a binary attribute on emu-info called "normative" and allow a type of note, example, figure, or table. Does this seem bad to you? |
Huh? As long as the specific types of normative content are easily detectable/distinguishable, then they're easily auto-numberable. I don't see the problem.
Yes, because the whole point of E.g., I can easily imagine a 'house style' in which notes aren't numbered, but I can't imagine a style in which they aren't chunks of non-normative content. Or consider that we don't currently number paragraphs, but it's not an unreasonable style -- if it were desired, would you feel compelled to change every Other smells: Presumably, |
It's easier to add custom behavior for custom elements. Without a custom element you have to query the entire DOM. Doable but not as easy. Not a major issue.
I would say the semantics are roughly identical to figure in HTML. The attribute adds semantics relevant to emu documents.
I think most authors would consider how an element is compiled and ultimately displayed part of the semantics. I think this is reasonable.
Notes have captions (Note 1, etc.) Examples should if they don't. Still thinking more about this, just putting down my thoughts. |
Ah, I think you misunderstood my statement "We don't need an element...". I wasn't saying "We don't need custom elements for tables and figures etc". (In fact, note that I said "If you want to invent
In that case, what isn't part of the semantics? I'm inclined to think that how something is ultimately displayed is styling/presentation.
Okay, but "Note 1" and "Example 2" are entirely generated. What I meant was that notes and examples don't have an author-supplied caption (i.e., one that appears in the emu doc), whereas figures and tables do. How would you feel about a vocabulary with |
Think about it from an authors perspective. For example, a note is a non-normative explanation captioned and numbered appropriately for you.
This is what I was leaning toward. Still missing what to do with todo and bug, though :-P Are those just |
This conversation has become way too complicated. I think conflating some axes is exactly what is necessary to produce a simple, convenient, and usable model. |
Yup, and what's "appropriate" is up to the presentation style. You could have a style in which notes are always numbered, or a style in which they're never numbered, or a style (as in the current spec) in which they're sometimes numbered and sometimes not.
I'd say |
@domenic for the record, I agree. I'm trying to find a good balance, though, if possible :) I think the following vocab is pretty straight forward:
Everything except emu-note has a caption property that will fill in after the generated caption. Eg. emu-example will display with a caption of "Example 1" if no caption is provided, else "Example 1: Caption" if a caption is provided. * emu-figure may be informative if the caption allows it |
Presumably, whether a table or figure is normative depends on where it appears (same as with a paragraph or list). E.g., a table within a note is non-normative because the note itself is non-normative. But yes, in practice, most tables and figures would be normative. |
50% of the figures in es6 are informative :-P But I agree in general |
@bterlson take your proposal and replace:
and you'll have something that's simple enough to understand and use, IMO. |
Can you explain your mental model? I don't see how emu-listing type="table" is simpler than emu-table. Also people seem to have to remember that an example isn't a listing which seems unusual. |
My mental model is that there are "small textual things" (the hypothetical emu-asides) and "big blocky things" (the hypothetical emu-listing). The big blocky things need whole-document numbered sequences because they might be referred to from elsewhere in the text. They might be normative (and usually are). The small textual things are fairly incidental and self-contained, and are always non-normative. |
Since examples should be globally numbered as in latex and word (and are anyway considered listings from what I've seen) shouldn't they be an emu-listing in your model? It also doesn't seem clear that table and figure are different from note on the textual things --> blocky things scale. Some notes are multiple paragraphs while some tables are very tiny and only referenced from inside the same clause. |
If this is true, then I agree. But that would be an editorial change from ES402's usage. |
Interesting, 402 doesn't seem to ever reference examples from what I can tell. But yeah I think they should be globally indexed. Todos could be globally indexed too since it makes it easier to refer to a specific one? But anyway, separating based on whether something is globally indexed/sometimes normative or locally indexed/informative seem harder than deciding if something is part of the specification (emu-note/figure/example/table) or metadata (emu-aside). The latter seems more clear to me and less likely to change as we evolve our editorial practices. |
I think by that logic everything should be globally indexed. |
about 402 examples, yes, they should be globally numbered, but right now we are trying to produce a Hi-Fi copy of the pdf before moving on into the 3rd edition where we can correct all those details. |
I think so too. I think it matters more for things that will be globally or externally referenced which seems maybe true for todos and at least today not true for notes. That said I'm not trying to change it (at least for now?) |
Some new info: Both ISO/IEC Directives, Part 2: Rules for the structure and drafting of International Standards and ECMA's Working documents and formal documents: rules for editing and distribution mandate that examples and notes be numbered in a clause-local fashion. However, it gives basically the same justification I gave above for why tables and figures are numbered globally. It does not give rationale for why notes/examples should be numbered differently, but there you have it... for now we'll have to number them as the relevant documents say we must :-P |
Everything discussed in this thread should be present now in 2.0.0-beta4 (see here: https://github.com/bterlson/ecmarkup/releases/tag/2.0.0-beta4). I have deviated from the exact letter (though not spirit, IMO) of the metaspec for examples, which are styled similarly to figures and tables as opposed to notes. |
In ecma402, we have a lot of examples within the spec. e.g.:
Should we add something very similar to
<emu-note />
for this?The text was updated successfully, but these errors were encountered: