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

data- attributes should be compliant w/ Robust Links spec #114

Closed
phonedude opened this Issue Aug 2, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@phonedude
Member

phonedude commented Aug 2, 2018

@hvdsomp pointed this out; I missed it initially.

where possible, the data-* attributes should align w/ the Robust Links spec: http://robustlinks.mementoweb.org/spec/

instead of data-urim and data-urir, RL uses data-versionurl and data-originalurl, respectively.

also, it doesn't look like there is an equivalent of data-versiondate in the snippet code? the Memento-datetime shows up in the anchor text, but not in a machine readable form.

@shawnmjones

This comment has been minimized.

Show comment
Hide comment
@shawnmjones

shawnmjones Aug 6, 2018

Collaborator

I have created a branch that uses data-versionurl, data-originalurl, and data-versiondate.

I am testing now.

In the robust links documentation, data-versiondate shows only dates, but no times. I've left my datetimes in RFC3339 format seeing as I have found no additional guidance.

Collaborator

shawnmjones commented Aug 6, 2018

I have created a branch that uses data-versionurl, data-originalurl, and data-versiondate.

I am testing now.

In the robust links documentation, data-versiondate shows only dates, but no times. I've left my datetimes in RFC3339 format seeing as I have found no additional guidance.

@shawnmjones shawnmjones self-assigned this Aug 6, 2018

@hvdsomp

This comment has been minimized.

Show comment
Hide comment
@hvdsomp

hvdsomp Aug 6, 2018

hvdsomp commented Aug 6, 2018

@phonedude

This comment has been minimized.

Show comment
Hide comment
@phonedude

phonedude Aug 6, 2018

Member

yeah, I had not realized that all of our examples are only "date" and no "time". As @hvdsomp said, it's ok. This link in slide 31 shows datetime:

https://www.slideshare.net/hvdsomp/creating-pockets-of-persistence/31

And it's indirectly included via the constructs of:

meta itemprop="dateModified" ...
meta itemprop="datePublished"...

but we should probably have some more explicit examples.

Member

phonedude commented Aug 6, 2018

yeah, I had not realized that all of our examples are only "date" and no "time". As @hvdsomp said, it's ok. This link in slide 31 shows datetime:

https://www.slideshare.net/hvdsomp/creating-pockets-of-persistence/31

And it's indirectly included via the constructs of:

meta itemprop="dateModified" ...
meta itemprop="datePublished"...

but we should probably have some more explicit examples.

@shawnmjones

This comment has been minimized.

Show comment
Hide comment
@shawnmjones

shawnmjones Aug 6, 2018

Collaborator

Cool. I'm glad I chose a compatible format as well. It's easier to parse than some alternatives.

For graceful degradation purposes, MementoEmbed places all data-* attributes into the blockquote tag. The JavaScript then builds the resulting HTML from these. If a user wants to use robustlinks.js, the links in the cards will not be decorated. I'm going to have the JavaScript apply the correct attributes to the anchor tags that it creates.

I will also provide a page in the documentation indicating that the cards are Robust Links ready.

Collaborator

shawnmjones commented Aug 6, 2018

Cool. I'm glad I chose a compatible format as well. It's easier to parse than some alternatives.

For graceful degradation purposes, MementoEmbed places all data-* attributes into the blockquote tag. The JavaScript then builds the resulting HTML from these. If a user wants to use robustlinks.js, the links in the cards will not be decorated. I'm going to have the JavaScript apply the correct attributes to the anchor tags that it creates.

I will also provide a page in the documentation indicating that the cards are Robust Links ready.

@shawnmjones

This comment has been minimized.

Show comment
Hide comment
@shawnmjones

shawnmjones Aug 7, 2018

Collaborator

So I attempted to ensure that MementoEmbed cards work with RobustLinks. There are some caveats.

The dropdown buttons

As seen below, the dropdown buttons fill in.

2018-08-06_18-04-13

In order for this to occur, robustlinks-min.js must be placed at the bottom of the page, to load after everything. This is contrary to the RobustLinks instructions which recommend placing it within the HEAD section. Placing it in the HEAD causes robustlinks-min.js to generate dropdowns for all links on the page before the embed is completely finished building. I am going to make this note in MementoEmbed's documentation. Other JavaScript libraries, including bootstrap, recommend placing their scripts at the bottom, so this is not unheard of. Once that is done, the dropdown links come in fine.

If the code for robustlinks-min.js were inside a function, MementoEmbed could call it when each card is rendered. This way it could still be placed in the HEAD element.

Outside of MementoEmbed, other sites endeavoring to use RobustLinks will likely have this problem. I suspect that any anchor tags built by JavaScript after robustlinks-min.js runs will not have the dropdowns.

Action for MementoEmbed: update the MementoEmbed documentation mentioning how an author would place the robustlinks-min.js reference toward the bottom of the page if they want to use both MementoEmbed and RobustLinks.

Dropdown for the URI-M link in the card title

As seen below, the link from the memento title does not render well.

2018-08-06_18-27-42

I have seen this behavior with RobustLinks before when I have tried it in the past. Sometimes if a link is to the far right or left and the containing page has an insufficient margin, the RobustLinks dropdown renders off-page. I thought that might be the cause of the problem, but I was wrong. The culprit turned out to be the overflow: auto style attribute that I was using to keep the text and image separate. When I remove this CSS, the text flows under the image, but the problem goes away.

2018-08-06_21-41-27

I will make this change to MementoEmbed. The overflow: auto, while producing a pleasing text/image separation, is also the source of some other issues involving collapsing margins. I'll have to see if I can manage the text/image separation a different way.

Action for MementoEmbed: Remove the overflow:auto from the style for the me-textright div part of the card.

The Link from URI-M in the card footer

The links from the memento below all work fine, linking to the memento, the archive, and the live web resource . Note how the archive is listed as webarchive.org instead of webarchive.org.uk. I wasn't sure if this was truncation or an actual issue with RobustLinks, so I mention it here.

2018-08-06_18-12-51

Action for MementoEmbed: None.

The Link from the URI-R in the card footer

The links from the original resource have some issues. The dropdown displays fine, but when I click Get near link date 2009-05-22 22:12:51, RobustLinks takes my browser to https://web.archive.org/web/20090526153508/http://www.blasttheory.co.uk/. The URI-M for the card is https://www.webarchive.org.uk/wayback/archive/20090522221251/http://blasttheory.co.uk/. I wonder if RobustLinks is not interpreting the datetime correctly. (This turned out to be a temporary issue with a TimeGate, it returns the correct memento now.)

2018-08-06_18-10-57

Action for MementoEmbed: None.

Additional Comments

I've determine how a page author might use both MementoEmbed and RobustLinks. Note that the goal is to ensure both are compatible with each other should a web page author want to use both. To keep dependencies to a minimum, I am not including RobustLinks in MementoEmbed at this time.

MementoEmbed will need a few minor changes in CSS and documentation. I also believe I have uncovered an issue with RobustLinks' datetime handling. (This turned out to be a temporary issue with a TimeGate, it returns the correct memento now.)

Collaborator

shawnmjones commented Aug 7, 2018

So I attempted to ensure that MementoEmbed cards work with RobustLinks. There are some caveats.

The dropdown buttons

As seen below, the dropdown buttons fill in.

2018-08-06_18-04-13

In order for this to occur, robustlinks-min.js must be placed at the bottom of the page, to load after everything. This is contrary to the RobustLinks instructions which recommend placing it within the HEAD section. Placing it in the HEAD causes robustlinks-min.js to generate dropdowns for all links on the page before the embed is completely finished building. I am going to make this note in MementoEmbed's documentation. Other JavaScript libraries, including bootstrap, recommend placing their scripts at the bottom, so this is not unheard of. Once that is done, the dropdown links come in fine.

If the code for robustlinks-min.js were inside a function, MementoEmbed could call it when each card is rendered. This way it could still be placed in the HEAD element.

Outside of MementoEmbed, other sites endeavoring to use RobustLinks will likely have this problem. I suspect that any anchor tags built by JavaScript after robustlinks-min.js runs will not have the dropdowns.

Action for MementoEmbed: update the MementoEmbed documentation mentioning how an author would place the robustlinks-min.js reference toward the bottom of the page if they want to use both MementoEmbed and RobustLinks.

Dropdown for the URI-M link in the card title

As seen below, the link from the memento title does not render well.

2018-08-06_18-27-42

I have seen this behavior with RobustLinks before when I have tried it in the past. Sometimes if a link is to the far right or left and the containing page has an insufficient margin, the RobustLinks dropdown renders off-page. I thought that might be the cause of the problem, but I was wrong. The culprit turned out to be the overflow: auto style attribute that I was using to keep the text and image separate. When I remove this CSS, the text flows under the image, but the problem goes away.

2018-08-06_21-41-27

I will make this change to MementoEmbed. The overflow: auto, while producing a pleasing text/image separation, is also the source of some other issues involving collapsing margins. I'll have to see if I can manage the text/image separation a different way.

Action for MementoEmbed: Remove the overflow:auto from the style for the me-textright div part of the card.

The Link from URI-M in the card footer

The links from the memento below all work fine, linking to the memento, the archive, and the live web resource . Note how the archive is listed as webarchive.org instead of webarchive.org.uk. I wasn't sure if this was truncation or an actual issue with RobustLinks, so I mention it here.

2018-08-06_18-12-51

Action for MementoEmbed: None.

The Link from the URI-R in the card footer

The links from the original resource have some issues. The dropdown displays fine, but when I click Get near link date 2009-05-22 22:12:51, RobustLinks takes my browser to https://web.archive.org/web/20090526153508/http://www.blasttheory.co.uk/. The URI-M for the card is https://www.webarchive.org.uk/wayback/archive/20090522221251/http://blasttheory.co.uk/. I wonder if RobustLinks is not interpreting the datetime correctly. (This turned out to be a temporary issue with a TimeGate, it returns the correct memento now.)

2018-08-06_18-10-57

Action for MementoEmbed: None.

Additional Comments

I've determine how a page author might use both MementoEmbed and RobustLinks. Note that the goal is to ensure both are compatible with each other should a web page author want to use both. To keep dependencies to a minimum, I am not including RobustLinks in MementoEmbed at this time.

MementoEmbed will need a few minor changes in CSS and documentation. I also believe I have uncovered an issue with RobustLinks' datetime handling. (This turned out to be a temporary issue with a TimeGate, it returns the correct memento now.)

shawnmjones added a commit that referenced this issue Aug 7, 2018

Merge pull request #115 from oduwsdl/robust_links_alignment
Robust links alignment work for #114
@phonedude

This comment has been minimized.

Show comment
Hide comment
@phonedude

phonedude Aug 7, 2018

Member

so, we don't need the js and actions embedded in the card. we just need to:

s/data-urim/data-versionurl/g
and
s/data-urir/data-originalurl/g
and put "data-versiondate" in there somewhere (it's currently not listed in machine readable format anywhere).

the card itself is already surfacing both links -- RL is about bundling the additional metadata with the basic single "href".

Member

phonedude commented Aug 7, 2018

so, we don't need the js and actions embedded in the card. we just need to:

s/data-urim/data-versionurl/g
and
s/data-urir/data-originalurl/g
and put "data-versiondate" in there somewhere (it's currently not listed in machine readable format anywhere).

the card itself is already surfacing both links -- RL is about bundling the additional metadata with the basic single "href".

@shawnmjones

This comment has been minimized.

Show comment
Hide comment
@shawnmjones

shawnmjones Aug 7, 2018

Collaborator

All of that has been done. For additional measure, the data-* attributes have been added to all anchor tags as well.

Collaborator

shawnmjones commented Aug 7, 2018

All of that has been done. For additional measure, the data-* attributes have been added to all anchor tags as well.

@shawnmjones

This comment has been minimized.

Show comment
Hide comment
@shawnmjones

shawnmjones Aug 15, 2018

Collaborator

I'm closing this as done. If an issue is encountered, I can address that as a separate ticket.

Collaborator

shawnmjones commented Aug 15, 2018

I'm closing this as done. If an issue is encountered, I can address that as a separate ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment