Skip to content

Commit 4c8e653

Browse files
committed
Documentation
1 parent 3c5f94f commit 4c8e653

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/setup/setting-up-tags.md

+28
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,34 @@ The following configuration options are available:
136136
tags_slugify_separator: "-"
137137
```
138138

139+
[`tags_compare`](#+tags.tags_compare){ #+tags.tags_compare }
140+
141+
: [:octicons-tag-24: insiders-4.26.2][Insiders] · :octicons-milestone-24:
142+
Default: `None` – This option specifies which function to use when
143+
comparing tag values for sorting. If you wish to compare tags irregardless
144+
of casing, use:
145+
146+
``` yaml
147+
plugins:
148+
- tags:
149+
tags_compare: !!python/name:material.plugins.tags.plugin.casefold
150+
```
151+
152+
You can also define your own comparison function which must return a tag
153+
value (as a string) that is used for sorting, and reference it accordingly.
154+
155+
[`tags_compare_reverse`](#+tags.tags_compare_reverse){ #+tags.tags_compare_reverse }
156+
157+
: [:octicons-tag-24: insiders-4.26.2][Insiders] · :octicons-milestone-24:
158+
Default: `false` – This option specifies whether tags are sorted in reverse
159+
order. It is mainly provided for completeness. To change direction, use:
160+
161+
``` yaml
162+
plugins:
163+
- tags:
164+
tags_compare_reverse: true
165+
```
166+
139167
[`tags_allowed`](#+tags.tags_allowed){ #+tags.tags_allowed } :material-alert-decagram:{ .mdx-pulse title="Added on October 2, 2022" }
140168

141169
: [:octicons-tag-24: insiders-4.25.0][Insiders] · :octicons-milestone-24:

0 commit comments

Comments
 (0)