-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Comments
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? |
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. |
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 💯 |
The source code of the Plugin: https://github.com/iseulde/advanced-rich-text-tools |
Started a tutorial on the Format API at #13247 |
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:
ToolbarButton
- https://github.com/WordPress/gutenberg/tree/master/packages/components/src/toolbar-buttonRichText package
Readme should list:
wp.richText. insertObject
methodwp.richText. toggleFormat
methodwp.richText.registerFormatType
methodwp.richText.unregisterFormatType
methodUrl package
Changelog should include in
New features
section:filterURLForDisplay
Readme should list:
filterURLForDisplay
methodDocs:
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
The text was updated successfully, but these errors were encountered: