Skip to content
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

can not insert markdown TOC in Sublime Text, Build 4121 on Macos Catalina 10.15.7. #165

Open
maxim-uvarov opened this issue Oct 27, 2021 · 2 comments

Comments

@maxim-uvarov
Copy link

maxim-uvarov commented Oct 27, 2021

Cannot insert markdown TOC in Sublime Text, Build 4121 on macOS Catalina 10.15.7.
The package was functioning some time ago. Probably before the last update of sublime or macOS. But now it doesn't work.

I used the command "MarkdownTOC: insert markdown toc" in the command palette. TOC wasn't inserted.

I tried to remove the package and install that again - didn't help. I tried to restart Sublime many times (as described here) - didn't help.

That's what I can see in sublime console:

executable: /Applications/Sublime Text.app/Contents/MacOS/sublime_text
application: /Applications/Sublime Text.app
working dir: /
packages path: /Users/maximuvarov/Library/Application Support/Sublime Text 3/Packages
state path: /Users/maximuvarov/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["Git Formats", "HTML-CSS-JS Prettify", "sql-formatter", "Vintage"]
pre session restore time: 0.311552
OpenGL Context Information:
  GL API Version: 4.1 ATI-3.10.22
  GLSL Version: 4.10
  Vendor: ATI Technologies Inc.
  Renderer: AMD Radeon Pro 560X OpenGL Engine
startup time: 0.391117
first paint time: 0.437049
git: using configuration from system git install
git: tracking working dir /Users/maximuvarov/Documents/GitHub/cybernomics
git: tracking working dir /Users/maximuvarov/Documents/GitHub/InternetMarketingAnalyticsUsingPowerBIAndExcel
environment variables loaded using: /bin/zsh -l
reloading python 3.3 plugin 0_package_control_loader.00-package_control
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading python 3.3 plugin 0_package_control_loader.50-pyyaml
reloading plugin Default.block
reloading python 3.3 plugin 0_package_control_loader.55-jsonschema
reloading python 3.3 plugin HTMLBeautify.HTMLBeautify
reloading plugin Default.colors
reloading python 3.3 plugin JSON Reindent.sublime_json_reindent
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading python 3.3 plugin Markdown Images.md_image
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading python 3.3 plugin Markdown Table Formatter.markdown_table_formatter
reloading plugin Default.switch_file
reloading python 3.3 plugin Package Control.1_reloader
reloading plugin Default.symbol
reloading python 3.3 plugin Package Control.2_bootstrap
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin ImagePreview.main
reloading plugin MarkdownTOC.__init__
reloading python 3.3 plugin Package Control.Package Control
reloading python 3.3 plugin SendText.SendText
reloading python 3.3 plugin SmartNewWindow.smart_new_window
reloading python 3.3 plugin SublimeLinter-contrib-markdownlint.linter
reloading python 3.3 plugin SublimeLinter.__init__
reloading python 3.3 plugin SublimeLinter._init
reloading python 3.3 plugin SublimeLinter.active_linters_view
reloading python 3.3 plugin SublimeLinter.busy_indicator_view
reloading python 3.3 plugin SublimeLinter.goto_commands
reloading python 3.3 plugin SublimeLinter.highlight_view
reloading python 3.3 plugin SublimeLinter.log_handler
reloading python 3.3 plugin SublimeLinter.message_view
reloading python 3.3 plugin SublimeLinter.panel_view
reloading python 3.3 plugin SublimeLinter.quick_actions
reloading python 3.3 plugin SublimeLinter.status_bar_view
reloading python 3.3 plugin SublimeLinter.sublime_linter
reloading python 3.3 plugin imagepaste.ImagePaste
reloading python 3.3 plugin imagepaste.utils
reloading python 3.3 plugin JsPrettier.__init__
reloading python 3.3 plugin JsPrettier.JsPrettier
plugins loaded
Package Control: Skipping automatic upgrade, last run at 2021-10-27 15:39:36, next run at 2021-10-27 16:39:36 or after
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1518, in run_
    return self.run(edit)
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 44, in run
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 196, in get_toc
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 196, in <lambda>
ValueError: invalid literal for int() with base 10: ','
reloading settings Packages/User/Package Control.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/Lib/python38/sublime_plugin.py", line 1518, in run_
    return self.run(edit)
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 44, in run
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 196, in get_toc
  File "/Users/maximuvarov/Library/Application Support/Sublime Text 3/Installed Packages/MarkdownTOC.sublime-package/markdowntoc/markdowntoc_insert.py", line 196, in <lambda>
ValueError: invalid literal for int() with base 10: ','
Package Control: All dependencies have been satisfied
@IJumpAround
Copy link

IJumpAround commented Apr 5, 2022

For me the problem was related to copying the example config from the README into my MarkdownToc user settings file. No idea if this is related to the plugin, or a change in how sublime parses settings.

The documentation shows:

levels | string (decimal list separated with ,) | "1,2,3,4,5,6"

However the default settings file has "levels": [1,2,3,4,5,6]

Generating TOC failed with ValueError: invalid literal for int() with base 10: ','
when I had "levels": "1,2,3,4,5,6"
but succeeded when reverted to the default of "levels": [1,2,3,4,5,6]

I suspect it expected to iterate over a list of integers but received a comma separated string instead. That would account for the int() cast throwing an error on a ,.
It would iterate over characters in the string succeeding in casting '1' but failing on the separator.

So changing levels to a python list rather than a comma separated string seems to solve the problem.

This is using sublime build 4126
TOC 4.1.2
MacOS 11.6.2

This was referenced Dec 10, 2023
@0xdevalias
Copy link

0xdevalias commented Dec 10, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants