-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Use semantic constructs for the author(s) and revision #3967
Comments
This is a very well-written proposal. Nice work @Mogztter! |
To accommodate multiple revisions, as an alternative to the table, we could consider enclosing each dl structure as an item in an unordered list. The dl structure represents one revision, whereas the list encapsulates all the revision entries. Another possibility is to wrap each revision entry in a div inside the dl, though I'm not sure that's in the spirit of what the WhatWG is intending. |
This issue will be addressed as part of: #242
Author(s)
When there are a more than one author, we should probably use an unordered list:
When there's only a single author, we could probably use a
<p>
element:If we want to use same structure regardless of the number of authors, then we could use a generic container like
<div class="byline">
?In the above examples, I'm using the class
byline
because it seems to be a well-established term: https://en.wikipedia.org/wiki/BylineFor reference, the Asciidoctor EPUB3 is using it: https://github.com/asciidoctor/asciidoctor-epub3/blob/3bfee503ee959119c1fe0097b1346fe49ff7fdea/lib/asciidoctor-epub3/converter.rb#L356
An author consists of a name and an optional email.
Using a
<span>
element for the author's name and a<a>
element for the author's email seem sufficient:Here are complete examples:
Email rel="author"
MDN suggests that we should add the link type "author" (
rel="author"
) on the author's email:https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types
In addition, some resources claim that contact information should be enclosed in a
<address>
element:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address
Since the email address is optional, I'm not convinded that this is actually a good idea to enclose the author in an
<address>
element when the email address is present.Author format
I think, it might be a good idea to have a dedicated method to format an author.
My understanding is that there are cultural differences and we certainly don't use the same format to display someone's name.
Furthermore, some journals might have strict styles regarding author's names, for instance:
This method would return HTML (as a string), so it would be possible to merge the email address with the author name:
Revision
Revision information includes a revision number, date, and remark.
Description list
Using a description list is one way to structure the information:
Note:
revnumber
,revdate
andrevremark
are defined on thedt
to make it easier to style.For instance, if I want to apply a custom style on the revision date:
For reference, here's how we can create an inline layout:
A nice benefit is that the revision information are "naturally" enclosed inside a container.
Table
Using a table is also a very good way to structure revision information.
It's also "future proof", if we decide to support a list of revisions.
As you can see the information is nicely displayed without any custom style.
Just like a description list, a
<table>
element provides a "natural" container.For reference, here's how we can create an inline layout:
Please note that the value "Version" could be retrieve from an attribute using
attr()
CSS function:Alternatives
span elements
I feel like
<span>
elements are a poor way to structure revision information.One issue is that we cannot associate a label with a value.
label elements
In theory a
<label>
can describe an element but in practice they are always use in assocation with an<input>
element.In my opinion, using a
<label>
element to describe an inline element (such as<span>
) won't be a legitimate use.https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
Revision date
datetime attribute
The format is loose (unspecified?) but according to the specification the
datetime
attribute is not mandatory:https://www.w3.org/TR/html51/textlevel-semantics.html#the-time-element
I guess we could try to parse the date using
Date._parse
and if the date is "valid" then we could set thedatetime
attribute using ISO 8601 format (YYYY-MM-DD as in 2021-03-14).Note:
Date._parse
can return invalid dates:In the last example, the month is 31!
Embedded / Standalone
I think that the author(s) and revision should be included in both the embedded and the standalone HTML using the same structure.
We can then apply styles to control how we want to display these information. Initial discussion: #2408
The text was updated successfully, but these errors were encountered: