-
-
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
move Markdown to stdlib #25738
move Markdown to stdlib #25738
Conversation
One question is what to do with the |
A couple other questions that this raises:
|
It returns a MD object. Useful to prevent something wrongly escaped when writing latex in docstring. julia> """
```math
\alpha = 1
```
"""
g(x) = 42
julia> doc"""
```math
\alpha = 1
```
"""
h(x) = 42
help?> g
lpha = 1
help?> h
\alpha = 1 |
Would a |
Yeah, |
That should be fine; we do markdown parsing lazily anyway, so I don't think it's necessary to create an MD object at the point where the doc string is written. |
Looking closer, I see that the purpose of |
I |
But most doc strings (in Base at least) are written with plain strings, not We can keep |
c183a78
to
f3a41de
Compare
f3a41de
to
6f9255f
Compare
6f9255f
to
3a67628
Compare
3a67628
to
a6a08d7
Compare
Reading the above, I was under the impression that I should be able to replace julia> using Markdown
julia> begin
doc"""
$\sqrt{a^2+b^2}=\pm c$
"""
function f1 end
raw"""
$\sqrt{a^2+b^2}=\pm c$
"""
function f2 end
md"""
$\sqrt{a^2+b^2}=\pm c$
"""
function f3 end
end
f3 (generic function with 0 methods)
help?> f1
search: f1 Inf16 ComplexF16 fld1 Float16 fldmod1
\sqrt{a^2+b^2}=\pm c
help?> f2
search: Float32 f2 Inf32 ComplexF32
No documentation found.
f2 is a Function.
# 0 methods for generic function "f2":
help?> f3
search: f3 Inf32 ComplexF32 Float32
No documentation found.
f3 is a Function.
# 0 methods for generic function "f3":
Am I being stupid here? |
I think you are right. Although I'm not good at reading lisp, I guess it's here. Lines 2354 to 2373 in 6c59599
Seem |
Um... ok... somehow, putting a macro that receives special treatment by the parser into a (stdlib) package seems wrong to me. |
Agree, although I think the main issue is the macro getting special treatment by the parser in the first place. Is the special treatment here to cause |
Yes. I think it would make more sense just to allow any string or string macro though. Yes, that would allow silly things like |
I'm putting this up at a pretty early stage so folks know I've decided to do something this crazy, before anyone else attempts such a foolish errand.
I have this to a point where I can build, start the repl, and successfully do
?sin
. Safe to assume more work is needed. I might need help at some point.A lot of the code in Base at the intersection of the docsystem and markdown has to do with searching and displaying documentation, so for now I've moved that code to the REPL package under docview.jl. We might want to do more refactoring in the future.