-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Documentation Documentation Documentation #9447
Conversation
"Foos the living hell out of x" | ||
foo(x) = ... | ||
|
||
but this is not yet implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just beginning to work on this for Docile. If everything works out right then the 0.3/0.4 documentation transition should be quite smooth.
This is great to have. Mike & Michael, you have really changed the landscape! |
+1e9 – I can't express how important and greatly appreciated your work on this has been. This is going to be one of the bigger deals in 0.4. |
Hmm yes, sorry, I think my word choices were too strong. And I commit agree: the documentation tools are really fabulous! |
Thanks to all this amazing work, we are likely to have great package documentation, which is a big gap in the Julia ecosystem today. |
will bring up docs for the relevant function, macro or string macro respectively. | ||
In Juno using ``Ctrl-D`` will bring up documentation for the object under the | ||
cursor. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Juno mentioned anywhere else in the manual? I don't mind including it, but we may want to include more info about it and other relevant commands perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just a link to Juno's home page.
Is it possible to document whole modules? I'm thinking along the lines of
|
Not yet, but that's a really good idea. Feel free to open an issue to remind me. |
Bump. I see a couple of easily-actionable items in the comments, can those be done and then merge this? |
I was pleased to discover that this works: for (f, op) in ((:add, :+), (:subtract, :-), (:multiply, :*), (:divide, :/))
@eval begin
$f(a,b) = $op(a,b)
end
end
@doc "`add(a,b)` adds `a` and `b` together" ->add
@doc "`subtract(a,b)` subtracts `b` from `a`" ->subtract Feel free to copy/paste this demo in. In general, I'd say this PR only covers the surface of the system, and a somewhat more extensive treatment would be helpful. But this is a great start. |
Glad to see people excited about this! I've tried to address the feedback/spelling mistakes etc. (apologies for taking so long on this) and in the interest of getting this out there I'll go ahead and merge. If I've missed any of the feedback here or anything else could be clearer, please do open an issue and ping me. |
Documentation Documentation Documentation
Yay! Thanks, @one-more-minute. |
Fantastic! Looking forward to everyone transitioning to the new docs now. |
When should an effort begin to migrate Base? Do we first need to have the manual populated from |
That is the first step. We also then need to hook up |
So is there an accepted syntax for cross-referencing other functions/types in the new documentation format? There's been quite a lot of effort put in to make the cross-references; it would be a shame to let that go to waste. |
Currently works with REPL help mode and Structure discussion was here: #8966. +1 for cross referencing/related functions as a standard section (as discussed in that issue). This PR notes
IME best practices rarely emerge naturally, would be great to come up with an example(s) of a "good" doc. |
@hayd I'm concerned that the migration from the current ReST format will be lossy, since the current stdlib docs are quite extensively cross-referenced. Cross-references as a section like "See also:" is insufficient. Most of the current cross-references are inline. |
Have you seen the help for functions like Not to denigrate the work put into the |
These are all valid points. @MichaelHatherly @one-more-minute Should we track the various features we need before we can migrate as a separate issue? |
Yeah, I tried some time ago to convert some docs from rst to md using pandoc and it wasn't really a 1-1 conversion. @jiahao's definitely right. A new issue tracking needed features would probably be worth doing. |
I think it's completely fair to focus on package documentation for now – that's the much more urgent need, nice though it would be to have colourful docs for Base. @jiahao is right that Base is a bit more complicated, though the hard part is mainly decisions like where documentation should live and whether we want to build to RST etc. We have #8967 open where we can discuss those decisions, if anyone has any opinions on them. Things like references are pretty much trivial to implement, e.g. type Reference
obj
end
ref(x) = Reference(x)
writemime(io, "text/restructured", ::Reference) = # ... whatever the appropriate syntax is ...
doc"See also $(ref(fft))" We could also just specialise this to doc"See also [fft]" but I'd need to think some more about how that plays nicely with links. |
@one-more-minute Does this have to be something packages can define/overwrite - so that their references link to the correct page ? |
The |
Mkdocs supports cross references, tables, and Latex equations (with a plugin). References are normal markdown links. Here are two examples: See [IdealDiode](../../lib/electrical/#idealdiode) and [Event](#event). One references a function cited in another file, and one references a link in the same file. That might not be as smart as the Rst approach, but it gets the job done. Mkdocs could be used for the online docs, and features could be incrementally added to Julia's markdown support to improve live HTML. |
I wonder if this should/could be done with @MichaelHatherly's Lexicon. It would be pretty awesome if the docs for the language were generated (from code) in exactly the same way as packages (with the same automated tool). @jiahao I have a PR for MD tables, so that's part of the way there :). Executable code snippets could just be the same as Code objects, but labelled as such... Perhaps we need a tracking issue for all the features needed but we don't yet have? As discussed before, some kind of MetaDoc so you can pass a sequence of labelled sections would be really nice - this would also avoid inconsistent standards for headers in docstrings ( |
@MichaelHatherly IMO being included in base is independent to being required/used to build the docs, I'm not advocating Lexicon be included in base! (Edited for clarity.) |
@hayd, thanks for clarifying that. |
Here's a first pass at writing some meta-documentation for the documentation system. Documentation.
I'll hold off on merging this until the type stuff actually, you know, works, and open it up for feedback in the meantime. Let me know if there's anything you're unsure about that this doesn't clear up.