-
Notifications
You must be signed in to change notification settings - Fork 163
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
Prettier display ideas #130
Comments
Thanks. I'm on board with all of these ideas, provided of course that they are implemented as optional features. Inspired by AUCTeX, I use variable-height headers locally much like those described in the post. |
As a first step, fb7b025 adds built-in, customizable support for variable-height header faces. See |
Perhaps you saw, but another step in this direction is that I've also got working, but not fully tested code that does the following:
The thing I'm not sure about is what to do with headings. With header-scaling on (variable height fonts), is that alone enough to identify the level if the markup is hidden? Other options would be to put small "h1", "h2", etc. indicators in front or to add bullets at the front of varying size like in |
After using it bit longer, for the headings I think adding a bit more range for the scaling and perhaps shading the colors slightly for lower level headings will work just fine. If not I can add some other adornment later. It's simple enough to toggle back to displaying the markup as needed. Here's a preview. I think this is going to be really nice—thanks for the ideas! |
markdown-hidden-urls looks useful but perhaps not for me. I appreciate the easy toggle and will play with it. I like that the markup characters [] () are dimmer.
|
As always, thanks for the feedback.
Stay tuned for full markup hiding (as in the screenshot above), which I think is the mode you'll like better and is more in the spirit of this issue... |
I have now added markup hiding via a custom variable This setting superceds URL hiding, since it hides URLs completely rather than simply shortening them. See 8390d07, fd9eb1c, and 6c72cb4 for details. Headings have proven more complicated than expected, because hiding the markup (by setting the Also, beautification of list bullets, blockquotes, and horizontal rules is coming soon. Later I'll work on code blocks, strikethrough, sub/superscripts, footnotes, and so on... |
Looks pretty nice! I ran into something that I didn't realize. Why do markdown-bold-face (and italic, strike-through and I guess metadata-key) inherit from font-lock-variable-face? I didn't notice it because usually my bold text is a link and the link color overrides the bold color. But I have some plain text that's bold and it's showing up not only bold but also a different color than the surrounding text and it (now?) looks odd. |
I noticed that too, links should at least inherit from the |
It has only been that way for ten years, so it's understandable that no-one noticed until the markup was hidden :) Seriously though, I'm not sure if my Emacs at the time (~21 on Linux) could even render bold or italic, but even today italics doesn't work in a terminal, so I also used colors for the faces. I used the Perhaps I can change this now that terminal use is less common and markup can be hidden. In the meantime, as I'm sure you know, the faces are customizable so you can remove the inheritance pretty easily. |
Of course, I don't mind it if you keep it this way. Just some food for thought :P |
I'm definitely a fan of mode faces inheriting from builtin faces and feared I suggested this at some point. :) But in particular for bold and italic I think it's unnecessary to inherit from font-lock faces. There are standard builtin faces "bold" and "italic" that could be used. If italics can't be rendered, it's likely that face does something the user wants. I agree that "link" face is worth considering too. |
Thanks--Also, the reason I didn't set |
There are going to be a lot of changes in the next release, so let's try it out: d2122e1. |
Update: hidden markup works for headings and blockquotes now, too. |
Update: also now unordered list bullets, horizontal rules, and strikethrough. |
Update: now fenced code blocks, definition list items, and sub/superscripts (see GH-134) are supported for markup hiding. I think that's everything--any comments or suggestions on the implementation? Update: Fixed GH issue number referenced above. |
Seems nice. I'm good with how bold and italics works. I think the difference with I don't love that urls now have underlines and are blue, but it's probably the right default and I'll customize markdown-link-face (I typically turn off link underlining in browsers). I think I don't customize the face I like I kinda want headings, when markup is hidden, to be centered. I suspect it won't work well in practice, but I'll throw it out there. I'm thinking centering in this case should have its own user option. Also it should center based on the width of the text on the line. I opened a file with narrow margins in a wider window and realized that I'd want the header centered within the margin and not based on the full width of the window. A complicating factor I know, but just a thought. Also, maybe there should be a way to specify to open files with markup hidden by default? Maybe it should only do this if the buffer is read-only? Overall I think this is great stuff and I'm going to enjoy it a lot. Thanks. |
Thanks for the report. I'm glad you are enjoying it!
I was on the fence about using
I was a worried about performance. I also took a cue from
I agree, but that needs a bit more work. The fenced code block parsing code is pretty complex, and needs to be modified before I can hide those lines.
I'm quite not sure how to do that (maybe some spacing calculations and a padded
I'm not sure at what point in the day you tried it out, but I also noticed that when |
I found an easier way to do this in aebc03e. I'm considering this closed now, but if anyone has other feedback on the new features please feel free to discuss. Thanks again for the suggestions. |
Didn't realize about the bug but that wasn't what I was thinking. My sense is that when opening a file to edit I'll always want markup shown. So I'll set |
Perhaps a new defcustom, something like |
I think raising footnote markers and especially inline footnote text should be optional. At the same time I would suggest to always display sub- and superscripts as, well, sub- and superscripts and not only if |
Thanks, I'll work in some additional options in the next version. |
It might be nice if markdown-mode implemented some of the ideas shown in this post referring to org-mode. In particular, an option to hide the markup for italics or strong and the ability to display nice unicode bullets.
http://www.howardism.org/Technical/Emacs/orgmode-wordprocessor.html
The text was updated successfully, but these errors were encountered: