-
Notifications
You must be signed in to change notification settings - Fork 221
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
DOC-1969: lists and advlists plugins, text_patterns, and implicit and explicit list-creation UIs #2693
base: archived/release/docs-6
Are you sure you want to change the base?
DOC-1969: lists and advlists plugins, text_patterns, and implicit and explicit list-creation UIs #2693
Changes from all commits
b868d7c
6153599
e640360
efb23e6
77a445a
d32752b
d0228e2
fb0aa2b
d425e7d
f8612e5
29af5de
16e8e65
b53f177
7854048
9a30ddd
fa6528b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -5,21 +5,106 @@ | |||
:pluginname: Lists | ||||
:plugincode: lists | ||||
|
||||
The `+lists+` plugin allows you to add numbered and bulleted lists to {productname}. To enable advanced lists (e.g. alpha numbered lists, square bullets) you should also enable the xref:advlist.adoc[Advanced List] (`+advlist+`) plugin. | ||||
The `+lists+` plugin enables numbered and bulleted lists in {productname}. To enable advanced lists (for example, lists ordered by letter or unordered lists presented with square bullets) enable the xref:advlist.adoc[Advanced List] (`+advlist+`) plugin. | ||||
|
||||
The plugin also normalizes list behavior between browsers. Enable it if you have problems with consistency making lists. | ||||
The `+lists+` plugin also normalizes list behavior between browsers. Enable it if you have problems with consistency making lists. | ||||
|
||||
== Basic setup | ||||
It is important to note that, by default, {productname} includes both implicit and explicit list-creation user-interfaces. | ||||
|
||||
Adding the `lists` plugin and the `bullist` and `numlist` toolbar items to a {productname} configuration enables the explicit list-creation user-interface (UI). | ||||
|
||||
The implicit list-creation UI comes via xref:content-behavior-options.adoc#text_patterns[text patterns]. The default set of `text_patterns` enabled when {productname} is initialized include https://daringfireball.net/projects/markdown/syntax[Markdown]-based patterns that {productname} automatically turns into basic ordered and unordered lists. | ||||
|
||||
If the xref:advlist.adoc[Advanced Lists] Premium plugin is part of a {productname} configuration, the default `text_patterns` set also includes patterns that provide an implicit UI for generating the advanced ordered and unordered lists this plugin makes possible. | ||||
|
||||
== Basic lists UI: implicit and explicit | ||||
|
||||
[source,js] | ||||
---- | ||||
tinymce.init({ | ||||
selector: 'textarea', // change this value according to your HTML | ||||
plugins: 'lists', | ||||
toolbar: 'bullist numlist', | ||||
}); | ||||
---- | ||||
|
||||
|
||||
== Basic lists UI: explicit lists UI but no implicit lists UI | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any explanation for what is meant by explicit and implicit UI? I'm not sure I understand |
||||
|
||||
[source,js] | ||||
---- | ||||
tinymce.init({ | ||||
selector: 'textarea', // change this value according to your HTML | ||||
plugins: 'lists', | ||||
toolbar: 'numlist bullist' | ||||
toolbar: 'bullist numlist', | ||||
text_patterns: false, | ||||
}); | ||||
---- | ||||
|
||||
include:partial$misc/admon-turning-text_patterns-off.adoc[] | ||||
|
||||
|
||||
== Basic setup for explicit lists UI and a specifically defined implicit lists UI | ||||
|
||||
[source,js] | ||||
---- | ||||
tinymce.init({ | ||||
selector: 'textarea', // change this value according to your HTML | ||||
plugins: 'lists', | ||||
toolbar: 'numlist bullist', | ||||
text_patterns: [ | ||||
{ start: '#', format: 'h1' }, | ||||
{ start: '##', format: 'h2' }, | ||||
{ start: '###', format: 'h3' }, | ||||
{ start: '####', format: 'h4' }, | ||||
{ start: '#####', format: 'h5' }, | ||||
{ start: '######', format: 'h6' }, | ||||
{ start: '* ', cmd: 'InsertUnorderedList' }, | ||||
{ start: '- ', cmd: 'InsertUnorderedList' }, | ||||
{ start: '1. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'decimal' } }, | ||||
// the block patterns below require the Advanced Lists plugin | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
{ start: '1) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'decimal' } }, | ||||
{ start: 'a. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-alpha' } }, | ||||
{ start: 'a) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-alpha' } }, | ||||
{ start: 'i. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-roman' } }, | ||||
{ start: 'i) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-roman' } } | ||||
] | ||||
}); | ||||
---- | ||||
|
||||
The `text_patterns` array in the example above duplicates the default `text_patterns` set available even if `text_patterns` is not explicitly specified in a {productname} configuration. | ||||
|
||||
== Basic setup for a specifically defined implicit lists UI but no explicit lists UI | ||||
|
||||
|
||||
[source,js] | ||||
---- | ||||
tinymce.init({ | ||||
selector: 'textarea', // change this value according to your HTML | ||||
plugins: 'lists', | ||||
text_patterns: [ | ||||
{ start: '#', format: 'h1' }, | ||||
{ start: '##', format: 'h2' }, | ||||
{ start: '###', format: 'h3' }, | ||||
{ start: '####', format: 'h4' }, | ||||
{ start: '#####', format: 'h5' }, | ||||
{ start: '######', format: 'h6' }, | ||||
{ start: '* ', cmd: 'InsertUnorderedList' }, | ||||
{ start: '- ', cmd: 'InsertUnorderedList' }, | ||||
{ start: '1. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'decimal' } }, | ||||
// the block patterns below require the Advanced Lists plugin | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
{ start: '1) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'decimal' } }, | ||||
{ start: 'a. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-alpha' } }, | ||||
{ start: 'a) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-alpha' } }, | ||||
{ start: 'i. ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-roman' } }, | ||||
{ start: 'i) ', cmd: 'InsertOrderedList', value: { 'list-style-type': 'lower-roman' } } | ||||
] | ||||
}); | ||||
---- | ||||
|
||||
The `text_patterns` array in the example above also duplicates the default `text_patterns` set. This example, however, removes the ordered and unordered list toolbar items. The `list` plugin does not provide a menu item, so not loading the toolbar items removes the explicit lists UI. | ||||
Comment on lines
+75
to
+105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What purpose does this example serve? The toolbar buttons aren't removed, they just aren't configured. |
||||
|
||||
|
||||
== Options | ||||
|
||||
These settings affect the execution of the `+lists+` plugin. | ||||
|
@@ -28,6 +113,7 @@ include::partial$configuration/lists_indent_on_tab.adoc[leveloffset=+1] | |||
|
||||
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[] | ||||
|
||||
|
||||
== Commands | ||||
|
||||
The Lists plugin provides the following {productname} commands. | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== Text patterns and lists | ||
|
||
As a consequence of | ||
|
||
. `text_patterns` being moved to the core of {productname}; | ||
. `text_patterns` being turned on by default; and | ||
. the set of `text_patterns` which are included by default | ||
|
||
{productname} now includes both implicit and explicit list creation user interfaces. See xref:lists.adoc[Lists] for details and basic configuration examples. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NOTE: Using `text_patterns: []` to turn `text_patterns` off is not supported. It sets `text_patterns` to an empty array. Having, consequently, no patterns to match, it presents as if `text_patterns` is off. Appearance is not reality, however. Setting `text_patterns: false` is the only supported way of disabling `text_patterns`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the importance of describing both the implicit and explicit UI? The plugin basically only adds the toolbar buttons, which is all that should really be on this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I'm not opposed to calling it an
implicit ui
, I think we can still make this easier to follow.Following that, I agree the examples should be simplified and moved to the
text_patterns
documentation. I think we can lose the first two examples and just demonstrate that with the list plugin and listtext_patterns
config but no toolbar buttons, lists can still be inserted.