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

Keyboard shortcuts for markdown editor #1826

Closed
mkrl opened this issue Feb 18, 2019 · 5 comments
Closed

Keyboard shortcuts for markdown editor #1826

mkrl opened this issue Feb 18, 2019 · 5 comments
Labels
external contributors welcome contribution is welcome!

Comments

@mkrl
Copy link
Contributor

mkrl commented Feb 18, 2019

Is your feature request related to a problem? Please describe.
Having keyboard shortcuts always comes in handy. Next to every single markdown editor (including the one I'm using to write this issue) offers at least a couple of very basic shortcuts for bold/italic/code blocks, etc. Being able to keyboard-ninja comments and posts can greatly benefit user experience.

Describe the solution you'd like
Pressing Ctrl+[key] will format the currently selected text with appropriate tags:

  • B: **bold text**
  • I: _italic_
  • L: [link]() with a cursor moving to the position where you're one ctrl+v away from creating a valid link
  • 1-6: # level 1-6 headers (similar to, let's say, editor.md
  • Something else for liquid tags, maybe with common presets like {% user name %} or {% github thepracticaldev/dev.to %}

The above is subject to discuss of course, there are many different implementations of markdown shortcuts that differ from one library to another.

Describe alternatives you've considered
Coming back to my previously written text and manually arrowing my cursor is the only alternative (not including browser extentions, but a very quick Google search didn't bring up anything worthy).

Additional context
I'm up for taking care about this if it gets approved.

@jessleenyc
Copy link
Contributor

jessleenyc commented Feb 18, 2019

Thanks for the request! We have some shortcuts implemented for comments but I can't see a reason why we wouldn't also have it for posts

@benhalpern
Copy link
Contributor

For implementation, there is a GitHub lib we may want to make use of.

I think it's this one, unless I'm confused: https://github.com/github/hotkey

We could do this on top of the current implementation, but we could migrate towards this library. It makes sense to get inline with GH as an app with similar use cases.

Let me know if I'm mistaken about that being the right library.

@jessleenyc jessleenyc added the external contributors welcome contribution is welcome! label Feb 18, 2019
@BilalBudhani
Copy link

There is also https://github.com/jaywcjlove/hotkeys which is widely used and has a better API. You must consider it as well.

@mkrl
Copy link
Contributor Author

mkrl commented Feb 20, 2019

I would say using a long-run maintained library instead of 1 month old one should be considered as a "more win" for production. Even if the latter is developed by GitHub. Plus, there is a React component ready to go.

@stale
Copy link

stale bot commented May 21, 2019

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding!

@stale stale bot added the stale label May 21, 2019
@stale stale bot closed this as completed Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external contributors welcome contribution is welcome!
Projects
None yet
Development

No branches or pull requests

4 participants