!avYyleMexqjFHoqrME:nixos.org

Nix Documentation

399 Members
Discussion about documentation improvements around the Nix ecosystem78 Servers

Load older messages


SenderMessageTime
16 Jan 2024
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @fricklerhandwerk:matrix.org
That would be cool. Just writing down the EBNF in the first place would be way cooler though because the first is cosmetic while the second is essential.

I can do that first quite happily!

But then it won't live in the docs "properly", as it won't be formatted per the contributing instructions. Perhaps it can just live in a side branch, where it can still receive reviews?

07:13:48
@bzzm3r:matrix.org@bzzm3r:matrix.orgI was not thrilled when I found out how the EBNF had to be formatted.07:14:08
@bzzm3r:matrix.org@bzzm3r:matrix.orgSo if I can skip that all together for now, I'd be much happier, yes.07:14:17
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @bzzm3r:matrix.org

I can do that first quite happily!

But then it won't live in the docs "properly", as it won't be formatted per the contributing instructions. Perhaps it can just live in a side branch, where it can still receive reviews?

There are no real conventions for it, it just started adding stuff using some dreamt-up EBNF syntax from my faulty memory and wrapping it in a block quote for highlighting.
07:15:21
@bzzm3r:matrix.org@bzzm3r:matrix.org(The other thing I was noticing while writing out the EBNF: it would be very, very nice to be able to link between meta-identifiers. So that would be missing in the first pass too, hopefully not to the chagrin of reviewers.)07:15:28
@bzzm3r:matrix.org@bzzm3r:matrix.orgYeah, the block quotes are what I am referring to: backticking each piece..., putting >07:16:03
@bzzm3r:matrix.org@bzzm3r:matrix.orgWell, I'll give it a go, maybe I was being too lazy.07:16:11
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @bzzm3r:matrix.org
(The other thing I was noticing while writing out the EBNF: it would be very, very nice to be able to link between meta-identifiers. So that would be missing in the first pass too, hopefully not to the chagrin of reviewers.)
All of that would be super nice to have, but it doesn’t matter as long as nothing is written down to begin with. Stressing out about those details just postpones the writing.
07:16:52
@bzzm3r:matrix.org@bzzm3r:matrix.orgAlright, will re-prioritize. Expect something even sooner 07:17:25
@bzzm3r:matrix.org@bzzm3r:matrix.org(Will do it piecemeal too)07:17:33
@bzzm3r:matrix.org@bzzm3r:matrix.org * (Will do it piecemeal too, tiny PRs)07:17:40
@fricklerhandwerk:matrix.orgfricklerhandwerk
In reply to @bzzm3r:matrix.org
Yeah, the block quotes are what I am referring to: backticking each piece..., putting >
Just give it a go. If I’m at the keyboard I can always fix it up.
07:17:42
@bzzm3r:matrix.org@bzzm3r:matrix.org

fricklerhandwerk: https://github.com/NixOS/nix/pull/9783

I forced myself to stay small. Tried to put most of that aside to prioritize "keep it small" and "get feedback fast and early"; punted plenty to todo lists, and the "Draft" status of the PR.

09:05:14
@bzzm3r:matrix.org@bzzm3r:matrix.org *

fricklerhandwerk: https://github.com/NixOS/nix/pull/9783

I forced myself to stay small. Tried to put most of what I felt would be necessary in a final product aside to prioritize "keep it small" and "get feedback fast and early"; punted plenty to todo lists, and the "Draft" status of the PR.

09:06:07
@bzzm3r:matrix.org@bzzm3r:matrix.org

Am I right in thinking the next part of this PR should be a push which has a guide to the EBNF we plan on using? As much as possible, I want to eliminate ... and use repetition operators.

(Ideally, we would have "raw" EBNF live in a bunch of separate files, which are processed and formatted as markdown, then inserted into the guide for presentation. These files can then also be used to drive parsers. During the processing stage, inter-linking would be performed as well, between the EBNF, and those regions of the documentation that mention something from the EBNF.)

09:13:47
@bzzm3r:matrix.org@bzzm3r:matrix.org *

Am I right in thinking the next part of this PR should be a push which has a guide to the EBNF we plan on using? Especially because: as much as possible, I want to eliminate ... and use repetition operators.

(Ideally, we would have "raw" EBNF live in a bunch of separate files, which are processed and formatted as markdown, then inserted into the guide for presentation. These files can then also be used to drive parsers. During the processing stage, inter-linking would be performed as well, between the EBNF, and those regions of the documentation that mention something from the EBNF.)

09:15:21
@bzzm3r:matrix.org@bzzm3r:matrix.org

are there any downsides to using nix-repl output directly as examples? For example, in the language reference we see the example:

''
  This is the first line.
  This is the second line.
    This is the third line.
''

(is the same as)

"This is the first line.\nThis is the second line.\n  This is the third line.\n"

This could also be presented as:

nix-repl> indentedString =   ''
              This is the first line
              This is the second line
                This is the third line
            '' # "empty-line", it has no non-whitespace characters

nix-repl> indentedString
"This is the first line\nThis is the second line\n  This is the third line\n"
23:33:29
@bzzm3r:matrix.org@bzzm3r:matrix.org I guess the stuff around nix-repl> looks noisy, perhaps. Are there any other downsides? 23:35:07
17 Jan 2024
@bzzm3r:matrix.org@bzzm3r:matrix.org *

are there any downsides to using nix-repl output directly as examples? For example, in the language reference we see the example:

''
  This is the first line.
  This is the second line.
    This is the third line.
''

(whole bunch of language explaining "this is the same as"....)

"This is the first line.\nThis is the second line.\n  This is the third line.\n"

This could also be presented as:

nix-repl> indentedString =   ''
              This is the first line
              This is the second line
                This is the third line
            '' # "empty-line", it has no non-whitespace characters

nix-repl> indentedString
"This is the first line\nThis is the second line\n  This is the third line\n"
05:04:55
@fricklerhandwerk:matrix.orgfricklerhandwerk While there’s no one currently working on it to my knowledge (although Shahar "Dawn" Or (mightyiam) has started work in that direction last year), REPL examples would probably be more hassle for automatic testing, and we really need automatic testing eventually. 07:56:43
@fricklerhandwerk:matrix.orgfricklerhandwerk

My opinion on this somewhat technically unqualified because I haven’t done concrete work on it, but I see a few theoretical advantages to have pairs of code blocks for input/output:

  • No fancy parsing needed, can be hooked into markdown processors. On nix.dev we have highlighting of expression/value pairs which demonstrate this.
  • Easier to type, obvious how to copy paste
  • No implicit state possible or required. State bad.

Generally documentation (and everything, really) should be low-tech so it’s easy to contribute to and understand how it works. That is, it shouldn’t do anything clever, because it will be hard to change for most people if it does, if only because it requires time to figure out. And time is a very scarce resource.

08:02:49
@danielsidhion:nixos.devdanielsidhionThe nix manuals are build with mdbook, which has stuff like https://github.com/FauconFan/mdbook-cmdrun which might be a possible solution for repl testing08:12:47
@danielsidhion:nixos.devdanielsidhion * The nix manuals are built with mdbook, which has stuff like https://github.com/FauconFan/mdbook-cmdrun which might be a possible solution for repl testing08:12:54
@danielsidhion:nixos.devdanielsidhionIdeally the manuals should be able to reuse the same solution, but I find that hard unless the manuals move to mdbook as well (something that I have in a note to maybe explore some day)08:13:44
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @fricklerhandwerk:matrix.org

My opinion on this somewhat technically unqualified because I haven’t done concrete work on it, but I see a few theoretical advantages to have pairs of code blocks for input/output:

  • No fancy parsing needed, can be hooked into markdown processors. On nix.dev we have highlighting of expression/value pairs which demonstrate this.
  • Easier to type, obvious how to copy paste
  • No implicit state possible or required. State bad.

Generally documentation (and everything, really) should be low-tech so it’s easy to contribute to and understand how it works. That is, it shouldn’t do anything clever, because it will be hard to change for most people if it does, if only because it requires time to figure out. And time is a very scarce resource.

Based on your input: https://github.com/NixOS/nix.dev/issues/864

I am not sure if this qualifies as low-tech. Maybe it does because all it uses is a CLI tool. With modern tools, it is easy to make a heavily automatically documented CLI tool (e.g. if using Rust: can use bpaf/clap both convert doc strings into CLI help strings).

However, low-tech ought to be measured against cost-of-manual-work? In this particular case: cost of copying+pasting, verifying output expression against expectation, validating that examples remain valid across Nix updates.

11:05:57
@bzzm3r:matrix.org@bzzm3r:matrix.org
In reply to @fricklerhandwerk:matrix.org

My opinion on this somewhat technically unqualified because I haven’t done concrete work on it, but I see a few theoretical advantages to have pairs of code blocks for input/output:

  • No fancy parsing needed, can be hooked into markdown processors. On nix.dev we have highlighting of expression/value pairs which demonstrate this.
  • Easier to type, obvious how to copy paste
  • No implicit state possible or required. State bad.

Generally documentation (and everything, really) should be low-tech so it’s easy to contribute to and understand how it works. That is, it shouldn’t do anything clever, because it will be hard to change for most people if it does, if only because it requires time to figure out. And time is a very scarce resource.

*

Based on your input: https://github.com/NixOS/nix.dev/issues/864

I am not sure if this qualifies as low-tech. Maybe it does because all it uses is a CLI tool. With modern tools, it is easy to make a heavily automatically documented CLI tool (e.g. if using Rust: can use bpaf/clap both convert doc strings into CLI help strings).

However, low-tech ought to be measured against cost-of-manual-work? In this particular case: cost of copying+pasting, verifying output expression against expectation, validating that examples remain valid across Nix updates.

(Regardless: not a "must-do". Only a "could-do". Happy to execute on a draft version, if time can be made for its review, with full understanding that it will likely not be accepted.)

11:33:17
@bzzm3r:matrix.org@bzzm3r:matrix.org *

Based on your input: https://github.com/NixOS/nix.dev/issues/864

I am not sure if this qualifies as low-tech. Maybe it does because all it uses is a CLI tool. With modern tools, it is easy to make a heavily automatically documented CLI tool (e.g. if using Rust: can use bpaf/clap both convert doc strings into CLI help strings).

However, low-tech ought to be measured against cost-of-manual-work? In this particular case: cost of copying+pasting, verifying output expression against expectation, validating that examples remain valid across Nix updates.

(Regardless: not a "must-do". Only a "could-do". Happy to execute on a draft version, if time can be made for its review, with full understanding that it will likely not be accepted. Will not create a draft version if it only adds to review burden.)

11:34:03
@bzzm3r:matrix.org@bzzm3r:matrix.orgPer your request, even simpler: https://github.com/NixOS/nix/pull/979311:35:04
@bzzm3r:matrix.org@bzzm3r:matrix.org *

Based on your input: https://github.com/NixOS/nix.dev/issues/864

I am not sure if this qualifies as low-tech. Maybe it does because all it uses is a CLI tool. With modern tools, it is easy to make a heavily automatically documented CLI tool (e.g. if using Rust: can use bpaf/clap both convert doc strings into CLI help strings). However, it is still a tool, and the use of a tool necessarily moves us farther away from low-tech.

However, low-tech ought to be measured against cost-of-manual-work? In this particular case: cost of copying+pasting, verifying output expression against expectation, validating that examples remain valid across Nix updates.

(Regardless: not a "must-do". Only a "could-do". Happy to execute on a draft version, if time can be made for its review, with full understanding that it will likely not be accepted. Will not create a draft version if it only adds to review burden.)

12:02:40
@mightyiam:matrix.org@mightyiam:matrix.org bzm3r: the doctester is coming along 12:05:26

Show newer messages


Back to Room ListRoom Version: 6