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

Bump spec to 0.3.2, optional section attributes #681

Merged
merged 1 commit into from
Jul 16, 2019
Merged

Conversation

mixonic
Copy link
Contributor

@mixonic mixonic commented May 7, 2019

Bump the Mobiledoc spec to 0.3.2.

This adds an optional "section attributes" item to markup sections and list sections.

  • The attributes are encoded as a list of key/value pairs, for example: ['data-md-text-align', 'center']
  • Only data-md-text-align is permitted by the spec. An alternative would be to permit arbitrary attribute values, but claim the data-md- namespace and only restrict values added there.
  • The attributes could alternatively been located in a new top-level property of the spec, but I chose to simply add them to each section instead. It seems fine for an initial pass, if every section will have an attribute we might want to encode them in a different way.
  • I've added this to markup and list sections. Alternatives would be a) just markup sections b) markup sections and list item sections.

Any thoughts? I've got another PR incoming that polishes @rondale-sc's prior work to implement this in Mobiledoc-kit.

This is an extraction/edit from WIP #670

/cc @ZeeJab @kevinansfield @rondale-sc

@YoranBrondsema
Copy link
Collaborator

YoranBrondsema commented Jul 15, 2019

I continued work on this as we'd like to offer text alignment in Sutori. I made a new PR but started off from yours.

Only data-md-text-align is permitted by the spec. An alternative would be to permit arbitrary attribute values, but claim the data-md- namespace and only restrict values added there.

I'd be in favor of only permitting data-md-text-align attributes for now, and then see what use cases come up. Then eventually extending it or permitting any attribute. I agree that all attributes set by Mobiledoc should be prefixed with data-md-.

I've added this to markup and list sections. Alternatives would be a) just markup sections b) markup sections and list item sections.

I tried all three and from a UX perspective, I think you picked the right one.

@mixonic
Copy link
Contributor Author

mixonic commented Jul 15, 2019

@YoranBrondsema I think the only real blocker on this is the renderers themselves needing to support the spec. Want to schedule a pairing session to try and wrap it up? I'll send an email.

@mixonic mixonic merged commit 0449e15 into master Jul 16, 2019
@mixonic mixonic deleted the mobiledoc-0.3.2 branch July 16, 2019 12:22
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.

2 participants