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

Editor: Markdown toggle #26

Closed
RhettTrickett opened this issue Oct 14, 2019 · 12 comments
Closed

Editor: Markdown toggle #26

RhettTrickett opened this issue Oct 14, 2019 · 12 comments
Assignees

Comments

@RhettTrickett
Copy link
Member

Raised by @Minenash

These posts are in markdown, but we don’t get a markdown editor mode. As someone who writes in markdown all the time, I personally find it easier to edit that way then to use a button bar.

@drenther - Let's discuss the feasibility of this.

@drenther
Copy link
Member

drenther commented Dec 7, 2019

We have had this in mind from the very beginning of designing the new editor's architecture.

We already support all the markdown shortcuts in the rich text editor we have. It's like getting the markdown editing experience with the visuals of rich text editing. I am a little unclear as to what added benefit a raw markdown editor will provide.

@anson-vandoren
Copy link

We already support all the markdown shortcuts in the rich text editor we have

I may be missing something here, but the editor I'm using to create posts definitely doesn't support all or even most markdown.

The immediate benefit for me is that my posts are all originally written in markdown for my personal blog, and when cross-posting here it takes quite a bit of time to paste the markdown into the Able editor and then reformat everything.

Some examples:

  • Pasting # ## etc shows the octothorpe instead of converting to a header
  • Links need to be reformatted with Cmd-K instead of the [text](link) of Markdown
  • Code blocks with ``` don't paste in gracefully, and I need to redo each one

Having actual markdown support in the Able editor would make it much easier for me to post frequently here. The Caret editor does a fantastic job of accepting full markdown while still keeping the rich editor experience, and that's basically what I (and probably @Minenash) was hoping for here as well

@Minenash
Copy link

I'm also one of those people who is more comfortable with pure markdown. While I do occasionally use Word/Writer, most of my typing is done on Discord, Slack, GitHub,etc. I even use a markdown editor application. WYSIWYG is awesome for most people, but some people just like the feel of pure markdown.

There also isn't a shortcut for every button. (And this should really be it's own bug report:) Inline code blocks are annoying to work with.

@drenther
Copy link
Member

drenther commented Dec 24, 2019

I must say that is some great actionable feedback @anson-vandoren @Minenash

We will try solve the issues in the rich text editor and plan on how to support a pure markdown editor toggle.

We are currently occupied with some features that do no involve the editor. But, we intend to resolve all the issues.

To bring some structure may be we can start by listing all the bugs and missing features in the editor in forms of todos in this or a separate issue and tick them off one by one as we go.

Let me know how that sounds. Thanks again for noting these down.

@RhettTrickett
Copy link
Member Author

@Minenash @anson-vandoren this is now in live beta, thanks to @drenther. You can find the option to toggle Markdown mode in the editors Options menu. Try it out and let us know what you think.

@Minenash
Copy link

Minenash commented Jan 13, 2020

Sorry for the delay, haven't been on my PC in the last two days.

This is simply great, I only have three suggestions:

  1. When in Markdown mode, display Markdown Mode where the style buttons would be.
  2. Re-add shortcut support. While this may sound counter-intuitive, it's still useful for the simple bold and italics.
  3. Add a shortcut that swaps from markdown to visual editor. This would make the previewing of the markdown quite a bit faster.

And a general suggestion that probably doesn't need it's own issue:
Have a button somewhere to show all the shortcuts at once.

@anson-vandoren
Copy link

It looks good to me! Only (small) issue I noticed is that Gist links don't seem to show a preview if they're added in Markdown mode. Not a huge deal; switching to Rich Text and pasting in the link again makes everything show up properly.

Thanks! This is a HUGE time-saver when cross-posting from my personal blog, and also the writing style for new posts is a lot more comfortable to me.

@drenther
Copy link
Member

drenther commented Jan 13, 2020

Thanks @anson-vandoren

I will try and fix the issues. Will update here once a fix is deployed.

@drenther
Copy link
Member

Thanks @Minenash for the feedback.

This was a really early version that we wanted to get out as fast as we could.

I agree with the inline formatting shortcuts. It helps even in markdown view (just like we have in Github right here).

We will look into the other things you have listed and keep posting updates as and when we make progress.

Thanks again guys 😊

@RhettTrickett
Copy link
Member Author

Happy Friday all! @drenther has fixed the gist previews and added basic support for bold and italic shortcuts in markdown mode. The latter currently only works in Chromium browsers for now. More coming soon.

Any suggestions for the shortcut keys we can use for toggling markdown mode? Preferably ones that won't clash with other browser shortcuts etc.

cc @Minenash @anson-vandoren

@Minenash
Copy link

Minenash commented Jan 17, 2020

Okay, so I just went through all the keyboard shortcuts of Chrome and Firefox to see which ones are used.

Here's the findings for Ctrl + something layer:

  • No conflicts: ~, \, ;, ', ., /, and Insert
  • Conflicts, but are probably okay to override:
    • u:
      • Chrome (Win/Linux): Display non-editable HTML source code for the current page
      • Firefox: Page Source
      • Why can we still use it: In editing text, Ctrl + u is usually used for underlining, but since Able doesn't support it, and there is little use for someone to want to see the editor's page source while editing an article, it's pretty safe.
    • o:
      • Chrome/Firefox: Open File
      • Why we can still use it: There isn't much use for opening files in Firefox while writing. And if so, there are other ways. (The next 3 will have the same reason)
    • s: Save Page
    • d: Bookmark Page
    • m
      • Chrome (Mac): Minimize Window (This was does actually have a use)
      • Firefox: Mute Audio

Assuming we only want to do Ctrl + something and not add another layer like Shift or Alt/⌥, then in my opinion we should either do ~ because it's easily one-handable with the Ctrl/⌘ key or we use m for windows/linux because it stand for "mode" and ~ or u because mac already has a use for + m.

@RhettTrickett
Copy link
Member Author

Thanks for these Minenash, after discussing internally we've gone with Ctrl + e for now. It doesn't clash with anything and can stand for editor. Using Ctrl + ~ requires an additional keypress on Mac and if you don't use that additional keypress it clashes with the commonly used switch window shortcut which is CMD + `.

Ultimately, I think Ctrl + m would be the best but we just need to make sure this doesn't upset mac users who may use this shortcut to 'minimize' windows. Personally, I don't use it that much and wouldn't mind if it overwrote that. Just not sure about others.

Soumyajit has also added a shortcut for adding hyperlinks in markdown mode using Ctrl + k

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

No branches or pull requests

4 participants