-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Library documentation through aiken docs
#185
Conversation
So that we can separate libraries from executable modules if necessary.
There was already a 'parse_sources' function, and 'parse' was actually more about typechecking than parsing.
This require slightly more work and has little benefits at this stage given that the sources are literally inlined in the docs.
See preview: https://aiken-lang.github.io/stdlib/ |
- light-mode uses catpuccin-latte - dark-mode uses catpuccin-mocha
crates/project/src/module.rs
Outdated
impl CheckedModule { | ||
pub fn is_library(&self) -> bool { | ||
self.ast.definitions().any(|def| match def { | ||
Definition::Fn(func_def) => VALIDATOR_NAMES.contains(&func_def.name.as_str()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this check is confusing me a little. Can't we instead just check self.kind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually unused. I figured in the end that we could also just generate docs for validators if they are any 🤷♀️
So this could/should be removed
- [x] Display function arguments using a newline-multiline strategy when the signature gets too long. For example: ``` union_with ( left left: AssocList<key, value> , right right: AssocList<key, value> , with with: fn(key, value, value) -> value ) -> AssocList<key, value> ``` - [x] Show type-aliases as type-aliases in signatures; provided they've been specified as type annotations. Otherwise, fallback to the inferred type. - [x] Do not show argument names in signatures, but show labels when they're present. This reflects more the original intent behind labels (which are meant as public-facing documentation).
📍 Define 'is_library' for 'CheckedModule'
So that we can separate libraries from executable modules if necessary.
📍 Introduce 'docs' for generating documentation for aiken libraries.
📍 Add a 'docs' method to projects, using the newly introduced docs::generate_all
📍 Add command 'docs' for generating project documentation.
📍 Support data-types in documentation.
📍 Fix type-parameter pretty printing (use chevrons)
📍 Refactor project source parsing
There was already a 'parse_sources' function, and 'parse' was actually more about typechecking than parsing.
📍 Implement modules' extra, to get function & module comments in docs.
📍 Apply suggestions from clippy.
📍 Support module constants in docs.
📍 Define HighlightJS definition for Aiken.
📍 Do not show link to source.
This require slightly more work and has little benefits at this stage given that the sources are literally inlined in the docs.
📍 Factor out common module prefix when all modules are under a same namespace.
📍 Adjust docs theme to catppuccin
📍 Add source repository to config & docs.