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

Syntax to distinguish documentation from comments #22

Closed
zimbatm opened this issue Jan 11, 2019 · 2 comments
Closed

Syntax to distinguish documentation from comments #22

zimbatm opened this issue Jan 11, 2019 · 2 comments

Comments

@zimbatm
Copy link
Member

zimbatm commented Jan 11, 2019

It's related to #5

Some languages make the distinction between comments and documentation block by extending the comment syntax. For example in Rust, // is a comment and /// is documentation. It has the nice property of being backward-compatible.

Nix could be extended in a similar way. It could even allow to select the content type of the doc block. Eg:

/**md
# My title
My body
*/

Or (pure text on single line)

/// This is my single-line doc

This would also be an advantage for tooling like nixdoc that have to make the distinction between comments and documentation as it would make the heuristics simpler.

If you think that this is a good idea, let's propose this by using a RFC

@infinisil
Copy link
Collaborator

This is now an RFC!

@infinisil
Copy link
Collaborator

The RFC has been accepted and is now implemented in nixdoc :)

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

No branches or pull requests

2 participants