Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert manual to Markdown #3857

Merged
merged 63 commits into from Sep 1, 2020
Merged

Convert manual to Markdown #3857

merged 63 commits into from Sep 1, 2020

Conversation

edolstra
Copy link
Member

@edolstra edolstra commented Jul 24, 2020

This PR converts the Nix manual from DocBook to Markdown.

The manual is currently rendered using mdbook, which is a Rust tool used to format books like The Rust Programming Language. You can see the output here: https://hydra.nixos.org/job/nix/markdown/build.x86_64-linux/latest/download-by-type/doc/manual

Manpages are generated from Markdown using lowdown. The output isn't great but it's good enough.

Most of the conversion was done using Pandoc with some manual cleanups afterwards. Please let me know if you spot any conversion errors.

@Ma27
Copy link
Member

Ma27 commented Jul 26, 2020

While I acknowledge that this will lower the barrier to contribute to our manuals, shouldn't we wait until people came to an agreement in NixOS/rfcs#72 a majority is fine with?

@Profpatsch
Copy link
Member

The lowdown page states (in a footnote):

You may be tempted to write manpages in Markdown, but please don't: use mdoc(7), instead — it's built for that purpose! The man output is for technical documentation only (section 7).

@edolstra
Copy link
Member Author

Some more improvements:

  • The nix command now has a manpage (though most of the subcommands don't have a description yet, just an automatically generated list of flags).

  • The nix.conf manpage / manual section is now generated from the C++ sources. So we no longer have two sets of option descriptions.

  • Similarly, the manual section that lists the builtin functions is generated from the C++ sources. You can now also do :doc builtins.<name> to get documentation about a builtin function (rendered using the lowdown library).

@edolstra
Copy link
Member Author

Unless there are major objections I'd like to merge this (without prejudice to whatever markup language / tools people end up using for Nixpkgs/NixOS). Having a manpage for nix and the :doc command in nix repl alone is worth merging this.

Comment on lines +1159 to +1161
if (evalSettings.pureEval)
throw EvalError("builtins.storePath' is not allowed in pure evaluation mode");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discovered by @9999years..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been there before, but in a slightly different form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committed directly to master lol 👨‍🍳💋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants