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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Link to Definition #47920

Merged
merged 2 commits into from Oct 5, 2018
Merged

docs: Link to Definition #47920

merged 2 commits into from Oct 5, 2018

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Oct 5, 2018

Motivation for this change

Check out this here: http://gsc.io/nixpkgs-docs/html/#sec-functions-library

Located at lib/asserts.nix:21 in .

click that lib/asserts.nix bit and see that 馃敟 馃槏 link to https://github.com/NixOS/nixpkgs/blob/e1c892c29340157e921c5bd2a2489201fa5d2821/lib/asserts.nix#L21 ^.^

Pretty sure the abstraction of the revision finder will cause local users to not rebuild it unnecessarily.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

in pkgs.writeText
"locations.xml"
''
<section xmlns="http://docbook.org/ns/docbook"
Copy link
Member Author

@grahamc grahamc Oct 5, 2018

Choose a reason for hiding this comment

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

This file emits a big ol' XML doc which is xincluded by ID:

<section><title>lib.asserts.assertOneOf</title>
  <para xml:id="lib.asserts.assertOneOf">
  Located at
  <link
    xlink:href="https://github.com/NixOS/nixpkgs/blob/e1c892c29340157e921c5bd2a2489201fa5d2821/lib/asserts.nix#L38">lib/asserts.nix:38</link>
  in  <literal>&lt;nixpkgs&gt;</literal>.
  </para>
  </section>
<section><title>lib.attrsets.attrByPath</title>
  <para xml:id="lib.attrsets.attrByPath">
  Located at
  <link
    xlink:href="https://github.com/NixOS/nixpkgs/blob/e1c892c29340157e921c5bd2a2489201fa5d2821/lib/attrsets.nix#L24">lib/attrsets.nix:24</link>
  in  <literal>&lt;nixpkgs&gt;</literal>.
  </para>
  </section>

Hydra passes the full revision in to the input, which we pass through.

If we don't get this ,we try to get it from other sources, or default to
master which should have the definition in a close-ish location.

All published docs should have theURL resolve properly, only local
hackers will have the link break.
@grahamc
Copy link
Member Author

grahamc commented Oct 5, 2018

Backported in 3bf2c2f and 09b8ed0.

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

Successfully merging this pull request may close these issues.

None yet

2 participants