Skip to content

Commit

Permalink
Updated slugify documentation
Browse files Browse the repository at this point in the history
Unicode, case-sensitive reference setting causes error below.

```
yaml.constructor.ConstructorError: expected a mapping node, but found scalar
```

Update related sections in the documentation to address this issue.

Newer Python-Markdown has `slugify_unicode` built-in, so this

```yaml
markdown_extensions:
  - toc:
      slugify: !!python/name:markdown.extensions.toc.slugify_unicode
```

also works for case-insensitive use cases.

Fixes: ee1e675 ("Update slug reference")
  • Loading branch information
kuanyili authored and squidfunk committed Mar 31, 2024
1 parent e71f00b commit 7d6d8d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/setup/extensions/python-markdown-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ The following configuration options are supported:

<!-- md:option pymdownx.tabbed.slugify -->

: <!-- md:default `toc.slugify` --> This option allows for
: <!-- md:default `None` --> This option allows for
customization of the slug function. For some languages, the default may not
produce good and readable identifiers – consider using another slug function
like for example those from [Python Markdown Extensions][Slugs]:
Expand All @@ -706,7 +706,7 @@ The following configuration options are supported:
``` yaml
markdown_extensions:
- pymdownx.tabbed:
slugify: !!python/object/apply:pymdownx.slugs.slugify
slugify: !!python/object/apply:pymdownx.slugs.slugify {}
```

The other configuration options of this extension are not officially supported
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/extensions/python-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ The following configuration options are supported:
``` yaml
markdown_extensions:
- toc:
slugify: !!python/object/apply:pymdownx.slugs.slugify
slugify: !!python/object/apply:pymdownx.slugs.slugify {}
```

<!-- md:option toc.toc_depth -->
Expand Down

0 comments on commit 7d6d8d7

Please sign in to comment.