Skip to content

Export function and module docs on Nix #55

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

Merged
merged 2 commits into from
Mar 29, 2025
Merged

Export function and module docs on Nix #55

merged 2 commits into from
Mar 29, 2025

Conversation

PgBiel
Copy link
Member

@PgBiel PgBiel commented Mar 29, 2025

Closes #14

Inspired by gleam-lang/gleam#4147

The code below:

/// Function doc!
pub fn documented() { 1 }

Produces:

let
  /**
     Function doc!
  */
  documented = { }: 1;
in
{ inherit documented; }

Which, since Nix 2.24, can be read as follows from the Nix REPL:

nix-repl> :doc documented                                                                                                                               
  Function documenteddefined at dir/abc.nix:5:16                                                                                                                
                                                                                                                                                          
      Function doc!                                                                                                                                       
                                                                                                                                                          

@PgBiel PgBiel added upstream-parity Things missing in Glistix compared to the upstream compiler nix target Related to the nix target's codegen labels Mar 29, 2025
@PgBiel PgBiel added this to the v0.8.0 milestone Mar 29, 2025
@PgBiel PgBiel changed the title Export function and module docs on nix Export function and module docs on Nix Mar 29, 2025
@PgBiel PgBiel merged commit b9f181c into main Mar 29, 2025
16 of 17 checks passed
@PgBiel PgBiel deleted the feat/export-docs branch March 29, 2025 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nix target Related to the nix target's codegen upstream-parity Things missing in Glistix compared to the upstream compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emit Nix doc comments for functions
1 participant