Skip to content

Commit a5d0ebe

Browse files
authored
Merge pull request #9 from mvdriel/improve-readme
docs: improve README
2 parents 3c886f2 + c989aeb commit a5d0ebe

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TinyMCE for your Symfony apps and forms
22

33
This is a fork of [eckinox/tinymce-bundle](https://github.com/eckinox/tinymce-bundle).
4-
Both packages were created by myself, but since I left Eckinox the original
4+
Both packages were created by myself, but since I left Eckinox the original
55
bundle has been treated more like an internal package rather than a public &
66
open-source package, so I created this fork to keep supporting the community.
77

@@ -21,6 +21,8 @@ Adding a TinyMCE editor in your Symfony forms works like any other form types:
2121

2222

2323
```php
24+
use EmilePerron\TinymceBundle\Form\Type\TinymceType;
25+
2426
public function buildForm(FormBuilderInterface $builder, array $options): void
2527
{
2628
$builder->add("comment", TinymceType::class, [
@@ -33,7 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
3335

3436
#### Using TinyMCE in templates
3537

36-
To render a TinyMCE editor in Twig without using Symfony forms, you can use the
38+
To render a TinyMCE editor in Twig without using Symfony forms, you can use the
3739
`tinymce()` Twig function that is provided by this bundle.
3840

3941
Simply provide the value as the first argument and you're good to go.
@@ -49,7 +51,7 @@ Here is an example:
4951
#### Using TinyMCE in Javascript
5052

5153
To render a TinyMCE editor in Javascript, first ensure that the main TinyMCE script
52-
is loaded.
54+
is loaded.
5355

5456
If you already use the `tinymce()` Twig function or the `TinymceType` on the page,
5557
the scripts are already loaded. Otherwise, you can include them on the page either
@@ -90,20 +92,22 @@ for (const key in attrs) {
9092
document.body.append(editor);
9193
```
9294

93-
You can refer to [Tiny's web component documentation](https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref)
95+
You can refer to [Tiny's web component documentation](https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref)
9496
for more information.
9597

9698

9799
## Configuring TinyMCE
98100

99-
This bundle includes and uses the web component version of TinyMCE.
101+
This bundle includes and uses the web component version of TinyMCE.
100102

101103
You can configure TinyMCE by setting HTML attributes on the editor element itself (`<tinymce-editor>`).
102104

103-
When using the form type, you can use the `attr` option to set the attributes.
105+
When using the form type, you can use the `attr` option to set the attributes.
104106
For example, you can set the toolbar's actions like so:
105107

106108
```php
109+
use EmilePerron\TinymceBundle\Form\Type\TinymceType;
110+
107111
public function buildForm(FormBuilderInterface $builder, array $options): void
108112
{
109113
$builder->add("comment", TinymceType::class, [
@@ -114,7 +118,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
114118
// ...
115119
```
116120

117-
For more information on the different configurations that TinyMCE offers, refer
121+
For more information on the different configurations that TinyMCE offers, refer
118122
to [Tiny's web component documentation](https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref/).
119123

120124
### Default configurations
@@ -124,7 +128,7 @@ You can set the following default options in a configuration file:
124128
```yaml
125129
tinymce:
126130
# The configurations mirror the TinyMCE attributes.
127-
# Learn more about each option in Tiny's documentation:
131+
# Learn more about each option in Tiny's documentation:
128132
# https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref/
129133
skin: "oxide"
130134
content_css: "default"
@@ -143,7 +147,7 @@ tinymce:
143147
setup: ""
144148
images_upload_url: "https://yoursite.com/upload"
145149
images_upload_route: ""
146-
images_upload_route_params: ""
150+
images_upload_route_params: []
147151
images_upload_handler: ""
148152
images_upload_base_path: ""
149153
images_upload_credentials: "true"
@@ -190,8 +194,8 @@ or Twig Template instead of doing so in your `tinymce.yaml` configuration file.
190194

191195
### Using your configuration in Twig templates
192196

193-
If you need to use your configurations in a Twig template, you can use the
194-
`tinymce_attributes()` function, which accepts an optional array of custom
197+
If you need to use your configurations in a Twig template, you can use the
198+
`tinymce_attributes()` function, which accepts an optional array of custom
195199
attributes that take priority over the default configuration.
196200

197201
Here is an example:
@@ -210,14 +214,14 @@ File uploads are not handled by default, as the process will vary from project t
210214

211215
To set this up, take a look at [Tiny's web component file upload documentation](https://www.tiny.cloud/docs/tinymce/6/webcomponent-ref/#setting-the-images-upload-url).
212216

213-
To help you get started, we have provided an example of what the implementation may look like.
217+
To help you get started, we have provided an example of what the implementation may look like.
214218
You can find this example in [`docs/file-upload-example.md`](./docs/file-upload-example.md).
215219

216220
## Commercial TinyMCE License Key
217221

218222
By default, this bundle sets you up to use the GPL licensed version of TinyMCE.
219223

220-
If you have a commercial license that you would like to use instead, you must
224+
If you have a commercial license that you would like to use instead, you must
221225
provide the `license_key` to the global TinyMCE configuration extras, like so:
222226

223227
```js
@@ -228,19 +232,19 @@ window.tinymceAdditionalConfig = {
228232

229233
## AssetMapper support
230234

231-
Support for Symfony's AssetMapper is built-in to this bundle since v2.1. No
235+
Support for Symfony's AssetMapper is built-in to this bundle since v2.1. No
232236
additional configuration is required on your end.
233237

234238
When AssetMapper is used, the TinyMCE files are automatically excluded from
235-
being compiled as part of Asset Mapper, as the versioning hash that Asset
239+
being compiled as part of Asset Mapper, as the versioning hash that Asset
236240
Mapper automatically adds to filenames and URLs is incompatible with the
237241
runtime script imports that are core to TinyMCE.
238242

239243

240244
## AppStack skin
241245

242-
This bundle comes with an `appstack` skin, which matches the style of the
243-
[AppStack Bootstrap template](https://appstack-bs5.bootlab.io/index.html).
246+
This bundle comes with an `appstack` skin, which matches the style of the
247+
[AppStack Bootstrap template](https://appstack-bs5.bootlab.io/index.html).
244248

245249
This skin is an extension of the tinymce-5, and it has dark mode support built-in.
246250

0 commit comments

Comments
 (0)