Comments (9)
The problem is that Blarg
or B
needs to be defined in C
in order for the docstring being able to reference it. So you have to put import ..B
or import ..B: Blarg
in the definition of C
.
It's indeed a quite annoying, but I'm not sure what a "correct" solution would be. If you write [`Blarg`](@ref)
somewhere, how is Documenter supposed to know which Blarg
you are referring to? It's something I might play around with solutions for, though, see the last paragraph in #2453 (comment)
One possible solution might be for Documenter to fall back on Main
if it can't get a binding in the module where the docstring is defined. This would mean that you could import Blarg
in your docs/make.jl
file, and then any reference to Blarg
would fall back to that if necessary. Realistically, that would work quite well at least for the fully qualified name (JDIMD.B.Blarg
, in this case).
from documenter.jl.
Is there a way to make the docs build entirely from the code in src/ only like you do in Rust?
That might be the intent behind #2353, although for now, a "minimal" setup that just includes an @autodocs
block would pretty much do that. That does not get you around the limitations of Julia markdown, or this issue, though.
from documenter.jl.
Thanks for the swift replies!
a "minimal" setup that just includes an
@autodocs
block would pretty much do that.
I was wondering about that already. Something like:
```@autodocs
Modules = [TOPLEVEL]
```
seems to only document what's directly beneath that entry, unless I'm missing something. Can autodocs
be recursive?
from documenter.jl.
No, you have to list all the (sub-)modules. Theoretically, the right-hand-side of Modules =
can be Julia code that's evaluated in Main
(what you define in docs/make.jl
), so you might be able to do something with that to get the list of submodules programmatically.
from documenter.jl.
The problem is that
Blarg
orB
needs to be defined inC
in order for the docstring being able to reference it. So you have to putimport ..B
orimport ..B: Blarg
in the definition ofC
.
I see. That's a pretty hard limitation in my opinion, because:
- I have to at least
import
items into my code that aren't used in the code but only the docs - This runs into the same sort of issue as regular "module resolution", where a type must be defined in an "earlier" module to be used. IIUC this makes it impossible to have some
F.Foo
reference aB.Bar
and vice-versa.
Thank you very much for the feedback! Knowing about the limitations of Documenter
, I'll try my luck writing the documentation in Sphinx for now.
from documenter.jl.
I agree with your diagnosis on the limitations or docstring-@ref
s.
As far as Sphinx is concerned, you might run into more frustrations there. I don't think there's any support for including Julia docstrings in Sphinx, since https://bastikr.github.io/sphinx-julia/ is no longer functional (as far as I could test out). If you do manage to make a Sphinx setup work, I'd be interested to hear about it.
At least as a technical curiosity β more generally, I would recommend trying to stick it out with Documenter. There is value in having a uniform documentation setup with Documenter throughout the ecosystem, just like with virtually all Python packages using Sphinx. Like any system, Documenter has its warts and idiosyncrasies, but once you get over the initial hump of unfamiliarity, it is quite a capable system.
from documenter.jl.
I'm actually going to reopen this, since I think
One possible solution might be for Documenter to fall back on Main if it can't get a binding in the module where the docstring is defined
is something we should very much consider (@mortenpi). I might want to prototype that first, though, with the help of #2453, to see how well it works in practice.
from documenter.jl.
Related Issues (20)
- Recommend installation in `docs` Project.toml? HOT 4
- Unhelpful error during ?template expansion? HOT 2
- ERROR: LoadError: The repo path⦠should not contain the protocol HOT 1
- `&`-s not escape in search results
- New search window does not appear [intermittent] [bug] [regression] HOT 4
- Feature request: ANSI color output in doctests HOT 6
- Wrong `\includegraphics` image path at creating LaTeX output HOT 7
- Separate jldoctest environments HOT 1
- use of the `Base`-internal function `tuple_type_tail`
- Typing `th` into the Documenter.jl search bar throws a javascript error HOT 1
- invalid scape sequence when trying to run jldoctest with filters as standard test HOT 1
- Document Julia types of function options/kwargs
- Is `docs/instantiate.jl` obsolete? HOT 1
- Documenter not finding dynamic documentation HOT 4
- @eval returning @docs blocks don't render as documentation. HOT 5
- Feature proposal: @include blocks HOT 10
- Console shows error when metadata is not present in certain pages HOT 1
- Warn on (ignored) HTML comments in markdown HOT 1
- make.jl fails with git error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documenter.jl.