yacir/markdown-fenced-code-tabs

NameError: global name 'string' is not defined

Closed this issue · 2 comments

When building docs using:

single_block_as_tab: True

I get:

Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\mkdocs\__main__.py", line 228, in <module>
    cli()
  File "C:\Python27\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python27\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Python27\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Python27\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python27\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\mkdocs\__main__.py", line 156, in build_command
    ), dirty=not clean)
  File "C:\Python27\lib\site-packages\mkdocs\commands\build.py", line 379, in build
    build_pages(config, dirty=dirty)
  File "C:\Python27\lib\site-packages\mkdocs\commands\build.py", line 332, in build_pages
    dump_json)
  File "C:\Python27\lib\site-packages\mkdocs\commands\build.py", line 188, in _build_page
    site_navigation=site_navigation
  File "C:\Python27\lib\site-packages\mkdocs\commands\build.py", line 59, in convert_markdown
    extension_configs=config['mdx_configs']
  File "C:\Python27\lib\site-packages\mkdocs\utils\__init__.py", line 366, in convert_markdown
    html_content = md.convert(markdown_source)
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 368, in convert
    self.lines = prep.run(self.lines)
  File "C:\Python27\lib\site-packages\markdown_fenced_code_tabs.py", line 236, in run
    return self._populate_tabs(text).split('\n')
  File "C:\Python27\lib\site-packages\markdown_fenced_code_tabs.py", line 218, in _populate_tabs
    tab_html = str(tab_set)
  File "C:\Python27\lib\site-packages\markdown_fenced_code_tabs.py", line 297, in __str__
    tab_set_id = self._get_tab_id(tab)
  File "C:\Python27\lib\site-packages\markdown_fenced_code_tabs.py", line 283, in _get_tab_id
    ) for _ in range(self.RANDOM_ID_CHAR_LENGTH)
  File "C:\Python27\lib\site-packages\markdown_fenced_code_tabs.py", line 283, in <genexpr>
    ) for _ in range(self.RANDOM_ID_CHAR_LENGTH)
NameError: global name 'string' is not defined

Made pull request to fix.

yacir commented

Thx :)