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

How to automatically include all docstrings from a module? #40

Closed
bluesmoon opened this issue Apr 22, 2016 · 4 comments
Closed

How to automatically include all docstrings from a module? #40

bluesmoon opened this issue Apr 22, 2016 · 4 comments

Comments

@bluesmoon
Copy link

Using Lexicon, we could just write all docstrings from a module into a markdown file. How do we do this with Documenter? I basically want to avoid having to manually add what I want documented to index.md since that means every time a new function is created, it needs to also be added to that file.

@MichaelHatherly
Copy link
Member

Yes, I've thought of adding a {autodocs} code block,

    {autodocs}
    Foo
    Bar

which would do this (Foo and Bar are modules). It's not been implemented yet since I've not decided how the sorting and filtering of docs should behave. Input on that kind of thing would be valuable if you have any.

@bluesmoon
Copy link
Author

yes, that would be great. I would sort as follows:

  1. Module level docs
  2. Exported Types
  3. Exported Constants
  4. Exported Methods

And the order for each will be the order specified in the export list.

@MichaelHatherly
Copy link
Member

And the order for each will be the order specified in the export list.

The actual order in which bindings are exported from a module doesn't get tracked as far as I recall, so it's probably not possible to do that without reparsing source files. names(MyMod) returns exports sorted in alphabetical order, so that might be the best we can do. Other than that your ordering sounds good to me 👍.

@MichaelHatherly
Copy link
Member

An basic {autodocs} has been added in 268162c, which can be adjusted in future if need be. For now I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants