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

Doc-testing: module name appears 6 times #757

Closed
mm3509 opened this issue Jul 6, 2018 · 2 comments
Closed

Doc-testing: module name appears 6 times #757

mm3509 opened this issue Jul 6, 2018 · 2 comments
Labels
Status: Speculative It's unknown if this is something that we wan't to do Type: Enhancement

Comments

@mm3509
Copy link

mm3509 commented Jul 6, 2018

In this StackOverflow answer with a setup for doc-testing, I use the name my_module six times. The file docs/make.jl is:

using Documenter, my_module

makedocs(
    modules = [my_module],
    format = :html,
    sitename = "my_module.jl",
    doctest = true
)

The file docs/src/index.md is:

# Documentation

```@meta
CurrentModule = my_module
DocTestSetup = quote
	import my_module
end
```

```@autodocs
Modules = [my_module]
```

This increases the chances of typos and bugs. I believe Python would take the module name zero times or once. Could Documenter.jl do something similar?

@mortenpi mortenpi added Type: Enhancement Status: Speculative It's unknown if this is something that we wan't to do labels Sep 16, 2018
@mortenpi
Copy link
Member

Apologies for not replying to this earlier.

I don't really see how we could improve on this though. In each case my_module specifies a pretty distinct setting and I don't think we should make too many implicit assumptions. E.g. just because you have CurrentModule = my_module, doesn't necessarily mean that you want DocTestSetup to import it.

We could perhaps provide some shorthands, but I can't really think of any at the moment.

@odow
Copy link
Collaborator

odow commented Oct 31, 2023

I'm doing a triage of open documenter issues and closing issues that are stale. If I've made a mistake, please re-open

Closing as stale. This doesn't seem like a high-priority to fix, and no one else has complained since. It's also a "write once, read many times" thing, so the risk of making typos seems low. (And you'll get a warning or an error if they're incorrect.)

@odow odow closed this as completed Oct 31, 2023
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

3 participants