Commit Graph

389 Commits

Author SHA1 Message Date
Austin Horstman
9f77d92ba9
alejandra: add meta.mainProgram 2023-08-03 08:32:46 -05:00
Lorenzo Manacorda
38a927f1fb nixdoc: 2.3.0 -> 2.4.0 2023-07-31 16:55:45 +02:00
Silvan Mosberger
a7e5800273
Merge pull request #243062 from mobusoperandi/doc_watchexec
nixpkgs/NixOS manuals: devmode feature
2023-07-27 16:11:18 +02:00
Pol Dellaiera
478c0fd0a4
Merge pull request #244487 from srid/nixci
nixci: init at 0.1.3
2023-07-27 14:38:18 +02:00
figsoda
5d4857463a pkgs/tools/nix: remove dead code 2023-07-25 12:12:18 -04:00
Sridhar Ratnakumar
5950a71f62 devour-flake: init at 2 2023-07-25 11:22:28 -04:00
Sridhar Ratnakumar
3d1b68c445 nixci: init at 0.1.3 2023-07-25 11:22:28 -04:00
Shahar "Dawn" Or
a064709342 nixpkgs/NixOS manuals: devmode feature
Co-authored-by: Alejandro Sanchez Medina <alejandrosanchzmedina@gmail.com>
2023-07-25 17:03:15 +07:00
Emily
775f683a5a nixos-option: fix expression position calculation
This was causing null pointer dereferences. Pattern copied from Nix
source code.
2023-07-13 23:00:19 +01:00
Emily
7959a16c19 nixos-option: use C++20
Nix uses `-std=c++2a` and the header files require C++20 features. LLVM
is more strict about this, so the build was failing there.
2023-07-13 08:25:28 +10:00
Sandro
f57af4cd1e
Merge pull request #237442 from SuperSandro2000/nixos-option
nixos-option: update to nix 2.15
2023-07-12 00:14:53 +02:00
Sandro Jäckel
38e917e4bf
nixos-option: update to nix 2.15
Co-authored-by: tropf <29873239+tropf@users.noreply.github.com>
2023-07-11 17:13:21 +02:00
figsoda
151b1854f6 nix-init: 0.2.3 -> 0.2.4
Diff: https://github.com/nix-community/nix-init/compare/v0.2.3...v0.2.4

Changelog: https://github.com/nix-community/nix-init/blob/v0.2.4/CHANGELOG.md
2023-07-06 18:34:04 -04:00
pennae
be4d19ff1a doc: render nixpkgs manual with nrd
also updates nixdoc to 2.3.0. the nixdoc update is not a separate commit
because that would leave the manual build broken for one commit,
potentially breaking bisects and rebases.
2023-07-01 20:59:29 +02:00
pennae
538b3d1b3c nixos-render-docs: add footnote support
this is only used in the stdenv chapter, but footnotes could be useful
in other places as well. since markdown-it has a plugin to parse
footnote syntax we may as well just support them even if they're rare.
2023-07-01 20:27:29 +02:00
pennae
ac7be1f106 nixos-render-docs: add support for tables 2023-07-01 20:27:29 +02:00
pennae
8fb4cf8b7c nixos-render-docs: add support for figures 2023-07-01 20:27:29 +02:00
pennae
e5e738b72a nixos-render-docs: genericize block numbering
examples and figures behave identically regarding numbering and titling,
they just don't share a common number space. make the numbering/titling
function generic over block types now so figures can just use it.
2023-07-01 20:27:29 +02:00
pennae
8c2d14a6b8 nixos-render-docs: add image support
currently only supported for html. docbook could also support images,
but it's on the way out for manual generation anyway so we won't add
image support there. options docs can't use images because they also
target manpages, which leaves no viable users.
2023-07-01 20:27:28 +02:00
pennae
b962ff92ff nixos-render-docs: add support for section tocs
the nixpkgs manual uses section tocs for eg the nixpkgs library function
reference. we will only not emit tocs for subsections at this point, but
maybe we should consider doing so in the future.
2023-07-01 18:21:16 +02:00
pennae
2bf3bb4f6b nixos-render-docs: hide nav headers/footers if not needed
there's not point in rendering these if we're rendering to a single file
for all content.
2023-07-01 17:31:29 +02:00
pennae
effbaf0ab4 nixos-render-docs: maybe omit link target files
docbook always emits intra-file links if only a single file is emitted.
it doesn't seem to do this for intra-file links when multiple files are
emitted, so we don't do that yet either.
2023-07-01 17:31:29 +02:00
pennae
8c33134465 nixos-render-docs: don't double-escape link titles 2023-07-01 17:31:29 +02:00
Pol Dellaiera
246000e996 nixos/manual: fix html <p> tag closure 2023-06-28 13:50:48 +02:00
pennae
03ca5a47c1 nixos-render-docs: add missing head tag to html output 2023-06-26 21:13:11 +02:00
figsoda
0415163b68 nixpkgs-lint-community: init at 0.3.0
https://github.com/nix-community/nixpkgs-lint
2023-06-22 10:07:47 -04:00
pennae
c8b4e5d557
Merge pull request #237557 from pennae/dedocbookify-nixos
nixos/doc: dedocbookify
2023-06-19 14:05:03 +02:00
Victor Engmark
7b396875bb nixos-render-docs: De-lint using ruff --fix
This automated de-linting has applied a few different refactors:

- Remove unused imports and variables
- Change f-strings with no variables to regular strings
- Remove trailing semicolon
2023-06-14 14:39:00 +12:00
pennae
34eeac5544 nixos-render-docs: default to markdown for options
docbook is now gone and we can flip the defaults. we won't keep the
command line args around (unlike the make-options-docs argument) because
nixos-render-docs should not be considered an exposed API.
2023-06-13 16:56:31 +02:00
pennae
5f35ae16ec nixos-render-docs: remove literalDocBook support
with literalDocBook itself gone we can also remove the support code in
nixos-render-docs.
2023-06-13 16:56:30 +02:00
figsoda
f03d84d954 gridlock: init at unstable-2023-03-03
https://github.com/lf-/gridlock
2023-05-29 16:52:16 -04:00
maralorn
4414a2d948 nix-output-monitor: 2.0.0.5 -> 2.0.0.6
* Small improvements in error reporting.
* Significant performance improvements.
2023-05-14 23:11:42 +02:00
maralorn
72b021051f nix-output-monitor: comment and cleanup 2023-05-14 23:10:00 +02:00
John Ericson
57445260f0
Merge pull request #229113 from aschmolck/fix-nix-info-help
Fix nix-info --help to exit 0
2023-05-10 17:33:33 -04:00
Sandro Jäckel
00000001b4
treewide: switch builtins.fromJSON(builtins.readFile ./file.json) to lib.importJSON ./file.json #2 2023-05-06 16:20:13 +02:00
pennae
407f6196a2 nixos-render-docs: add examples support
the nixos manual contains enough examples to support them as a proper
toc entity with specialized rendering, and if in the future the nixpkgs
wants to use nixos-render-docs we will definitely have to support them.
this also allows us to restore some examples that were lost in previous
translation steps because there were too few to add renderer support
back then.
2023-05-03 19:58:21 +02:00
Alexander Schmolck
eb811a6ee0 nix-info: fix nix-info --help to exit 0
Previously, --help and -h were treated like an invalid argument.
2023-04-30 13:04:09 +01:00
figsoda
87b94e2e4f nix-init: 0.2.2 -> 0.2.3
Diff: https://github.com/nix-community/nix-init/compare/v0.2.2...v0.2.3

Changelog: https://github.com/nix-community/nix-init/blob/v0.2.3/CHANGELOG.md
2023-04-29 19:27:22 -04:00
figsoda
a6e90dec5f nix-melt: init at 0.1.2 2023-04-26 10:58:09 -04:00
figsoda
c58c844b36 nix-init: 0.2.1 -> 0.2.2
Diff: https://github.com/nix-community/nix-init/compare/v0.2.1...v0.2.2

Changelog: https://github.com/nix-community/nix-init/blob/v0.2.2/CHANGELOG.md
2023-04-23 10:49:07 -04:00
figsoda
d9d363bf3c nixpkgs-hammering: unstable-2022-11-15 -> unstable-2023-03-09
Diff: 1b038ef38f...243b81c687
2023-04-17 10:16:47 -04:00
Dennis Gosnell
c00dc0cf7d
Merge remote-tracking branch 'origin/master' into haskell-updates 2023-03-27 08:42:30 +09:00
Yureka
f8cbc3c281 tree-wide: convert rust with git deps to importCargoLock 2023-03-26 01:52:04 +01:00
Dennis Gosnell
9b7cbce8b2
Merge remote-tracking branch 'origin/master' into haskell-updates 2023-03-23 07:42:17 +09:00
Dennis Gosnell
3009eda91b
nix-output-monitor: use hermes-json-0.2.0.1 2023-03-22 21:46:11 +09:00
figsoda
80a7ce3920 nix-init: 0.2.0 -> 0.2.1
Diff: https://github.com/nix-community/nix-init/compare/v0.2.0...v0.2.1

Changelog: https://github.com/nix-community/nix-init/blob/v0.2.1/CHANGELOG.md
2023-03-21 21:04:45 -04:00
figsoda
f129d39c77 nix-init: 0.1.1 -> 0.2.0
Diff: https://github.com/nix-community/nix-init/compare/v0.1.1...v0.2.0

Changelog: https://github.com/nix-community/nix-init/blob/v0.2.0/CHANGELOG.md
2023-03-20 09:41:23 -04:00
Sandro Jäckel
d1a388ae8e
nixos-render-docs: use packageOverrides to construct python packages 2023-03-14 00:12:34 +01:00
Artturin
47ace7b0af pkgs/tools/nix: enable strictDeps
`fd "\.nix" pkgs/tools/nix | xargs rg "strictDeps" --files-without-match | xargs rg "buildRust|buildGo|buildPyt|buildNim" --files-without-match | xargs vim -p`

checked with Artturin/diffing
2023-03-07 18:13:44 +02:00
pennae
36f04733dd nixos-render-docs: add manual html converter
this converter is currently supposed to be able to reproduce the
docbook-generated html DOMs exactly, though not necessarily the
html *files*. it mirrors many docbook behaviours that seem rather odd,
such as top-level sections in chapters using the same heading depth as
understood by html as their parent chapters do. over time we can
hopefully remove all special casing needed to reproduce docbook
rendering, but for now at least it doesn't hurt *too* much.
2023-02-21 18:26:41 +01:00
pennae
feaa97e5dc nixos-render-docs: render directly from file to file
this will be necessary for html since there we have to do chunking into
multiple files ourselves. writing one file from the caller of the
converter and all others from within the converter is unnecessarily
spread out, and returning a dict of file names and their contents is not
quite as meaningful for docbook (which has only one file to begin with).
2023-02-21 18:26:41 +01:00
pennae
d520d55dee nixos-render-docs: add options html renderer
it's not hooked up to anything yet, but that will come soon. there's a
bit of docbook compat here that must be interoperable with the actual
docbook exporter, but luckily it's not all that much.
2023-02-21 18:26:41 +01:00
pennae
82e62614e9 nixos-render-docs: add html renderer
the basic html renderer. it doesn't have all the docbook compatibility
codes embedded into it, but there is a good amount. this renderer is
unaware of manual structure and does not traverse structural include
tokens (if it finds any it'll just fail), that task falls to derived
classes. once we have more uses for structural includes than just the
manual we may revisit this decision.
2023-02-21 18:26:41 +01:00
pennae
7a74ce51a1 nixos-render-docs: add toc generator
the docbook toolchain uses docbook-xsl to generate its TOC, our html
renderer will have to do this on its own. this generator uses a very
straight-forward algorithm of only inspecting headings, but anything
else could be inspected as well. (examples come to mind, but those do
not have titles and would thus make for bad toc entries)

we also use path information (that will be taken from include block args
in the html renderer) to produce navigation information. the algorithm
we use mirrors what docbook does, linking to the next/previous files in
depth-first toc order.

toc entries are linked to the tokens they refer to for easy use later.
2023-02-21 18:26:41 +01:00
pennae
23dc31a975 nixos-render-docs: allow for options in include blocks
while docbook relies on external chunk-toc info to do chunking of the
rendered manual we have nothing of the sort for html. there it seems
easiest to add annotations to blocks to create new chunks. such
annotations could be extended to docbook to create the chunk-toc instead
of passing it in externally, but with docbook on the way out that seems
like a waste of effort.
2023-02-21 18:26:41 +01:00
pennae
768794d6c1 nixos-render-docs: check book structure
text content in the toplevel file of a book will not render properly.
the first proper element will be a preface, part, or chapter anyway, and
those require includes to produce.

parts do not currently allow headings in the part file itself, but
that's mainly a renderer limitation. we can add support for headings in
part intros when we need them

in all other cases includes must be followed by either another include,
a heading, or end of file. text content could not be properly linked to
from a TOC without a preceding heading.
2023-02-21 18:26:40 +01:00
pennae
163b667352 nixos-render-docs: require headings to have ids
without this we cannot build a TOC to arbitrary depth without generating
ids for headings, but generated ids are fragile and liable to either
break or point to different things if the manual changes shape. we
already have the convention that all headings should have an id, this
formalizes it.
2023-02-21 18:26:40 +01:00
pennae
ba20114460 nixos-render-docs: check heading continuity
while not technically necessary for correct rendering of *contents* we
do need to disallow heading levels being skipped to build a correct
TOC. treating headings that have skipped a number of levels to actually
be headings that many levels up only gets confusing, and inserting
artifical intermediate headings suffers from problems, such as which ids
to use and what to call them.
2023-02-21 18:26:40 +01:00
pennae
7b0824c003 nixos-render-docs: check heading presence during parsing
check that all required headings are present during parsing, not during
rendering. building a correct TOC will need this since every TOC entry
needs a heading to set its title, and every included substructure needs
a title.

also improve the error message on repeated title headings slightly,
giving the end line turns out to not be very useful.
2023-02-21 18:26:40 +01:00
pennae
a7c25bb01f nixos-render-docs: add Freezable class
for most of our data classes we can use dataclasses.dataclass with
frozen=True or even plain named tuples. the TOC structure we'll need to
generate proper navigation links is most easily represented and used as
a cyclic structure though, and for that we can use neither. if we want
to make the TOC structures immutable (which seems like a good idea)
we'll need a hack of *some* kind, and this hack seems like the least intrusive.
2023-02-21 18:26:40 +01:00
pennae
2ab8e742a5 nixos-render-docs: move recursive manual parsing to base class
the html renderer will need all of these functions as well. some
extensions will be needed, but we'll add those as they become necessary.
2023-02-21 18:26:40 +01:00
pennae
5b8be28e66 nixos-render-docs: don't render options during manual parsing
we should really be rendering options at *rendering* time, not at parse
time. currently this is just an academic exercise, but the html renderer
will have to inspect the options.json data after the entire document has
been parsed, but before anything gets rendered.
2023-02-21 18:26:40 +01:00
pennae
068916ae8f nixos-render-docs: keep revision in renderer, not converter
ultimately it's the renderer that needs it, for the options rendering
that will be simplified in a bit.
2023-02-21 18:26:39 +01:00
pennae
6f253fc70b nixos-render-docs: drop options, env parameters
these weren't used for anything. options never was (and does not contain
any information for the renderer that we *want* to honor), and env is
not used because typed renderer state is much more useful for all our cases.
2023-02-21 18:26:39 +01:00
pennae
0236dcb59f nixos-render-docs: don't use markdown-it RendererProtocol
our renderers carry significantly more state than markdown-it wants to
easily cater for, and the html renderer will need even more state still.
relying on the markdown-it-provided rendering functions has already
proven to be a nuisance, and since parsing and rendering are split well
enough we can just replace the rendering part with our own stuff outright.

this also frees us from the tyranny of having to set instance variables
before calling super().__init__ just to make sure that the renderer
creation callback has access to everything it needs.
2023-02-21 18:26:39 +01:00
pennae
417dd2ad16 nixos-render-docs: add options asciidoc converter
same reasoning as for the earlier commonmark converter.
2023-02-21 18:19:00 +01:00
pennae
4d3aef762f nixos-render-docs: add options commonmark converter
the old method of pasting parts of options.json into a markdown document
and hoping for the best no longer works now that options.json contains
more than just docbook. given the infrastructure we have now we can
actually render options.md properly, so we may as well do that.
2023-02-21 18:19:00 +01:00
pennae
6c182075bb nixos-render-docs: forbid attrspans and examples in options
inline anchors are not allowed in option docs per the manual, and the
sole class we current have (.keycap) is never used anyway. disallow them
for now to avoid future surprises.

the same goes for examples, which aren't even documented in the manual yet.
2023-02-21 18:19:00 +01:00
pennae
82d066ffe3 nixos-render-docs: refactor option docs restrictions
move the restrictions we care about into a mixin class. a few more
restrictions will appear soon and a few new converters as well, the
renderers of which need not have these restrictions already baked in by
accident (like the manpage renderer does right now).
2023-02-21 18:19:00 +01:00
pennae
45619b3c4a nixos-render-docs: extend md_make_code
add the ability to set the info string for a newly created fenced code
block, and a flag to always emit a fenced block. the commonmark
converter will need this to faithfully recreate fenced and indented code
blocks.
2023-02-21 18:19:00 +01:00
pennae
895d9e69dd nixos-render-docs: extract md code block factory
the commonmark exporter can make good use once it appears.
2023-02-21 18:19:00 +01:00
pennae
00bffb84da nixos-render-docs: drop frozendict
with mypy type checking and Mapping types this is a lot less useful than
anticipated. let's drop it for simplicity and having fewer dependencies.

frozendict 2.3.5 also broke the mypy checks.
2023-02-21 18:19:00 +01:00
pennae
81cf173256 nixos-render-docs: use multiprocessing for options
options processing is pretty slow right now, mostly because the
markdown-it-py parser is pure python (and with performance
pessimizations at that). options parsing *is* embarassingly parallel
though, so we can just fork out all the work to worker processes and
collect the results.

multiprocessing probably has a greater benefit on linux than on darwin
since the worker spawning method darwin uses is less efficient than
fork() on linux. this hasn't been tested on darwin, only on linux, but
if anything darwin will be faster with its preferred method.
2023-02-18 13:17:57 +01:00
Robert Hensing
b72592ee04
Merge pull request #215973 from pennae/nrd-manual-structure
nixos/manual: specify manual structure in markdown
2023-02-17 18:01:23 +01:00
Felix Buehler
bc3d5934d7 treewide: use lib.optionals 2023-02-14 19:11:59 +01:00
pennae
1229e735ac nixos-render-docs: add structural includes, use for manual
this adds support for structural includes to nixos-render-docs.
structural includes provide a way to denote the (sub)structure of the
nixos manual in the markdown source files, very similar to how we used
literal docbook blocks before, and are processed by nixos-render-docs
without involvement of xml tooling. this will ultimately allow us to
emit the nixos manual in other formats as well, e.g. html, without going
through docbook at all.

alternatives to this source layout were also considered:

a parallel structure using e.g. toml files that describe the document
tree and links to each part is possible, but much more complicated to
implement than the solution chosen here and makes it harder to follow
which files have what substructure. it also makes it much harder to
include a substructure in the middle of a file.

much the same goes for command-line arguments to the converter, only
that command-lined arguments are even harder to specify correctly and
cannot be reasonably pulled together from many places without involving
another layer of tooling. cli arguments would also mean that the manual
structure would be fixed in default.nix, which is also not ideal.
2023-02-12 13:02:42 +01:00
pennae
d30da4d9cd nixos-render-docs: add support for <part>
<part> is different from all other blocks we care about in that it
requires textual content to be wrapped in <partintro>. add support for
this to the generic docbook renderer, which will just assume that a part
is the whole document start to finish. we do make provision for the
manual renderer to close a partintro tag early though.
2023-02-12 11:55:09 +01:00
pennae
ad2b150af7 nixos-render-docs: use Mapping for options converter
this way we can pass in frozendicts from other converters.
2023-02-12 11:55:09 +01:00
pennae
d004105003 nixos-render-docs: print exception trees by __cause__
__context__ is always set to the prior exception, even when not using
the raise from form. __cause__ is only set during raise from. use
__cause__ so we can override a leaf exception (eg KeyError to something
more meaningful).
2023-02-12 11:55:09 +01:00
pennae
652a283e51 nixos-render-docs: render manual chapters during manual build
render all manual chapters to docbook from scratch every time the manual
is built. nixos-render-docs is quick enough at this to not worry about
the cost (needing only about a second), and it means we can remove
md-to-db.sh in the next commit.

no changes to the rendered html manual except for replacements and smartquotes.
2023-02-10 06:40:02 +01:00
pennae
67917ac102 nixos-render-docs: rename manual docbook converter to docbook-section
we'll soon add another docbook converter that does not emit a section as
a collection of chapters, but sections or chapters on their own. this
should clarify naming a bit before there can be any confusion.
2023-02-10 06:40:02 +01:00
pennae
b59b0230ae nixos-render-docs: add example blocks
this is currently only supported by the docbook exporter, and even the
docbook exporter doesn't do much with them. we mirror the conversion
pandoc did for consistency with the previous manual chapter conversion,
which is to add just an anchor with the given id. future exporters that
go directly to html might want to do more.
2023-02-10 06:40:02 +01:00
pennae
bb6526e0de nixos-render-docs: add generic attributed-block parsing
this is a subset of pandoc's fenced divs. currently we only use this for
admonitions (which get a new name to differentiate them from other kinds
of blocks), but more users will appear soon.
2023-02-10 06:40:02 +01:00
pennae
36b0f53f85 nixos-render-docs: promote compact-list attrs to core rule
rules are a better place for this. since _post_parse is now empty (and
presumably will never grow) we'll remove that as well.
2023-02-10 06:40:02 +01:00
pennae
6cd368870b nixos-render-docs: allow dots in heading ids
this is used by release notes (and we don't want to break links to
those), and is also technically allowed anyway. we will *not* extend the
regex to allow more characters just yet due to a mozilla recommendation
against it (cf https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id)
2023-02-10 06:40:02 +01:00
pennae
fd9f6c7501 nixos-render-docs: promote heading id extraction to a core rule
this should've been a core rule from the beginning. not being a core
rule made it always run after smartquotes and replacements, which
could've wrecked the id.
2023-02-10 06:40:02 +01:00
pennae
4b06b82130 nixos-render-docs: add the .keycap class
this lets us parse the `[F12]{.keycap}` syntax we recently introduced to
the nixos manual markdown sources. the docbook renderer emits the keycap
element for this class, the manpage renderer will reject it because it's
not entirely clear what to do with it: while html has <kbd> mandoc has
nothing of the sort, and with no current occurences in options doc we
don't have to settle on a (potentially bad) way to render these.
2023-02-10 06:40:01 +01:00
pennae
67086639e0 nixos-render-docs: add support for full attributed spans
this is pretty much what pandoc calls bracketed spans. since we only
want to support ids and classes it doesn't seem fair to copy the name,
so we'll call them "attributed span" for now. renderers are expected to
know about *all* classes they could encounter and act appropriately, and
since there are currently no classes with any defined behavior the most
appropriate thing to do for now is to reject all classes.
2023-02-10 06:40:01 +01:00
pennae
702e1fc743 nixos-render-docs: add all-features manpage renderer test
now that the renderer produces the output we want to keep for the future
we can add a test that checks all of its features. this test notably
does not include markdown headings since we don't want to have those in
manpages (at least right now), but tests for other converters may add
headings for themselves.
2023-02-08 15:23:34 +01:00
pennae
78052a22cb nixos-render-docs: track links in manpages
for the longest time we completely dropped link targets in
configuration.nix.5.  let's stop doing this now and instead provide a
footnote for each link in a given option, numbered locally per option.

we will currently duplicate the link for <labelless-links> because it
makes it easier to get the collection of all links in a given option.
this may not be useful enough, so over time we might decide to drop the
footnotes for such links.
2023-02-08 15:23:34 +01:00
pennae
3c7fd940ba nixos-render-docs: indent and embolden list item heads in manpages
this matches what html outputs do more closely, and feels like it'll be
easier to read because it looks less like just another paragraph.
2023-02-08 15:23:34 +01:00
pennae
f47adfcb6f nixos-render-docs: make manpage deflists a little nicer
indent the entire list by 4, just like each definition is already
indented by 4. this matches rendering in html, which indents terms once
and indents definitions twice.
2023-02-08 15:23:34 +01:00
pennae
1e4bafdbc5 nixos-render-docs: style file literals in manpages
similar to inline code these were indistinguishale from other text.
render then in italic font instead, like mdoc .Pa does.
2023-02-08 15:23:34 +01:00
pennae
29252d1477 nixos-render-docs: add quotes to inline code in manpages
other output types already have markings for inline code, manpages do
not. this can be somewhat confusing, so we'll do the least intrusive
thing: surrounding inline code blocks in ‘’. doing so separates inline
code from the rest of the text and is unlikely to collide with the
quoted contents. it's also what mdoc does with its Ql macro.
2023-02-08 15:23:34 +01:00
pennae
f33e360f67 nixos-render-docs: remove the ... escape in manpages
this is a holdover from docbook stylesheets. not really sure why they
did that.
2023-02-08 15:23:34 +01:00
pennae
3a3274231e nixos-render-docs: always render links bold in manpages
no reason to differentiate between links by source of their label. this
feature seems to be mostly used to change labels of links to other
options, but this should ultimately be done by auto-linking from
{option}`...`. at some point we may want to introduce a warning when
this pattern is encountered, but there's a lot to work out still before
we can do that.
2023-02-08 15:23:34 +01:00
pennae
5c5dadd382 nixos-render-docs: support compact lists in manpages
most of the lists in option docs are actually compact, but docbook to
manpage processing always rendered them as non-compact. compactifying
these lists improves readability somewhat since most lists and their
contents are pretty short.
2023-02-08 15:23:34 +01:00
pennae
10a4f0daca nixos-render-docs: add options manpage converter
mdoc is just too slow to render on groff, and semantic markup doesn't
help us any for generated pages.

this produces a lot of changes to configuration.nix.5, but only few
rendering changes. most of those seem to be place losing a space where
docbook emitted roff code that did not faithfully represent the input
text, though a few places also gained space where docbook dropped them.
notably we also don't need the compatibility code docbook-xsl emitted
because that problem was fixed over a decade ago.

this will handle block quotes, which the docbook stylesheets turned into
a mess of roff requests that ended up showing up in the output instead
of being processed.
2023-02-08 15:23:34 +01:00
pennae
56f1d99b16 nixos-render-docs: factor out sorting of options list 2023-02-08 15:23:34 +01:00
pennae
b2a5b4d789 nixos-render-docs: move list-is-compact attr to meta
Token.attr is a dict[str, str | int | float], meta has no restriction on
the value type. attrs is ostensibly meant for html attributes, meta for
any information whatsoever.
2023-02-08 15:23:34 +01:00
pennae
09411102f6 nixos-render-docs: add option block separators
this will be necessary for manpages, which separate option declarations
not with external tags but by interspersing mandoc spacing instructions.
2023-02-08 15:23:34 +01:00
pennae
32136b1b01 nixos-render-docs: don't render empty descriptions at all 2023-02-08 15:23:34 +01:00
pennae
11daebd2d9 nixos-render-docs: add block and inline joiners
these work together with render and renderInline to produce an output
from either of the two. rendering manpages will need both: to join
blocks with newlines, and to run some postprocessing and the rendered inlines.
2023-02-08 15:23:34 +01:00
pennae
5a5255983b nixos-render-docs: calculate list end indices
that'll be useful to calculate the width of list item heads, which we'll
ned to render manpages.
2023-02-08 15:23:34 +01:00
pennae
edccae739a nixos-render-docs: add a test for running mypy
pulling mypy into the build closure is unfortunately not reasonable, the
closure for mypy is rather large and takes a long time to build. if we
have the type checks hooked into CI we'll get most of the benefit though.
2023-02-08 15:23:34 +01:00
figsoda
acf0a7d9fd nix-init: 0.1.0 -> 0.1.1
Diff: https://github.com/nix-community/nix-init/compare/v0.1.0...v0.1.1

Changelog: https://github.com/nix-community/nix-init/blob/v0.1.1/CHANGELOG.md
2023-02-06 15:51:57 -05:00
pennae
9711de7b7e nixos-render-docs: improve error messages for multi-title manual chapters 2023-02-03 00:20:59 +01:00
Nick Cao
a74f695255
Merge pull request #210864 from peng1999/nix-info-patch
nix-info: fix error when no channel installed
2023-01-31 18:10:55 +08:00
Peng Guanwen
ffe9031129
Use buitins.currentSystem 2023-01-31 17:56:23 +08:00
pennae
5b6dcece88
Merge pull request #212684 from pennae/nixos-render-docs
nixos-render-docs: init, use for some manual rendering to docbook
2023-01-30 19:26:07 +01:00
figsoda
44187e2a04 nix-init: init at 0.1.0 2023-01-28 15:22:29 -05:00
pennae
8b8670db10 nixos-render-docs: add manual chapter rendering support
this is not yet able to produce manual-combined.xml, but the intention
is to add that support before too long. for now we'll concentrate on
getting the basics working: concatenating a list of chapters into a
manual-combined fragment, which will be rendered via docbook.
2023-01-27 20:07:34 +01:00
pennae
4e2e950ab1 nixos-render-docs: compact lists support
previously we did not detect whether lists were supposed to be compact
or not. this will make a difference for manual chapters, so let's stop
not doing that.
2023-01-27 20:07:34 +01:00
pennae
8e3b2a4eaa nixos-render-docs: add heading id support
as with inline spans we support only ids being set for heading, not
arbitrary attributes or classes.
2023-01-27 20:07:34 +01:00
pennae
82d5698e22 nixos-render-docs: add headings and ordered lists
headings are not supported in options docs (since it's unclear what that
would be in the final manual, and the docbook stylesheets already have
trouble rendering all docbook constructs correctly). ordered lists
should be supported, but obviously nothing uses them yet.
2023-01-27 20:07:34 +01:00
pennae
00a1b41c3b nixos-render-docs: add html comment plugins
options do not use comments, but a number of manual chapters do. since
we don't want to enable html just so we can then inspect the html and
figure out whether it's a comment we'll instead add a plugin that
detects comments natively.
2023-01-27 20:07:34 +01:00
pennae
6829c6c335 nixos-render-docs: add inline anchor plugin
supports the […]{#id} inline anchor syntax. other features of bracketed
spans are intentionally not supported.
2023-01-27 20:07:34 +01:00
pennae
41a5c3a93d nixos-render-docs: prepare for plugins
we will soon add plugins to this tool to support nixos markdown features
that aren't readily supported with markdown-it plugins. since we will
have to test these plugin we'll need access to the parser, and since
we'll also want to add functions that require postprocessing of a parsed
token stream we also add the necessary hooks now.
2023-01-27 20:07:34 +01:00
pennae
c2e638391e nixos-render-docs: use only one container plugin instance
with some fiddling and custom validation logic we can avoid needing
multiple instances of this plugin. originally this wasn't done because
it does need a type stack to emit correct docbook, but since we can
easily do that now we may as well.
2023-01-27 20:07:34 +01:00
pennae
7605068000 nixos-render-docs: add tip and caution admonitions 2023-01-27 20:07:34 +01:00
pennae
e8c5618b67 nixos-render-docs: add some better CLI infrastructure
using environment variables isn't great once multiple input or output
formats get involved (which will happen soon). now is a good time to set
a pattern for future converters.
2023-01-27 20:07:34 +01:00
pennae
e0596e0940 nixos-render-docs: generalize option converter
while we won't have other converters (with other output formats) for a
while yet it still seems like a good idea to generalize *now* so we have
a pattern to follow.
2023-01-27 20:07:34 +01:00
pennae
ccb586299d nixos-render-docs: move options conversion to options module 2023-01-27 20:07:34 +01:00
pennae
aa3fd2865b nixos-render-docs: move some options helpers to new module 2023-01-27 20:07:33 +01:00
pennae
c63a550e7b nixos-render-docs: don't use env for renderer state
since we keep the renderer around for a long time we don't need to stick
renderer state into env, we can use the renderer instance itself instead.
2023-01-27 20:07:33 +01:00
pennae
1016b727a8 nixos-render-docs: add Renderer base class 2023-01-27 20:07:33 +01:00
pennae
5e37d9f29e nixos-render-docs: improve type annotations in docbook 2023-01-27 20:07:33 +01:00
pennae
a4ec68a777 nixos-render-docs: move docbook renderer to docbook module 2023-01-27 20:07:33 +01:00
pennae
986e48ca22 nixos-render-docs: move escaping functions to new modules
these modules will be extended with more functionality. md will
ultimately contain MD-related code such as parsers and converter base
classes. docbook will contain renderers.
2023-01-27 20:07:33 +01:00
pennae
be6a25368f nixos-render-docs: init from optionsToDocbook.py
this new package shall eventually contain the rendering code necessary
to produce the entirety of the nixos (not nixpkgs) manual, in all of its
various output formats.
2023-01-27 20:07:33 +01:00
Jonas Heinrich
da778757da
Merge pull request #211958 from figsoda/nixpkgs-hammering
nixpkgs-hammering: init at unstable-2022-11-15
2023-01-22 07:08:15 +01:00
figsoda
63ff217996 nixpkgs-hammering: init at unstable-2022-11-15 2023-01-21 11:26:21 -05:00
Guillaume Girol
33afbf39f6 treewide: switch to nativeCheckInputs
checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
2023-01-21 12:00:00 +00:00
Peng Guanwen
8bda2c3acc nix-info: fix error when no channel installed
The nix-info script fails when user only use flake.
This patch use the new nix CLI when old fails.
2023-01-15 09:28:20 +00:00
Silvan Mosberger
b3792b44c5 lib: correctly render docs for nested identifiers
Applies https://github.com/nix-community/nixdoc/pull/27 and fixes up the
location information rendering, allowing lib functions to be nested in
further scopes

Needed for later commits
2022-12-23 21:10:16 +01:00
maralorn
f2135573fb nix-output-monitor: 2.0.0.4 -> 2.0.0.5
https://github.com/maralorn/nix-output-monitor/releases/tag/v2.0.0.5
2022-11-28 00:33:37 +01:00
maralorn
eec3739249 nix-output-monitor: 2.0.0.3 -> 2.0.0.4
https://github.com/maralorn/nix-output-monitor/releases/tag/v2.0.0.4
2022-11-21 06:21:55 +01:00
Mario Rodas
77230193fc
Merge pull request #196347 from aaronjheng/nix-store-gcs-proxy
nix-store-gcs-proxy: use buildGoModule
2022-10-28 07:13:55 -05:00
piegames
67cd3c6b65 npins: 0.1.0 → 0.2.0 2022-10-27 23:26:11 +02:00
maralorn
22250fdc68 nix-output-monitor: 2.0.0.2 -> 2.0.0.3 2022-10-25 20:58:39 +02:00
Luna Nova
a824a8ec3e
nix-output-monitor: set meta.mainProgram
Fixes `error: unable to execute '/nix/store/arrb5j23znf00p1i0kvd9bmb7ddamlxx-nix-output-monitor-2.0.0.2/bin/nix-output-monitor': No such file or directory` with nix run
2022-10-21 17:48:24 -07:00
maralorn
0c244fd4cb nix-output-monitor: 2.0.0.1 -> 2.0.0.2 2022-10-19 01:40:48 +02:00
maralorn
7db45269d6 nix-output-monitor: 2.0.0.0 -> 2.0.0.1 2022-10-18 03:42:02 +02:00
Aaron Jheng
6154d63d4c
nix-store-gcs-proxy: use buildGoModule 2022-10-17 03:30:31 +00:00
maralorn
c76bbaa0f5 nix-output-monitor: 1.1.3.0 -> 2.0.0.0 2022-10-15 15:28:37 +02:00
Jamie Quigley
d6ed6a2b8b
alejandra: 2.0.0 -> 3.0.0
Also add self as maintainer
2022-08-16 14:31:58 +01:00
lassulus
f8ec6c6c85 nixos-generators: 1.6.0 -> 1.7.0 2022-08-11 14:20:44 +02:00
kilianar
5eb9bf5565 alejandra: 1.5.0 -> 2.0.0 2022-07-14 17:46:49 +10:00
Mario Rodas
7ca32cf434
Merge pull request #178834 from kamadorueda/alejandra-update
alejandra: 1.4.0 -> 1.5.0
2022-06-24 19:37:13 -05:00
kilianar
6eb44e6fce nar-serve: 0.4.0 -> 0.6.1 2022-06-24 10:50:56 +02:00