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

Documentation: Format API #11105

Closed
7 tasks
gziolo opened this issue Oct 26, 2018 · 6 comments
Closed
7 tasks

Documentation: Format API #11105

gziolo opened this issue Oct 26, 2018 · 6 comments
Assignees
Labels
[Package] Rich text /packages/rich-text [Type] Developer Documentation Documentation for developers [Type] Enhancement A suggestion for improvement.

Comments

@gziolo
Copy link
Member

gziolo commented Oct 26, 2018

We merged today #10209 which introduces new API which allows to register and unregister formats for RichText component. @iseulde did a fantastic job refactoring all existing code to use this new API. However, we still need to document the following items:

Components package

Readme with a code example is missing for:

RichText package

Readme should list:

  • wp.richText. insertObject method
  • wp.richText. toggleFormat method
  • wp.richText.registerFormatType method
  • wp.richText.unregisterFormatType method

Url package

Changelog should include in New features section:

  • Changelog should include filterURLForDisplay

Readme should list:

  • filterURLForDisplay method

Docs:

We should add an example how to control formats in the Extending Editor section.

@chrisvanpatten - let us know if that can be included in the efforts you are leading

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Type] Developer Documentation Documentation for developers labels Oct 26, 2018
@gziolo gziolo added this to the API Freeze milestone Oct 26, 2018
@ellatrix ellatrix self-assigned this Oct 26, 2018
@youknowriad youknowriad modified the milestones: API Freeze, WordPress 5.0 Oct 27, 2018
@WebWeaver64
Copy link

Let me start off by saying I don't understand anything I just read...

Currently I have used and have setup for clients a way for them to style from a drop down. This was fairly easy to do following instruction I found on the internet, and in WP documentation. None of this seems easy :o\

What I would love to see is a way to open a drop down to a list of style selections (classes) either via a block, or inline. This could be either somewhere in the menu for the block (inline) or in the block selector itself (block styles), that just allows for someone to select what they want, and it would add the class to the html tag. The styles themselves could be added to a separate hooked in style sheet.

Now maybe this is what your all talking about doing, I'm just not understanding.

I'm currently just playing around with Gutenburg but I haven't found an easy way to handle this. I have clients that use different fonts and sizes as well as colored bold and italics intermittently, hence why I made use a site specific plugin. Maybe this will be handled by a plugin, however I don't currently see any that add this ability. This is a real world use need.

Am I just missing this somewhere?
Thanks!

@avillegasn
Copy link
Contributor

As @WebWeaver64 said the problem about Format API is its lack of documentation. I opened ticket #4658 that was closed but even though I'm trying, I'm not being successful at creating a button in text blocks. It's a very frustrating situation.

@avillegasn
Copy link
Contributor

Things are easier when you have an example. And I found it: https://wordpress.org/plugins/advanced-rich-text-tools/

This plugin should be linked in the documentation. Thanks @iseulde 💯

@Soean
Copy link
Member

Soean commented Nov 21, 2018

The source code of the Plugin: https://github.com/iseulde/advanced-rich-text-tools

@oandregal
Copy link
Member

Started a tutorial on the Format API at #13247

@ellatrix ellatrix added the [Package] Rich text /packages/rich-text label Feb 8, 2019
@gziolo
Copy link
Member Author

gziolo commented Feb 8, 2019

It looks like this issue was resolved by @nosolosw in #13247. Awesome work 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Rich text /packages/rich-text [Type] Developer Documentation Documentation for developers [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

8 participants