mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
1.6 KiB
1.6 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| style-markup-mode-label | api | formatter | 20260520 | Convert a StyleMarkupMode value into its stable string label. |
|
Style-markup-mode-label
Convert StyleMarkupMode into its stable string label. This helper is useful for diagnostics, tests, and config inspection output.
Interface
pub fn style_markup_mode_label(mode : StyleMarkupMode) -> String {
input
mode : StyleMarkupMode- Markup mode enum value to label.
output
String- Stable label such asdisabled,builtin, orfull.
Explanation
Detailed rules explaining key parameters and behaviors
- The returned strings match the built-in markup mode vocabulary.
- This helper is presentation-oriented and does not change formatting behavior by itself.
- It is especially useful when tests or logs should expose the active markup policy clearly.
How to Use
Here are some specific examples provided.
When Need A Readable Markup Mode Name
When diagnostics should show which markup mode is active:
let label = style_markup_mode_label(StyleMarkupMode::Builtin)
In this example, label becomes "builtin".
Error Case
e.g.:
-
There is no failure path for valid
StyleMarkupModevalues. -
If code needs behavior rather than display text, the enum value itself is usually more useful than the returned label.
Notes
-
This helper is mainly useful for human-readable inspection and assertions.
-
It pairs naturally with formatter config tests and debug output.