tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/make-option-docs: add xref support to markdown conversion
pennae
3 years ago
645cfa59
7a091b26
+4
-1
1 changed file
expand all
collapse all
unified
split
nixos
lib
make-options-doc
mergeJSON.py
+4
-1
nixos/lib/make-options-doc/mergeJSON.py
···
72
72
info = f" language={quoteattr(info)}" if info is not None else ""
73
73
return f"<programlisting{info}>\n{escape(text)}</programlisting>"
74
74
def link(self, link, text=None, title=None):
75
75
+
tag = "link"
75
76
if link[0:1] == '#':
77
77
+
if text == "":
78
78
+
tag = "xref"
76
79
attr = "linkend"
77
80
link = quoteattr(link[1:])
78
81
else:
···
82
85
text = ""
83
86
attr = "xlink:href"
84
87
link = quoteattr(link)
85
85
-
return f"<link {attr}={link}>{text}</link>"
88
88
+
return f"<{tag} {attr}={link}>{text}</{tag}>"
86
89
def list(self, text, ordered, level, start=None):
87
90
if ordered:
88
91
raise NotImplementedError("ordered lists not supported yet")