SublimeText3 plugin which generate a table of contents (TOC) in a markdown document.
NOTE This upgrade contains breaking changes. Please follow "Upgrade guide from v2 to v3" for instructions.
MarkdownTOC.sublime-settings
format has been changed.default_bullets
is deprecated, use defaults.bullets
instead.default_depth
is deprecated, use levels
instead. Ref: #55lowercase_only_ascii
is deprecated, use lowercase
instead with new value format. Ref: #105defaults.bracket
(ex default_bracket
) default value is changed to "round"
First of all default_xxx
moves to defaults.xxx
.
Please modify your settings if you have your own User Settings(Packages/User/MarkdownTOC.sublime-settings
).
MarkdownTOC.sublime-settings
format has been changedOld format:
{
"default_autoanchor": false,
"default_autolink": false,
"default_indent": "\t",
"default_remove_image": true,
"default_link_prefix": "",
"default_style": "unordered",
"default_uri_encoding": true,
"default_markdown_preview": false
}
New format:
{
"defaults": {
"autoanchor": false,
"autolink": false,
"indent": "\t",
"remove_image": true,
"link_prefix": "",
"style": "unordered",
"uri_encoding": true,
"markdown_preview": false
}
}
default_bullets
is deprecated, use defaults.bullets
insteadOld format:
{
"default_bullets": "-+*"
}
or value could also be array.
{
"default_bullets": ["-","+","*"]
}
New format:
{
"defaults": {
"bullets": ["-","+","*"]
}
}
Note: Values type is 'array'
You can also override it as attribute
<!-- MarkdownTOC bullets="-,+,*" -->
Note: Values type is 'comma separated strings'
default_depth
is deprecated, use defaults.levels
insteadOld format:
{
"default_depth": 0
}
New format:
{
"defaults": {
"levels": [1,2,3,4,5,6]
}
}
Note: Values type is 'array'
You can also override it as attribute
<!-- MarkdownTOC levels="1,2,3" -->
Note:
[1,2,3,4,5,6]
, it means all headings(h1
...h6
) appear in TOC. Please override in your User Settings(Packages/User/MarkdownTOC.sublime-settings
) if you prefer previous settings (e.g. [1,2]
) or any others.lowercase_only_ascii
is deprecated, use defaults.lowercase
insteadOld format:
{
"lowercase": true,
"lowercase_only_ascii": true
}
New format:
{
"defaults": {
"lowercase": "only_ascii"
}
}
Note: Values type is 'string' and allows following values "only_ascii"
(default), "all"
and "false"
.
You can also override it as attribute
<!-- MarkdownTOC lowercase="all" -->
See docs for more detail.
defaults.bracket
(ex default_bracket
) default value is changed to "round"
The default value has been changed. So if you prefer "square"
style, please override in your User Settings(Packages/User/MarkdownTOC.sublime-settings
)
Setting format has been changed.
You have to modify id_replacements
section if you customised User Settings(Packages/User/MarkdownTOC.sublime-settings
) yourself.
Old format:
{
"id_replacements": {
"-": " ",
"" : ["!","#","$"]
}
}
New format:
{
"id_replacements": [
{
"pattern": "\\s",
"replacement": "-"
},
{
"pattern": "!|#|$",
"replacement": ""
}
]
}
<!-- MarkdownTOC autolink=false autoanchor=true -->
- Without autolink issue
<!-- /MarkdownTOC -->
<a id="None"></a>
# Without autolink issue
↓
<!-- MarkdownTOC autolink=false autoanchor=true -->
- Without autolink issue
<!-- /MarkdownTOC -->
<a id="Without-autolink-issue"></a>
# Without autolink issue
See this specification.
Specifies a unique id for the element. Naming rules:
- Must contain at least one character
- Must not contain any space characters
- In HTML, all values are case-insensitive
If you want to replace all attributes you have already added by the older version of MarkdownTOC at once, you can use the following script.
for i in *md; do sed -i 's/<a name="/<a id="/g' "$i"; done
Thanks for @adoussot advise on https://github.com/naokazuterada/MarkdownTOC/pull/116#issuecomment-370174891
remove_image
parameter. (Read more in document) Ref: #43lowercase
parameter. (Read more in document) Ref: #40