···337338 # Helper functions.
339340- /* Convert an option, described as a list of the option parts in to a
341- safe, human readable version.
342343 Example:
344 (showOption ["foo" "bar" "baz"]) == "foo.bar.baz"
345- (showOption ["foo" "bar.baz" "tux"]) == "foo.bar.baz.tux"
0346347 Placeholders will not be quoted as they are not actual values:
348 (showOption ["foo" "*" "bar"]) == "foo.*.bar"
349 (showOption ["foo" "<name>" "bar"]) == "foo.<name>.bar"
350-351- Unlike attributes, options can also start with numbers:
352- (showOption ["windowManager" "2bwm" "enable"]) == "windowManager.2bwm.enable"
353 */
354 showOption = parts: let
355 escapeOptionPart = part:
···337338 # Helper functions.
339340+ /* Convert an option, described as a list of the option parts to a
341+ human-readable version.
342343 Example:
344 (showOption ["foo" "bar" "baz"]) == "foo.bar.baz"
345+ (showOption ["foo" "bar.baz" "tux"]) == "foo.\"bar.baz\".tux"
346+ (showOption ["windowManager" "2bwm" "enable"]) == "windowManager.\"2bwm\".enable"
347348 Placeholders will not be quoted as they are not actual values:
349 (showOption ["foo" "*" "bar"]) == "foo.*.bar"
350 (showOption ["foo" "<name>" "bar"]) == "foo.<name>.bar"
000351 */
352 showOption = parts: let
353 escapeOptionPart = part:
···1from abc import ABC
2from collections.abc import Mapping, MutableMapping, Sequence
03from typing import Any, Callable, cast, get_args, Iterable, Literal, NoReturn, Optional
45import dataclasses
···26}
27def md_escape(s: str) -> str:
28 return s.translate(_md_escape_table)
29+30+def md_make_code(code: str, info: str = "", multiline: Optional[bool] = None) -> str:
31+ # for multi-line code blocks we only have to count ` runs at the beginning
32+ # of a line, but this is much easier.
33+ multiline = multiline or info != "" or '\n' in code
34+ longest, current = (0, 0)
35+ for c in code:
36+ current = current + 1 if c == '`' else 0
37+ longest = max(current, longest)
38+ # inline literals need a space to separate ticks from content, code blocks
39+ # need newlines. inline literals need one extra tick, code blocks need three.
40+ ticks, sep = ('`' * (longest + (3 if multiline else 1)), '\n' if multiline else ' ')
41+ return f"{ticks}{info}{sep}{code}{sep}{ticks}"
4243AttrBlockKind = Literal['admonition', 'example']
44···470 __renderer__: Callable[[Mapping[str, str], markdown_it.MarkdownIt], Renderer]
471472 def __init__(self, manpage_urls: Mapping[str, str]):
473+ self._manpage_urls = manpage_urls
474475 self._md = markdown_it.MarkdownIt(
476 "commonmark",
···1# wrap whole file into an attrset
2-1itl: { # no indentation
3$a}
45# form an attrmap per package
···2829 # extract deps
30 /^depend [^.]+$/{
31- s/^depend (.+)$/ deps."\1" = tl."\1";/
3233 # loop through following depend lines
34 :next
35 h ; N # save & read next line
36 s/\ndepend (.+)\.(.+)$//
37- s/\ndepend (.+)$/\n deps."\1" = tl."\1";/
38 t next # loop if the previous lines matched
3940- x; p; x # print saved deps
41 s/^.*\n// # remove deps, resume processing
42 }
43
···1# wrap whole file into an attrset
2+1i{ # no indentation
3$a}
45# form an attrmap per package
···2829 # extract deps
30 /^depend [^.]+$/{
31+ s/^depend (.+)$/ deps = [\n "\1"/
3233 # loop through following depend lines
34 :next
35 h ; N # save & read next line
36 s/\ndepend (.+)\.(.+)$//
37+ s/\ndepend (.+)$/\n "\1"/
38 t next # loop if the previous lines matched
3940+ x; s/$/\n ];/p ; x # print saved deps
41 s/^.*\n// # remove deps, resume processing
42 }
43
+1
pkgs/top-level/aliases.nix
···1299 pyrex096 = throw "pyrex has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-12
1300 pyrit = throw "pyrit has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-01
1301 python = python2; # Added 2022-01-11
01302 python-swiftclient = swiftclient; # Added 2021-09-09
1303 python2nix = throw "python2nix has been removed as it is outdated. Use e.g. nixpkgs-pytools instead"; # Added 2021-03-08
1304 pythonFull = python2Full; # Added 2022-01-11
···1299 pyrex096 = throw "pyrex has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-12
1300 pyrit = throw "pyrit has been removed from nixpkgs as the project is still stuck on python2"; # Added 2022-01-01
1301 python = python2; # Added 2022-01-11
1302+ python-language-server = throw "python-language-server has been removed as it is no longer maintained. Use e.g. python-lsp-server instead"; # Added 2023-01-07
1303 python-swiftclient = swiftclient; # Added 2021-09-09
1304 python2nix = throw "python2nix has been removed as it is outdated. Use e.g. nixpkgs-pytools instead"; # Added 2021-03-08
1305 pythonFull = python2Full; # Added 2022-01-11