Conversation
All non internal options should now be documented.
docs/default.nix
Outdated
| Default: `${builtins.toJSON option.default}` | ||
|
|
||
| '' + optionalString (option ? example) '' | ||
| Example: `${builtins.toJSON option.example}` |
There was a problem hiding this comment.
There is one gotcha here, namely that builtins.toJSON will not generate valid Nix code for non-empty lists and non-empty attrsets. The situation is probably also problematic for strings with embedded control characters. However, nixosOptionsDoc.optionsJSON has the same problem. Does nixpkgs contain a function for serializing data as valid Nix? At the same time, as long as none of the corner cases named above apply, using builtins.toJSON should be just fine.
There was a problem hiding this comment.
I found lib.generator.toPretty which comes very close:
nix-repl> v = { a = [ 1 2 3.14159265 { b = ''x\ny''; } ]; c = "z"; d = x: x + 1; }
nix-repl> lib.generators.toPretty {} v
"{ \"a\" = [ 1 2 ~3.141593 { \"b\" = \"x\\ny\"; } ]; \"c\" = \"z\"; \"d\" = <λ>; }"It's not so nice that keys in the attrset are always quoted, but at least it's valid Nix. Functions of course cannot be reasonably serialized so representing them by <λ> is quite okay. The only real problem here is the serialization of floating point numbers. I don't see why it wouldn't just print the internal representation.
|
|
||
| on: | ||
| push: | ||
| branches: [ docs ] |
There was a problem hiding this comment.
Do you want to change this back to master? Or do you plan to keep documentation on the docs branch from now on? Or maybe just use both master and docs?
There was a problem hiding this comment.
I plan to switch it back to master after merging.
|
Adding a new device to robotnix is actually pretty straight-forward. I've added support for Google Nexus 4 (mako) to the LineageOS flavor with just a few lines: https://git.henrimenke.de/henri/android/src/branch/master/mako.nix |
In the context of headings or titles we can still use capital R. Part of my motivation for not titling the project "RobotNix" was to retain the fun comparison with the word "robotnik", and I feel like using the lowercased "robotnix" instead of "Robotnix" also helps a little to not overly emphasize the "robot" part of the name.
Tested on a fresh Pixel 4a from the factory.
Adds support for defaultText option as well as literalExample. Examples included in commit.
|
Made some bigger changes to the documentation that I intend to merge soon. Should be readable at https://docs.robotnix.org/ if you want to see it now. I'll take another look tomorrow to see if I missed any typos or major sections. |
Includes various improvements to robotnix documentation. Robotnix documentation is now built and deployed to docs.robotnix.org
This also now generates reference documentation for each of the robotnix module options. All non-
internaloptions should now be properly documented.Much thanks to @hmenke for his helpful work on this!
TODO:
README.mdinto new documentation structure.debugEnterEnv, etc.)