From a3778aab085479db37106606d9c10ff689f9793e Mon Sep 17 00:00:00 2001 From: Vladimir Schneider Date: Wed, 13 May 2020 13:57:59 -0400 Subject: [PATCH] fix toc levels parsing as per documentation --- VERSION-TODO.md | 25 ++ .../toc/internal/TocLevelsOptionParser.java | 19 +- .../src/main/javadoc/overview.html | 61 ++++- flexmark-ext-toc/src/main/javadoc/overview.md | 48 +++- .../src/test/resources/ext_simtoc_ast_spec.md | 30 ++- .../src/test/resources/ext_toc_ast_spec.md | 36 ++- .../resources/toc_options_parser_ast_spec.md | 253 +++++++++++++----- 7 files changed, 383 insertions(+), 89 deletions(-) diff --git a/VERSION-TODO.md b/VERSION-TODO.md index b2d3b547cd..adb2e7eab9 100644 --- a/VERSION-TODO.md +++ b/VERSION-TODO.md @@ -7,6 +7,7 @@ - [Release 0.60.0](#release-0600) - [API Refactoring](#api-refactoring) - [Next 0.61.xx](#next-061xx) +- [0.61.28](#06128) - [0.61.26](#06126) - [0.61.24](#06124) - [0.61.22](#06122) @@ -225,6 +226,30 @@ Please give feedback on the upcoming changes if you have concerns about breaking * [ ] Fix: Html converter to not add spaces between end of inline marker and next punctuation: `.,:;` +## 0.61.28 + +* Fix: Toc and SimToc `levels` parsing to properly handle levels as per documentation. + * single numeric >2 is 2-level, ie. `levels=4` should be interpreted as `levels=2-4` but was + `levels=4,4`. + * `levels=x-` to be same as `levels=x-6`, was handled as `levels=x,x` + + `levels=levelList` where level list is a comma separated list of levels or ranges. Default is + to include heading levels 2 and 3. If a range is specified using `-` as separator between + numeric values then the included range is from first numeric to last numeric inclusive. If + first numeric is missing then 1 will be used in its place. If last numeric is missing then 6 + will be used in its place. + + Examples: + * `levels=1` include level 1 only, same as `levels=1,1` + * `levels=2` include level 2 only, same as `levels=2,2` + * `levels=3` include levels 2 and 3 + * `levels=4` include levels 2,3 and 4 + * `levels=2-4` include levels 2,3 and 4. same as `levels=4` + * `levels=2-4,5` include levels 2,3,4 and 5 + * `levels=1,3` include levels 1 and 3 + * `levels=-3` include levels 1 to 3 + * `levels=3-` include levels 3 to 6 + ## 0.61.26 * Fix: `SequenceBuilder.toString()` not to add space between sequence parts. diff --git a/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocLevelsOptionParser.java b/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocLevelsOptionParser.java index 1cc29bd62c..b4a44d2bfc 100644 --- a/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocLevelsOptionParser.java +++ b/flexmark-ext-toc/src/main/java/com/vladsch/flexmark/ext/toc/internal/TocLevelsOptionParser.java @@ -37,6 +37,7 @@ public class TocLevelsOptionParser implements OptionParser { TOC_LEVELS_MAP.put(1 << 5, "5,5"); TOC_LEVELS_MAP.put(1 << 6, "6,6"); } + public TocLevelsOptionParser(String optionName) { this.myOptionName = optionName; } @@ -46,7 +47,6 @@ public String getOptionName() { return myOptionName; } - @SuppressWarnings("unchecked") @Override public Pair>> parseOption(BasedSequence optionText, TocOptions options, MessageProvider provider) { // may have levels @@ -71,20 +71,27 @@ public Pair>> parseOption(BasedSequenc }; for (BasedSequence option : levelsOptionValue) { - BasedSequence[] optionRange = option.split("-", 2, BasedSequence.SPLIT_TRIM_PARTS); + BasedSequence[] optionRange = option.split("-", 2, BasedSequence.SPLIT_TRIM_PARTS | BasedSequence.SPLIT_INCLUDE_DELIM_PARTS); Integer rangeStart; Integer rangeEnd; parserParams.skip = false; - if (optionRange.length == 2) { + if (optionRange.length >= 2) { rangeStart = convertWithMessage.apply(optionRange[0]); - rangeEnd = convertWithMessage.apply(optionRange[1]); + rangeEnd = optionRange.length >= 3 ? convertWithMessage.apply(optionRange[2]) : null; if (rangeStart == null) rangeStart = 1; if (rangeEnd == null) rangeEnd = 6; } else { - rangeStart = convertWithMessage.apply(optionRange[0]); - rangeEnd = rangeStart; + // NOTE: 1 means heading level 1 only, 2 means 2 only, rest mean 2-x + Integer optionValue = convertWithMessage.apply(optionRange[0]); + if (optionValue != null && optionValue <= 2) { + rangeStart = optionValue; + rangeEnd = rangeStart; + } else { + rangeStart = optionValue == null ? null : 2; + rangeEnd = optionValue; + } } if (!parserParams.skip) { diff --git a/flexmark-ext-toc/src/main/javadoc/overview.html b/flexmark-ext-toc/src/main/javadoc/overview.html index f4894c34aa..4c4c3f2d34 100644 --- a/flexmark-ext-toc/src/main/javadoc/overview.html +++ b/flexmark-ext-toc/src/main/javadoc/overview.html @@ -4,7 +4,64 @@

flexmark-java table of contents extension

-

flexmark-java extension for converting [TOC level= # ] to an HTML rendered table of contents

-

where # is a digit specifying the highest level heading to use in the table of contents

+

Converts [TOC style] text to TocBlock nodes and

+

Or Sim TOC tag, which has the following format: [TOC style]: # "Title" and includes all +following lines until a blank line.

+

Lines after the TOC tag are added to the SimTocContent child node of the SimToc block.

+

The intention for this tag is to have the SimTocContent updated to reflect the content of the +document.

+
    +
  1. +

    style consists of space separated list of options:

    +
      +
    • +

      levels=levelList where level list is a comma separated list of levels or ranges. Default + is to include heading levels 2 and 3. Examples:

      +
        +
      • levels=4 include levels 2,3 and 4
      • +
      • levels=2-4 include levels 2,3 and 4. same as levels=4
      • +
      • levels=2-4,5 include levels 2,3,4 and 5
      • +
      • levels=1,3 include levels 1 and 3
      • +
      • levels=-3 include levels 1 to 3
      • +
      • levels=3- include levels 3 to 6
      • +
      +
    • +
    • +

      html generate HTML version of the TOC

      +
    • +
    • +

      markdown generate Markdown version of the TOC

      +
    • +
    • +

      text to only include the text of the heading

      +
    • +
    • +

      formatted to include text and inline formatting

      +
    • +
    • +

      hierarchy to render as hierarchical list in order of appearance in the document

      +
    • +
    • +

      flat to render as a flat list in order of appearance in the document

      +
    • +
    • +

      reversed to render as a flat list in order of appearance in the document

      +
    • +
    • +

      sort-up to render as a flat list sorted alphabetically by heading text only, no inlines

      +
    • +
    • +

      sort-down to render as a flat list sorted reversed alphabetically by heading text only, + no inlines

      +
    • +
    • +

      bullet to use a bullet list for the TOC items

      +
    • +
    • +

      numbered to use a numbered list for TOC items

      +
    • +
    +
  2. +
diff --git a/flexmark-ext-toc/src/main/javadoc/overview.md b/flexmark-ext-toc/src/main/javadoc/overview.md index 72b3d8ec92..34d054141f 100644 --- a/flexmark-ext-toc/src/main/javadoc/overview.md +++ b/flexmark-ext-toc/src/main/javadoc/overview.md @@ -1,5 +1,49 @@ **flexmark-java table of contents extension** -flexmark-java extension for converting `[TOC level=` ***#*** `]` to an HTML rendered table of contents +Converts `[TOC style]` text to TocBlock nodes and + +Or Sim TOC tag, which has the following format: `[TOC style]: # "Title"` and includes all +following lines until a blank line. + + +Lines after the TOC tag are added to the `SimTocContent` child node of the SimToc block. + +The intention for this tag is to have the `SimTocContent` updated to reflect the content of the +document. + + + +1. `style` consists of space separated list of options: + + * `levels=levelList` where level list is a comma separated list of levels or ranges. Default + is to include heading levels 2 and 3. Examples: + * `levels=4` include levels 2,3 and 4 + * `levels=2-4` include levels 2,3 and 4. same as `levels=4` + * `levels=2-4,5` include levels 2,3,4 and 5 + * `levels=1,3` include levels 1 and 3 + * `levels=-3` include levels 1 to 3 + * `levels=3-` include levels 3 to 6 + + * `html` generate HTML version of the TOC + + * `markdown` generate Markdown version of the TOC + + * `text` to only include the text of the heading + + * `formatted` to include text and inline formatting + + * `hierarchy` to render as hierarchical list in order of appearance in the document + + * `flat` to render as a flat list in order of appearance in the document + + * `reversed` to render as a flat list in order of appearance in the document + + * `sort-up` to render as a flat list sorted alphabetically by heading text only, no inlines + + * `sort-down` to render as a flat list sorted reversed alphabetically by heading text only, + no inlines + + * `bullet` to use a bullet list for the TOC items + + * `numbered` to use a numbered list for TOC items -where # is a digit specifying the highest level heading to use in the table of contents diff --git a/flexmark-ext-toc/src/test/resources/ext_simtoc_ast_spec.md b/flexmark-ext-toc/src/test/resources/ext_simtoc_ast_spec.md index 4cb4583603..d758e322f2 100644 --- a/flexmark-ext-toc/src/test/resources/ext_simtoc_ast_spec.md +++ b/flexmark-ext-toc/src/test/resources/ext_simtoc_ast_spec.md @@ -21,11 +21,21 @@ document. 1. `style` consists of space separated list of options: * `levels=levelList` where level list is a comma separated list of levels or ranges. Default - is to include heading levels 2 and 3. Examples: + is to include heading levels 2 and 3. If a range is specified using `-` as separator + between numeric values then the included range is from first numeric to last numeric + inclusive. If first numeric is missing then 1 will be used in its place. If last numeric is + missing then 6 will be used in its place. + + Examples: + * `levels=1` include level 1 only, same as `levels=1,1` + * `levels=2` include level 2 only, same as `levels=2,2` + * `levels=3` include levels 2 and 3 * `levels=4` include levels 2,3 and 4 * `levels=2-4` include levels 2,3 and 4. same as `levels=4` * `levels=2-4,5` include levels 2,3,4 and 5 * `levels=1,3` include levels 1 and 3 + * `levels=-3` include levels 1 to 3 + * `levels=3-` include levels 3 to 6 * `html` generate HTML version of the TOC @@ -1198,13 +1208,21 @@ options, title with escaped chars

title"s

title's

. @@ -2009,7 +2027,11 @@ Document[0, 58]

titles

. diff --git a/flexmark-ext-toc/src/test/resources/ext_toc_ast_spec.md b/flexmark-ext-toc/src/test/resources/ext_toc_ast_spec.md index 338b3850f4..b58419d69e 100644 --- a/flexmark-ext-toc/src/test/resources/ext_toc_ast_spec.md +++ b/flexmark-ext-toc/src/test/resources/ext_toc_ast_spec.md @@ -15,11 +15,21 @@ Converts `[TOC style]` text to TocBlock nodes. 1. `style` consists of space separated list of options: * `levels=levelList` where level list is a comma separated list of levels or ranges. Default - is to include heading levels 2 and 3. Examples: + is to include heading levels 2 and 3. If a range is specified using `-` as separator + between numeric values then the included range is from first numeric to last numeric + inclusive. If first numeric is missing then 1 will be used in its place. If last numeric is + missing then 6 will be used in its place. + + Examples: + * `levels=1` include level 1 only, same as `levels=1,1` + * `levels=2` include level 2 only, same as `levels=2,2` + * `levels=3` include levels 2 and 3 * `levels=4` include levels 2,3 and 4 * `levels=2-4` include levels 2,3 and 4. same as `levels=4` * `levels=2-4,5` include levels 2,3,4 and 5 * `levels=1,3` include levels 1 and 3 + * `levels=-3` include levels 1 to 3 + * `levels=3-` include levels 3 to 6 * `html` generate HTML version of the TOC @@ -1250,7 +1260,11 @@ Document[0, 129]

Header 3

. @@ -1303,16 +1317,26 @@ Document[0, 40]

test 1.2.1.1

test 1.2.1.2

diff --git a/flexmark-ext-toc/src/test/resources/toc_options_parser_ast_spec.md b/flexmark-ext-toc/src/test/resources/toc_options_parser_ast_spec.md index 750acccbd8..d5000b5ddc 100644 --- a/flexmark-ext-toc/src/test/resources/toc_options_parser_ast_spec.md +++ b/flexmark-ext-toc/src/test/resources/toc_options_parser_ast_spec.md @@ -15,35 +15,23 @@ Used for parsing toc tag style options The TOC tag has the following format: `[TOC style]: # "Title"` 1. `style` consists of space separated list of options: - * `levels=levelList` where level list is a comma separated list of levels or ranges. Default is to include heading levels 2 and 3. Examples: * `levels=4` include levels 2,3 and 4 * `levels=2-4` include levels 2,3 and 4. same as `levels=4` * `levels=2-4,5` include levels 2,3,4 and 5 * `levels=1,3` include levels 1 and 3 - * `html` generate HTML version of the TOC - * `markdown` generate Markdown version of the TOC - * `text` to only include the text of the heading - * `formatted` to include text and inline formatting - * `hierarchy` to render as hierarchical list in order of appearance in the document - * `flat` to render as a flat list in order of appearance in the document - * `reversed` to render as a flat list in order of appearance in the document - * `sort-up` to render as a flat list sorted alphabetically by heading text only, no inlines - * `sort-down` to render as a flat list sorted reversed alphabetically by heading text only, no inlines - * `bullet` to use a bullet list for the TOC items - * `numbered` to use a numbered list for TOC items Default @@ -59,78 +47,141 @@ Simple levels results in 2- level, or just level if < 2 ```````````````````````````````` example TocOptionsParser: 2 levels=0 -levels=1 -levels=2 -levels=3 -levels=4 -levels=5 -levels=6 -levels=7 -levels=8 -levels=9 . 'levels=0' => TocOptions { levels=12, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } diff: [TOC] full: [TOC levels=3 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:IGNORED + Message[7, 8] message:levels option value 0 is not an integer in the range [1, 6] +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 3 +levels=1 +. 'levels=1' => TocOptions { levels=2, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } diff: [TOC levels=1] full: [TOC levels=1 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 4 +levels=2 +. 'levels=2' => TocOptions { levels=4, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } diff: [TOC levels=2] full: [TOC levels=2 bullet formatted hierarchy] -'levels=3' => TocOptions { levels=8, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC levels=3,3] - full: [TOC levels=3,3 bullet formatted hierarchy] -'levels=4' => TocOptions { levels=16, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC levels=4,4] - full: [TOC levels=4,4 bullet formatted hierarchy] -'levels=5' => TocOptions { levels=32, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC levels=5,5] - full: [TOC levels=5,5 bullet formatted hierarchy] -'levels=6' => TocOptions { levels=64, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC levels=6,6] - full: [TOC levels=6,6 bullet formatted hierarchy] -'levels=7' => TocOptions { levels=12, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC] - full: [TOC levels=3 bullet formatted hierarchy] -'levels=8' => TocOptions { levels=12, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } - diff: [TOC] - full: [TOC levels=3 bullet formatted hierarchy] -'levels=9' => TocOptions { levels=12, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 5 +levels=3 +. +'levels=3' => TocOptions { levels=12, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } diff: [TOC] full: [TOC levels=3 bullet formatted hierarchy] . -Example[0, 89] +Example[0, 8] Style[0, 8] - TocOptions[0, 8] status:IGNORED - Message[7, 8] message:levels option value 0 is not an integer in the range [1, 6] - Style[9, 17] - TocOptions[9, 17] status:VALID - Style[18, 26] - TocOptions[18, 26] status:VALID - Style[27, 35] - TocOptions[27, 35] status:VALID - Style[36, 44] - TocOptions[36, 44] status:VALID - Style[45, 53] - TocOptions[45, 53] status:VALID - Style[54, 62] - TocOptions[54, 62] status:VALID - Style[63, 71] - TocOptions[63, 71] status:IGNORED - Message[70, 71] message:levels option value 7 is not an integer in the range [1, 6] - Style[72, 80] - TocOptions[72, 80] status:IGNORED - Message[79, 80] message:levels option value 8 is not an integer in the range [1, 6] - Style[81, 89] - TocOptions[81, 89] status:IGNORED - Message[88, 89] message:levels option value 9 is not an integer in the range [1, 6] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 6 +levels=4 +. +'levels=4' => TocOptions { levels=28, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=4] + full: [TOC levels=4 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 7 +levels=5 +. +'levels=5' => TocOptions { levels=60, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=5] + full: [TOC levels=5 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 8 +levels=6 +. +'levels=6' => TocOptions { levels=124, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6] + full: [TOC levels=6 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:VALID +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 9 +levels=7 +. +'levels=7' => TocOptions { levels=124, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6] + full: [TOC levels=6 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:WEAK_WARNING + Message[7, 8] message:levels option value 7 truncated to range [2, 6] +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 10 +levels=8 +. +'levels=8' => TocOptions { levels=124, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6] + full: [TOC levels=6 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:WEAK_WARNING + Message[7, 8] message:levels option value 8 truncated to range [2, 6] +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 11 +levels=9 +. +'levels=9' => TocOptions { levels=124, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6] + full: [TOC levels=6 bullet formatted hierarchy] +. +Example[0, 8] + Style[0, 8] + TocOptions[0, 8] status:WEAK_WARNING + Message[7, 8] message:levels option value 9 truncated to range [2, 6] ```````````````````````````````` Level ranges -```````````````````````````````` example TocOptionsParser: 3 +```````````````````````````````` example TocOptionsParser: 12 levels=1-3 levels=3-1 levels=0-9 @@ -156,9 +207,73 @@ Example[0, 34] ```````````````````````````````` +```````````````````````````````` example TocOptionsParser: 13 +levels=-3 +levels=-1 +levels=-6 +levels=-9 +. +'levels=-3 ' => TocOptions { levels=14, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=1-3] + full: [TOC levels=1-3 bullet formatted hierarchy] +'levels=-1 ' => TocOptions { levels=2, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=1] + full: [TOC levels=1 bullet formatted hierarchy] +'levels=-6' => TocOptions { levels=126, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=1-6] + full: [TOC levels=1-6 bullet formatted hierarchy] +'levels=-9' => TocOptions { levels=126, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=1-6] + full: [TOC levels=1-6 bullet formatted hierarchy] +. +Example[0, 41] + Style[0, 10] + TocOptions[0, 9] status:VALID + Style[11, 21] + TocOptions[11, 20] status:VALID + Style[22, 31] + TocOptions[22, 31] status:VALID + Style[32, 41] + TocOptions[32, 41] status:WEAK_WARNING + Message[39, 41] message:levels option value -9 truncated to range [1, 6] +```````````````````````````````` + + +```````````````````````````````` example TocOptionsParser: 14 +levels=1- +levels=3- +levels=6- +levels=9- +. +'levels=1-' => TocOptions { levels=126, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=1-6] + full: [TOC levels=1-6 bullet formatted hierarchy] +'levels=3-' => TocOptions { levels=120, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=3-6] + full: [TOC levels=3-6 bullet formatted hierarchy] +'levels=6-' => TocOptions { levels=64, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6,6] + full: [TOC levels=6,6 bullet formatted hierarchy] +'levels=9-' => TocOptions { levels=64, isHtml=false, isTextOnly=false, isNumbered=false, titleLevel=1, title='Table of Contents', listType=HIERARCHY, divClass='', listClass='' } + diff: [TOC levels=6,6] + full: [TOC levels=6,6 bullet formatted hierarchy] +. +Example[0, 39] + Style[0, 9] + TocOptions[0, 9] status:VALID + Style[10, 19] + TocOptions[10, 19] status:VALID + Style[20, 29] + TocOptions[20, 29] status:VALID + Style[30, 39] + TocOptions[30, 39] status:WEAK_WARNING + Message[37, 39] message:levels option value 9- truncated to range [6, 6] +```````````````````````````````` + + other options, not using sim-toc -```````````````````````````````` example TocOptionsParser: 4 +```````````````````````````````` example TocOptionsParser: 15 html markdown numbered @@ -235,7 +350,7 @@ Example[0, 90] other options, using sim-toc -```````````````````````````````` example(TocOptionsParser: 5) options(sim-toc) +```````````````````````````````` example(TocOptionsParser: 16) options(sim-toc) html markdown numbered @@ -310,7 +425,7 @@ Example[0, 90] ambiguous options don't exist yet -```````````````````````````````` example(TocOptionsParser: 6) options(IGNORE) +```````````````````````````````` example(TocOptionsParser: 17) options(IGNORE) html markdown numbered @@ -324,7 +439,7 @@ formatted invalid options -```````````````````````````````` example TocOptionsParser: 7 +```````````````````````````````` example TocOptionsParser: 18 htmls markdowns snumbered