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

Docstrings not available on the public vars #5

Open
dpetranek opened this issue Dec 6, 2020 · 2 comments
Open

Docstrings not available on the public vars #5

dpetranek opened this issue Dec 6, 2020 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dpetranek
Copy link

I noticed when looking at the implementation of assign that there was a nice docstring for it, but that it gets lost when re-def-ed in statecharts.core. Even for the functions without docstrings my editor provides a nice arglist hint that is pretty useful, which is missing for the statecharts.core vars.

I'm not sure if there's a way to automatically assign the docstrings to another var, but you can do it manually like this:

(def assign ^{:doc "Wrap a function into a context assignment function." :arglists '([f])} impl/assign)
@lucywang000 lucywang000 added good first issue Good for newcomers help wanted Extra attention is needed labels Dec 7, 2020
@lucywang000
Copy link
Owner

Thanks, it is ofc good to have the docs exported.

For clj i think we can use maros to extract the doc from metadata of the var, but for cljs i'm not sure if there is any good way.

Maybe we just need to manually add the docs and arglist like your example.

@mjmeintjes
Copy link

You can have a look at this code (for cljc support) in conjunction with potemkin. It allows you to import functions into a separate namespace and also pulls in the arglist and doc metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants