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

Inline docstring support #228

Open
offlinehacker opened this issue Mar 15, 2014 · 16 comments · May be fixed by #8778
Open

Inline docstring support #228

offlinehacker opened this issue Mar 15, 2014 · 16 comments · May be fixed by #8778
Labels
documentation feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc

Comments

@offlinehacker
Copy link
Contributor

Is there any possibility that nix syntax could be extended and inline docstring support associated with functions would be added like in python? This would be really useful for documentation generation.

@qknight
Copy link
Member

qknight commented Jul 23, 2015

i would like to implement this if someone can sponsor the effort!

would be a great to have autogenerated documentation in assistant, see:
http://blog.lastlog.de/posts/nix-assistant/

(if interested, just contact me via email: [email protected])

@greedy
Copy link
Contributor

greedy commented Sep 7, 2015

I've been thinking about this as well, but was thinking more about doccomments.

I've also been thinking about the possibility of using functors for documented functions so that the documentation is actually part of the value. This makes it easier to deal with the fact that the attribute path used to access a function can't be easily determined. The documentation tool could evaluate stdenv (or any other set) and directly get the documentation for all of its function attributes. Non-function values would have to work some other way though, hmm.

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@Ericson2314
Copy link
Member

I thought https://github.com/tweag/nickel had something along the lines of docstrings.

@stale stale bot removed the stale label Feb 24, 2021
@stale
Copy link

stale bot commented Aug 24, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Aug 24, 2021
@thiagokokada
Copy link

I think this is still important. Having access to :doc builtins.filter inside the nix repl already helps, but I would like this to be extended to any function.

@stale stale bot removed the stale label Nov 11, 2021
@edolstra
Copy link
Member

@thiagokokada See #5527 for a possible way to do this.

@thiagokokada
Copy link

@thiagokokada See #5527 for a possible way to do this.

Nice. Hope that we can eventually adopt this on nixpkgs.

@stale stale bot added the stale label Aug 13, 2022
@fricklerhandwerk fricklerhandwerk added documentation language The Nix expression language; parser, interpreter, primops, evaluation, etc labels Sep 12, 2022
@mightyiam
Copy link
Member

I, @101v and @a-kenji are currently working on a design for in-code documentation of Nix values.

This issue seems to be the correct place for providing updates on that work. So, subscribe to this one, if you're curious or are willing to provide feedback and/or answer our occasional question.

Also, we seek funding for this activity. I've contacted NLnet to that end and haven't heard back yet.

@piegamesde
Copy link
Member

Where does the discussion take place? Can everybody who is interested participate?

(Also, depending on the size of the feature prepare yourselves for going through the RFC process)

@mightyiam
Copy link
Member

Where does the discussion take place? Can everybody who is interested participate?

We work in mob programming format on a regular schedule. Is this something you'd like to try participating in?

@piegamesde
Copy link
Member

No, I'm only available for async discussion.

@blaggacao
Copy link
Contributor

@mightyiam already got an idea about schema? Making unit tests part of the doc (based on examples)? Some ideas can also be observed in styx.

@mightyiam
Copy link
Member

We started by seeing whether we can adopt the rustdoc design. It is markdown. Code examples end up as tests.

@blaggacao
Copy link
Contributor

blaggacao commented Oct 13, 2022

I should have linked to an example, here it goes: https://github.com/styx-static/styx/blob/master/src/lib/utils.nix#L23

We started by seeing whether we can adopt the rustdoc design.

In an attempt to explore forward-compat, you may have a look at Nickel, as well. In case you haven't yet.

zolodev pushed a commit to zolodev/nix that referenced this issue Jan 1, 2024
….4.0

chore(deps): bump sphinx from 4.3.2 to 4.4.0
@hugosenari
Copy link

Related RFC 0145 Doc-comments, not the solution, but have some use case overlap.

@edolstra edolstra removed their assignment Apr 26, 2024
tebowy pushed a commit to tebowy/nix that referenced this issue Jul 11, 2024
having them in checks only does not run them in CI, which can cause
broken release notes entries to pass.

fixes NixOS#228

Change-Id: If0ba7b1be0b6525fc884a27e941cbc84b5a160f9
@roberth roberth linked a pull request Aug 16, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.