about summary refs log tree commit diff
path: root/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/types.py
blob: 7814b3a4854b91c4d9f35b476d2802cdf6d53ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
from collections.abc import Sequence, MutableMapping
from typing import Any, Callable, Optional, Tuple, NamedTuple

from markdown_it.token import Token
from markdown_it.utils import OptionsDict

OptionLoc = str | dict[str, str]
Option = dict[str, str | dict[str, str] | list[OptionLoc]]

RenderedOption = NamedTuple('RenderedOption', [('loc', list[str]),
                                               ('lines', list[str])])

RenderFn = Callable[[Token, Sequence[Token], int, OptionsDict, MutableMapping[str, Any]], str]