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

RFC implement h4-6 in terminal markdown #10481

Merged
merged 1 commit into from
Mar 20, 2015
Merged

Conversation

hayd
Copy link
Member

@hayd hayd commented Mar 11, 2015

Change underlines for h1 to use \equiv

This competes against #10455 and changes the behaviour to (these are bold in the terminal as before):

md"""
#h1
##h2
###h3
####h4
#####h5
######h6"""

 h1
≡≡≡≡

 h2
====

 h3
––––

 h4
----

 h5
⋅⋅⋅⋅

 h6

My objective was to make these obviously ordered. I'd toyed with throwing ∼ and ≃ into the mix but IMO the hierarchy was actually made less clear... but perhaps there are better character(s) to use here?

Note: \cdot isn't quite monospaced in chrome (whatever font github uses in code blocks), but is for me in mac terminal (perhaps this differs from font-to-font?). I'm not sure what the situation is for windows @tkelman (or if this char is supported??)

cc @one-more-minute @peter1000

@tkelman
Copy link
Contributor

tkelman commented Mar 11, 2015

\cdot looks okay in default Windows console (I see the same non-monospaced thing in chrome), though does not, and h3 and h4 are indistinguishable. Is h3 \emdash ?

@hayd
Copy link
Member Author

hayd commented Mar 11, 2015

@tkelman hmmm, I think it's emdash (these were previously the h2 and h3!)
I see the difference as:

h1-6

@hayd
Copy link
Member Author

hayd commented Mar 11, 2015

@tkelman Ah it wasn't emdash, it was the character before (8211), perhaps it should be emdash! How do these look on Windows:

julia> string(Char(45)) ^ 3
"---"

julia> string(Char(8211)) ^ 3
"–––"

julia> string(Char(8212)) ^ 3
"———"

@tkelman
Copy link
Contributor

tkelman commented Mar 11, 2015

pretty much identical, unfortunately
image

@hayd
Copy link
Member Author

hayd commented Mar 12, 2015

It's frustrating that the bit which doesn't work/isn't distinct is the bit already in master, I wasn't expecting that! Another option was with \sim and \simeq, something like:

with ~

(I wasn't as much a fan of this... maybe we should use €.)

@tkelman
Copy link
Contributor

tkelman commented Mar 12, 2015

simeq is just a question mark. Regular dash looks distinct from emdash when using a better font, but that takes some extra fiddling to set up. 8211 and 8212 look the same though, in Deja Vu Sans Mono.

@hayd
Copy link
Member Author

hayd commented Mar 12, 2015

Yep, 8211 and 8212 are the same for me too (I was just hoping they were different for you, and that might have corrected your problem). I think that rules out simeq.

Is requiring a "good" font that distinguishes h3 (emdash) and h4 (regular dash) a problem?

@MikeInnes MikeInnes self-assigned this Mar 14, 2015
@hayd
Copy link
Member Author

hayd commented Mar 14, 2015

rebased over merge conflict.

Just to summarize where we're at:

Before (in master): if you have a bad font, h2 and h3 may be indistinguishable.
With this PR: If you have a bad font, h3 and h4 may be indistinguishable.

cc @StefanKarpinski (who commented about this in the other PR)

IMO if you have a bad font some things aren't going to display at all (e.g. \sim), so users should be encouraged to use a "good font" during/post-installation... Not being able to distinguish h3 and h4 is a relatively minor inconvenience to useful characters not rendering at all.

@hayd
Copy link
Member Author

hayd commented Mar 20, 2015

@one-more-minute bump! (last one)

MikeInnes added a commit that referenced this pull request Mar 20, 2015
RFC implement h4-6 in terminal markdown
@MikeInnes MikeInnes merged commit 09539ec into JuliaLang:master Mar 20, 2015
@MikeInnes
Copy link
Member

Alright, looking forward to seeing your other changes! FWIW, I have a couple of freer weeks coming up, so I should be able to review things a bit more quickly then.

@hayd hayd deleted the h456 branch March 20, 2015 15:30
@hayd
Copy link
Member Author

hayd commented Mar 20, 2015

awesome, thanks!

@peter1000
Copy link

@hayd

just a question: is h6 supposed to look different from bold or did you settle in the end for just bold.

At least I can not see any difference.. except extra indentation - but all togehter very nice indeed

@hayd
Copy link
Member Author

hayd commented Mar 20, 2015

@peter1000 it's spaced, bold and newline, not sure I'm fully happy with that (but kinda ran out of characters which make sense!... a full-width = as h2 would have perfectly made this up to 6, unfortunately it doesn't exist). I thinking seeing this in some real world examples will confirm whether it makes sense.

Thanks for driving this change, is certainly a big improvement from before.

@peter1000
Copy link

I think there is one to many new line for h6: I know it fits the underlines of the others but it looks bit strange (at least to me).

I think the indentation and the Bold would be good enough. (but this is just my opinon)
For spaced I can not see a difference but maybe it depends also on the fonts.

untitled

using Base.Markdown

md"""
#h1
test
##h2
test
###h3
test
####h4
test
#####h5
test
######Bold
test
#h1
test
##h2
test
###h3
test
####h4
test
#####h5
test
######h6
test

**h6**    only Bold

"""

@hayd
Copy link
Member Author

hayd commented Mar 20, 2015

I agree, one new line is better for h6 (I was being lazy not implementing it, I have a one line fix: changing this line to char != ' ' && println(...).

(The spaced thing is indeed about fonts, these look fine on monospaced fonts, everyone should be using a monospaced font! :) )

 not monospaced (in github's font)
⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅

@peter1000
Copy link

I think you might want to merge your one line fix: changing this line to char != ' ' && println(...).
so that this is final.

Anyway looks great so much better than before.

@hayd
Copy link
Member Author

hayd commented Mar 26, 2015

@peter1000 including that as a commit in #10626.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants