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

Better documentation and docs search for punctuation #33344

Merged
merged 4 commits into from
Oct 8, 2019
Merged

Conversation

mbauman
Copy link
Member

@mbauman mbauman commented Sep 20, 2019

This tries to make documentation for Julia's punctuation and obscure syntaxes a bit more discoverable. Adds keyword doc strings for things like { and [, updates the punctuation chapter of the documentation to include the names of the punctuation characters so its more searchable, and adds a whole slew of cross-links between everything.

I also got sniped into re-writing a bit of the array literal section of the array manual.

Here's one example. Before:

help?> {}
ERROR: LoadError: BoundsError: attempt to access 0-element Array{Any,1} at index [1]
Stacktrace:
 [1] getindex at ./array.jl:728 [inlined]
 [2] astname(::Expr, ::Bool) at ./docs/Docs.jl:287
 [3] namify at ./docs/Docs.jl:277 [inlined]
 [4] lookup_doc(::Expr) at /Users/mbauman/Julia/release-1.2/usr/share/julia/stdlib/v1.2/REPL/src/docview.jl:137
 [5] docm(::LineNumberNode, ::Module, ::Any) at ./docs/Docs.jl:501
 [6] @doc(::LineNumberNode, ::Module, ::Expr, ::Vararg{Expr,N} where N) at ./boot.jl:461
in expression starting at /Users/mbauman/Julia/release-1.2/usr/share/julia/stdlib/v1.2/REPL/src/docview.jl:349

After:

help?> {}
search:

  {}

  Curly braces are used to specify type parameters.

  Type parameters allow a single type declaration to introduce a whole family of new types — one for each possible
  combination of parameter values. For example, the Set type describes many possible types of sets; it uses one type
  parameter to describe the type of the elements it contains. The specific parameterized types Set{Float64} and
  Set{Int64} describe two concrete types: both are subtypes (<:) of Set, but the former has Float64 elements and the
  latter has Int64 elements.

@mbauman mbauman added the docs This change adds or pertains to documentation label Sep 20, 2019
doc/src/base/punctuation.md Outdated Show resolved Hide resolved
doc/src/base/punctuation.md Outdated Show resolved Hide resolved
ViralBShah and others added 2 commits September 21, 2019 09:42
@StefanKarpinski
Copy link
Member

What's required to make progress here? This is a great improvement.

@mbauman
Copy link
Member Author

mbauman commented Oct 1, 2019

I just need to figure out how to make all those cross-links. I poked at it for a little bit but made no progress. I'll try again this afternoon.

@mbauman
Copy link
Member Author

mbauman commented Oct 1, 2019

Hm, I tried all possible combinations of @ref Base.:! / @ref !(x) / @ref Base.!(x) / etc that I could think of and none of them worked. Perhaps this isn't possible at the moment? I'll just move the link over into the left-hand column for now — the auto link on [`!`](@ref) does work as expected.

@StefanKarpinski
Copy link
Member

Who might know how to do this? @mortenpi maybe?

@mbauman
Copy link
Member Author

mbauman commented Oct 1, 2019

I think the relevant issue is JuliaDocs/Documenter.jl#781 — that is, it's not possible at the moment.

@mbauman
Copy link
Member Author

mbauman commented Oct 3, 2019

Test failures are now unrelated. Anything else here?

@mbauman mbauman merged commit 353b6c0 into master Oct 8, 2019
@mbauman mbauman deleted the mb/punct branch October 8, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants