-
-
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
Convert stdlib to markdown. #14378
Convert stdlib to markdown. #14378
Conversation
Did you do this automatically or by hand? |
Automatic, for most of it, using vim macros. It was done in small steps though to hopefully avoid losing anything. |
Great. Automatic is good since it's less error prone. Thanks for tackling this. |
This is stellar work. The base reformatting commit is big and I'm still scrolling through that in |
5edce89
to
a940db3
Compare
I've changed table rendering to "enclose" rst tables to avoid the trailing whitespace problems, renders the same as before though. The extra whitespace caused by list indents is still included. As far as I can tell it's a simple one line change -rstinline(io::IO, s::AbstractString) = print(io, rstescape(s))
+rstinline(io::IO, s::AbstractString) = print(io, replace(rstescape(s), r"[\s\t\n]+", " ")) to strip it out like it's done for |
Here's a RTDs build of this branch, https://julia-rst-conversion.readthedocs.org/en/mh-purge-rst/#stdlib. The travis 64bit failure looks unrelated, I think. |
Yeah, I don't know what's causing these but I don't think it's anything to do with your doc changes
|
Anything else I need to address here? |
Don't think so, is it all good to go as far as you're concerned? Only potential thing I'd want to double-check is whether there have been doc changes on master since this was opened. I think those would probably cause a conflict though? |
I'll try rebasing to check for that. |
foo ``x + y`` bar... and block math with fenced code blocks ```math x + y ```
Also remove rst block by adding special rst link printing.
'$WORK_DIR' was being treated as an interpolated `Symbol`. Surround it in backticks to avoid this. Also add backticks to paths and enum values in surrounding docs for consistency.
Backslashes in signatures of `writedlm`, `:`, `.\`, and `\` were causing them to be skipped after converting the respective docstrings to markdown from rst. (This appears to fix the problem and not cause any regressions elsewhere, but is a bit of a hack.)
The only significant changes here seem to be the loss of `.. note::`s. Most other changes are extra `\ ` escapes at the end of inline code, inline math, and links. Some code blocks have been indented by an extra space, I've not managed to track down the cause of that, though they should render the same anyway. `make doctest` errors all look related to differences in backtrace line numbers and aren't related to the changes in this commit.
Rebasing went fine, should I push the branch again and trigger a build? The only change here that may be a problem is where anyone has used double backticks for inline code, which will now parse as inline latex, shouldn't cause actual breakages though. |
💯 LGTM! |
Did you re-run the automated steps that did all the work here post-rebasing? Just want to make sure we don't lose any doc changes that have been made over the last couple days. CI looks more or less idle right now. |
We should probably grep for double-but-not-triple backticks to see if there are any false positives there, but that can be done after merging this. |
a940db3
to
2c7aef1
Compare
I've rerun I've pushed the updated branch. |
Thanks. |
This completes the conversion of the stdlib docstrings from a mixture of markdown and rst to just markdown.
This PR consists of the following:
helpdb.jl
into several smaller files based on which module they're from[^footnote]
and[^footnote]: content
:func:
,:ref:
, etc. This is a temporary measure until the manual is also converted to markdown when we can switch to @StefanKarpinski's plan for refs.language == "math"
Base
to remove rst blocks, wrap text at ~92 charsbasedocs.jl
to make thekeyword
docstrings defined there appear more uniform with@doc
, ie. docstring above the object being documented\
s.. note::
syntax doesn't seem to have an equivalent in markdown so I've just made a basic change for now, a header called `notes``, I'll change to something else if anyone has a suggestion for formatting them differently.make doctest
fails currently with incorrect backtrace linenumbers, nothing related to this PR I believe.The best commit to review these changes is probably the last one, 5edce89, most of the diff is just escaped backslash changes, which don't appear to affect the final docs in any way.