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

make module docstring an exception from checkdocs = :exports #1103

Open
tpapp opened this issue Aug 20, 2019 · 4 comments
Open

make module docstring an exception from checkdocs = :exports #1103

tpapp opened this issue Aug 20, 2019 · 4 comments
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Enhancement

Comments

@tpapp
Copy link
Contributor

tpapp commented Aug 20, 2019

It is useful to include a docstring for a module, eg

"""
The main entry point for this module is `MyMod.do_stuff()`.

For details, please read the docs.
"""
module MyMod
    # ...
end

However,

makedocs(modules = [MyMod],
         checkdocs = :exports,
         strict = true,
         ...)

will complain about MyMod.MyMod if this docstring is not referenced.

Since it usually does not make much sense to include it in the generated docs, I wonder if it could be made an exception.

@tpapp
Copy link
Contributor Author

tpapp commented Aug 24, 2019

Still could not figure out a workaround for this. Perhaps something like

MyMod.MyMod # hide

would be nice (but currently does not work).

@tpapp
Copy link
Contributor Author

tpapp commented Aug 29, 2019

I would be happy to make a PR, but would appreciate some advice on

  1. how to handle this for the interface (an ignore list in makedocs? a # hide in ```@docs?),
  2. where to start implementing it.

@mortenpi
Copy link
Member

Sorry for not replying earlier -- I wasn't entirely sure how I felt about the proposal. In my opinion, you should just include the module docstring, e.g. as a last thing on the index page. Otherwise, you'll probably end up duplicating whatever is in there.

However, the ability to tell checkdocs to ignore a few docstrings could be handy, also in other situations.

I don't think # hide in an at-docs block is the way to go though -- you're deciding not to include something you just included? Also, you're configuring something that is global to the whole document.

An argument to makedocs makes probably the most sense. It could perhaps be a quote ... end expression, using the same syntax as in an at-docs block? The same machinery could then be used to parse it (might need some refactoring; see Expanders.jl).

@mortenpi mortenpi added Type: Enhancement Status: Speculative It's unknown if this is something that we wan't to do labels Aug 30, 2019
@tpapp
Copy link
Contributor Author

tpapp commented Oct 3, 2024

Reviving this old issue. I would still find this functionality useful.

As for the API, a list of symbols to ignore, to be provided as an argument to makedocs, would make the most sense for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants