Set a configuration option. If the corresponding default value set in [`config`][markdown.extensions.Extension.config] is a `bool` value or `None`, then `value` is passed through [`parseBoolValue`][markdown.util.parseBoolValue] before being stored. Argument
(self, key: str, value: Any)
| 92 | return [(key, self.config[key][1]) for key in self.config.keys()] |
| 93 | |
| 94 | def setConfig(self, key: str, value: Any) -> None: |
| 95 | """ |
| 96 | Set a configuration option. |
| 97 | |
| 98 | If the corresponding default value set in [`config`][markdown.extensions.Extension.config] |
| 99 | is a `bool` value or `None`, then `value` is passed through |
| 100 | [`parseBoolValue`][markdown.util.parseBoolValue] before being stored. |
| 101 | |
| 102 | Arguments: |
| 103 | key: Name of configuration option to set. |
| 104 | value: Value to assign to option. |
| 105 | |
| 106 | Raises: |
| 107 | KeyError: If `key` is not known. |
| 108 | """ |
| 109 | if isinstance(self.config[key][0], bool): |
| 110 | value = parseBoolValue(value) |
| 111 | if self.config[key][0] is None: |
| 112 | value = parseBoolValue(value, preserve_none=True) |
| 113 | self.config[key][0] = value |
| 114 | |
| 115 | def setConfigs(self, items: Mapping[str, Any] | Iterable[tuple[str, Any]]) -> None: |
| 116 | """ |