Skip to content
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

WIP <figure> semantics #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

WIP <figure> semantics #37

wants to merge 1 commit into from

Conversation

forresto
Copy link
Contributor

No description provided.

,
type: 'image'
src: 'http://a.com/b.jpg'
caption: '<h1>Title</h1><p>Desc</p>'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this block.caption rather than block.metadata.caption?

Should it be html?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bergie RFC

@forresto forresto changed the title allow figcaption child #35 allow figcaption child Feb 13, 2016
@forresto
Copy link
Contributor Author

@bergie after p2p meetup can we figure out html consistency?

the-grid/ed#54
the-grid/ed#71

@forresto
Copy link
Contributor Author

Do we want to allow formatting and / or links within figcaption ? Would be nice.

@bergie
Copy link
Contributor

bergie commented May 13, 2016

@forresto yes, if we allow figcaption, we should allow inline mark-up there.

@forresto
Copy link
Contributor Author

forresto commented May 13, 2016

Can we clean this up semantically?

@bergie
Copy link
Contributor

bergie commented May 13, 2016

@forresto right now title and caption are assumed to be text-only in the block format

@forresto
Copy link
Contributor Author

@bergie what about using metadata alt and caption instead of description?

Or saving caption to description and making a new alt key?

@bergie
Copy link
Contributor

bergie commented May 13, 2016

@forresto if we want properties where the inline mark-up is retained, we should use new keys for them in order to not break backwards compat. Same should apply for example to article blocks.

@forresto forresto changed the title allow figcaption child WIP allow figcaption child May 13, 2016
@forresto forresto assigned forresto and unassigned bergie May 13, 2016
@forresto forresto changed the title WIP allow figcaption child WIP <figure> semantics May 13, 2016
@d4tocchini
Copy link
Member

@bergie, what would be the appropriate keys for properties w/ inline markup? This is a powerful & needed step forward.

Using metadata fields like metadata.description as a catch-all for different block-types is a stumbling-block to appropriately render content in both the webapp and DS. It's not a complexity problem, simple to work-around with a few if/else statements, but it's a conceptual dilemma that cannot be overstated. The feedback from everyone who's touched the data model has been consistent on this. Just had a conversation with @nickvelloff on this very topic.

Being consistent with @cbchouinard's stated contract between DS & the data-model: the content of the blocks are ensured to be represented, metadata will be a nice-to-have but not guaranteed: let's move forward on allowing rich sub-block content immediately and keeping it outside of metadata.

@bergie, do you have a general API in mind for blocks to expose inline markup content (ie sub-blocks)? A general (ie recursive) solution would be preferred over an ad-hoc one, yes?

I'm assuming these changes can be rolled out without breaking DS or any clients, and new DS & clients v2 can move to new method in .5 days work...

@d4tocchini
Copy link
Member

talking with @forresto, confirmed it will be needed for things like: edit the image caption inline in the editable, edit article block content inline, etc. Basically editable inline cards in Ed & would help catalyze Ed to next level. Most block metadata editing will be moving to a lightbox view.

DS needs this to ensure the most important content is rendered.

Apps could use it to more easily represent content on cards.

Not to mention it gives the possibility of having semi-rich text (links and what-not) in areas that reasonably should be have this possibility.

@d4tocchini
Copy link
Member

@bergie @jonnor @aretecode is there another issue somewhere in APIs or elsewhere on the topic of exposing a block's inline html content outside of metadata? This has been brought up countless times, now that ed, DS & apps are leveling up, let's put this old beaten 🐴 to rest ASAP

@forresto
Copy link
Contributor Author

forresto commented May 18, 2016

Until we have a recursive content format, the source of full truth is html. @bergie what if we do this, saving the plain-text version of the caption in metadata.caption?

<figure>
  <img title="Hover title" alt="Alt text for screenreaders">
  <figcaption>
    No block elements; just <em>formatting</em> and <a href="https://thegrid.io/#8">links</a>
  </figcaption>
</figure>

block:
  metadata:
    title: 'Hover title'
    alt: 'Alt text for screenreaders'
    caption: 'No block elements; just formatting and links'

@bergie
Copy link
Contributor

bergie commented May 20, 2016

@forresto yep, we can do that. The tagToText helper should do the right thing there.

@bergie
Copy link
Contributor

bergie commented May 20, 2016

Note that it appears figcaption allows even headlines so we may have to think a bit how we populate the metadata from it https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Flow_content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants