MarkdownTOC Versions Save

SublimeText3 plugin which generate a table of contents (TOC) in a markdown document.

3.0.1

6 years ago

Changes

  • Fix the problem that User Settings overide Default values non-recursively Ref: #122

3.0.0

6 years ago

NOTE This upgrade contains breaking changes. Please follow "Upgrade guide from v2 to v3" for instructions.


Changes

  1. MarkdownTOC.sublime-settings format has been changed.
  2. default_bullets is deprecated, use defaults.bullets instead.
  3. default_depth is deprecated, use levels instead. Ref: #55
  4. lowercase_only_ascii is deprecated, use lowercase instead with new value format. Ref: #105
  5. defaults.bracket(ex default_bracket) default value is changed to "round"
  6. Allow regular expressions in 'id_replacements', the format has been changed. Ref: #113

Upgrade Guide

Upgrading from MarkdownTOC v2.x to v3

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).

1. MarkdownTOC.sublime-settings format has been changed

Old 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
  }
}

2. default_bullets is deprecated, use defaults.bullets instead

Old 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'

3. default_depth is deprecated, use defaults.levels instead

Old 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:

  • Values type is 'comma separated strings'
  • The default value changed to [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.

4. lowercase_only_ascii is deprecated, use defaults.lowercase instead

Old 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.

5. 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)

6. Allow regular expressions in 'id_replacements', the format has been changed

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": ""
    }
  ]
}

2.7.3

6 years ago

Changes

  • Fix the preblem when using autoanchor without 'autolink=true'
<!-- 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

Why replace whitespaces to '-'?

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

2.7.2

6 years ago

Changes

  • Replace name attribute to id Ref: #116
  • Follow pycodestyle(pep8) lint rules Contribution by @Kristinita

How to update the old attributes

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

2.7.1

6 years ago

Changes

  • Drop BeautifulSoup dependency. Ref: #111 Contribution by @ziembla

2.7.0

6 years ago

Changes

2.6.0

6 years ago

Changes

2.5.0

6 years ago

Changes

Ref: #41

2.4.1

6 years ago

Changes

  • Fix problem that user's settings doesn't work. Ref: #100
  • Fix problem that characters inside codeblock is also escaped. Ref: #64 Contribution by Mathieu PATUREL ( @math2001 ). Ref: #101

2.4.0

6 years ago

Changes

Ref: #94