I could not find things about how to add a tab (or space) in docs markdown. Anyone could please help? Thanks.
"""
a new line after this \\\n is ok.
a tab after this \\\t is NOT ok.
"""
function f()
1
end
help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!
a new line after this
is ok.
a tab after this \ is NOT ok.
Why do you need tabs in Markdown? I think they are just equivalent to space. If you want to use them in code blocks, no special syntax is required:
julia> """
`A\tA`
`A A`
"""
f()
f
help?> f
search: f fd for fma fld fld1 fill fdio frexp foldr foldl flush floor float first fill! fetch fldmod filter falses finally foreach fldmod1 findmin findmax findall filter! function Float64
A A
A A
using v0.7.0, I could not produce what like u did:
julia> """
`a\nb`
`a\tb`
`a b`
"""
function f()
1
end
f
help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!
a b
a b
a b
for the needs of tabs … I mean, it’s always good to have better control of spacing and indentation…
also, the behavior of escape-tab (not within a code block) is kind of weird, consider the following:
\\\t produces \
\\t produces \t
\t produces nothing
is it a “bug”? If it is, where should I go? Is it related to the codes in stdlib/Markdown? Also noted that the official documentation (v0.7.0, v1.0.0, v1) is empty on Markdown.
For me everything works fine on 0.7 and 1.0 (which should be the same, of course):
julia> """
`a\nb`
`a\tb`
`a b`
"""
function f()
1
end
f
help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor
a b
a b
a b
julia> VERSION
v"0.7.0"
It may be something with the interface you are using (is it the REPL directly)?
You shouldn’t ever user tabs, especially in Julia, only spaces, and your editor should help you with indentation.
Using TABs for formatting can lead to unexpected spacing.
You don’t believe me? Look at this thread Just avoid them, as @Tamas_Papp already said. Spaces are fixed size, no matter what editor or viewer use use, thus they are totally predictable and consistent.
I mean, tab could be (or should be) avoided in coding. But what about for docs?
Now, markdown is used inside a doc (i.e. between """s), and multiple spaces are simply ignored! In HTML, I could use things like <br>, or 	 to control spacing.
Somehow, in my (mac version) of v0.7.0, only \\\n works so far…
update: everything (space, tab, newline) is fine inside triple backticks (not single) for my mac v0.7.0. For example:
julia> """
```
a b c
efg
hij
zzz
```
"""
function f()
1
end
f
help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!
a b c
efg
hij
zzz
Yes, as @Sukera said, this is part of the syntax Instead of discovering Markdown experimentally, just looking at some short introduction may be a good investment.