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

doc: include nixdoc for lib.fetchers #362453

Merged
merged 2 commits into from
Dec 30, 2024
Merged

Conversation

nbraud
Copy link
Contributor

@nbraud nbraud commented Dec 6, 2024

Add lib.fetchers to the libset in lib-function-docs.nix

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • nix-build doc
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Dec 6, 2024
@nbraud
Copy link
Contributor Author

nbraud commented Dec 6, 2024

This currently fails to build with the following error:

Running phase: buildPhase
Traceback (most recent call last):
  File "/nix/store/80y31ypfqbv0qggg15n99akgs49rl8na-nixos-render-docs-0.0/lib/python3.12/site-packages/nixos_render_docs/manual.py", line 38, in convert
    self._postprocess(infile, outfile, tokens)
  File "/nix/store/80y31ypfqbv0qggg15n99akgs49rl8na-nixos-render-docs-0.0/lib/python3.12/site-packages/nixos_render_docs/manual.py", line 662, in _postprocess
    raise RuntimeError(f"found duplicate id #{target.id}")
RuntimeError: found duplicate id #sec-functions-library-fetchers

Confusingly, #sec-functions-library-fetchers does not currently exist (as an anchor) in the manual, nor could I find anything resembling it by grepping the documentation.

It could be something like nixdoc's output being somehow included twice, but I do not currently see how that would happen.

@NixOS/documentation-team, I may need some help with that. >_>'

@hsjobeki
Copy link
Contributor

hsjobeki commented Dec 7, 2024

I'll have a look.

@hsjobeki
Copy link
Contributor

hsjobeki commented Dec 8, 2024

@GetPsyched It seems this is caused because of a rendering bug when markup is used in the description. Didn't look into the details yet.

@nbraud

Steps to fix this

  • Remove the anchor from the description:
    description = "functions which can be reused across fetchers

  • Init a new anchor in the redirects.json

nix-shell doc
redirects add-content ❬identifier❭ ❬path❭

Or manually:

redirects.json

"sec-functions-library-fetchers": [
  "index.html#sec-functions-library-fetchers"
]

It seems anchors cannot be used in the description.

If you need more introduction sentences or links you should be able to add them to: /lib/fetchers.nix at the start of the file (see lib/attrsets.nix for example) If you do so please convert the single line comment into a doc-comment: /**snippets that can be shared by multiple fetchers (pkgs/build-support) .... */ This sentence might need to be changed but i am fine of doing this in a seperate PR.

@hsjobeki
Copy link
Contributor

hsjobeki commented Dec 8, 2024

@GetPsyched.

I just found another bug.

Feeding this markdown file causes nrd to never terminate. (Since #somehwhere doesnt exist)

# Heading{#1}

## heading [link](#somewhere) {#id}

@fricklerhandwerk
Copy link
Contributor

Oof. Thanks for investigating @hsjobeki!

@nbraud nbraud marked this pull request as ready for review December 28, 2024 20:57
@nbraud
Copy link
Contributor Author

nbraud commented Dec 28, 2024

Thanks for debugging this, @hsjobeki !

I applied the suggested fix, and can confirm everything now renders as expected.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 30, 2024
@nbraud nbraud merged commit 8ee77c6 into NixOS:master Dec 30, 2024
60 checks passed
@nbraud nbraud deleted the doc/lib/fetchers branch December 30, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 10.rebuild-linux: 1 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants