Ghost/ghost/admin/lib/gh-koenig
Ryan McCarvill 848eda5656 🐜 Card Menu Default State Enter Action (#600)
closes https://github.com/TryGhost/Ghost/issues/8196

The default state of both the '/' and '+' card menus is a selection of -1, this ensure that the active tool prompt isn't shown until the user presses an arrow key for keyboard selection. However -1 isn't a valid tool id so when pressing enter without selecting a tool the user will cause an error.

This update ensures that the selected tool is the first tool available even if the selection is in fact -1.
2017-03-21 14:05:49 +00:00
..
addon 🐜 Card Menu Default State Enter Action (#600) 2017-03-21 14:05:49 +00:00
app 👯 ♥️ ♣️ ♦️ ♠️ New editor card menu (#580) 2017-03-14 11:59:34 +00:00
public/tools remove unused codemirror files 2017-03-02 15:15:27 +00:00
test-support Koenig tests. (#564) 2017-03-07 23:57:09 +13:00
.gitignore Koenig tests. (#564) 2017-03-07 23:57:09 +13:00
index.js turn on linting for the editor, fix errors and match Ghost-Admin styles 2017-03-02 16:51:57 +00:00
package.json fix missing template compiler warning for gh-koenig 2017-03-02 18:56:32 +00:00
README.md renamed to koenig 2017-03-02 09:56:52 +00:00

gh-koenig

This is the new mobiledoc editor for Ghost-Admin. It's still a work in progress but we're very excited about it.

Here are a few of our goals:

  • To make the best ghosh darn writing experience on the interwebs.
  • To build a tool that works just as well for non technical content creators as power users.
  • To support rich content as easily as dealing with an image. Want a poll mid article? You got it. Want to paste a complete NG application in raw HTML? You got it.

When embarking on this project the last thing we wanted was to use one of those WYSIWYG editors with the million options and incomprehensible and inconsistent markup (you know who I'm talking about), to that end we chose to build our editor on top of mobiledoc-kit, you can read more about our decision here.

So why mobiledoc?

Mobiledoc is a new format for storing rich content, it's platform independent and isn't tied specifically to HTML (we can render a plain text version for a search index for instance). It allows for the embedding of rich applications inside your content using the cards paradigm. It's also a standard so content written in and for Ghost is compatible with any other mobiledoc system, and vice versa.

To us it seemed like the best compromise between a feature rich WYSIWYG editor and the markdown that we so love.

Like Ghost, Mobiledoc-kit is still moving towards its 1.0 release - it still has some bugs, but we're working together to make something really fun.

To try it out:

  • clone this repo
  • cd gh-koenig
  • npm install && bower install
  • ember serve
  • Visit http://localhost:4200
  • Click in the middle to activate the editor

If you want to help out:

A fantastic guide on the Ghost workflow is here: https://github.com/TryGhost/Ghost/wiki/Git-workflow, it's well worth a read.

Some features of the editor.

gh-koenig is very much a WYSIWYG editor but it supports a subset of markdown as content shortcuts for those of us who are mouse adverse, specifically:

# H1
## H2
### H3
1. Ordered Lists
* Unordered Lists
- Unordered Lists
> Block Quote
*italic*
_italic_
**bold**
__bold__
~~strikethrough~~
[link](http://www.ghost.org)
![image](https://ghost.org/assets/logos-f93942864f8c9f4a0a9b0ecd6f7f055c.png)
``` code blocks (generates a new markdown card) ```

There's also an inline menu that you can access by pressing the / key within the editor.

Right now we only have three built in "cards", a markdown card, an HTML card, and an Image card. But we plan to add the ability to install custom cards in the near future and have some big and exciting plans (and we're even more excited about what the community will do with it.), so watch this space.

Copyright & License

Copyright (c) 2016-2017 Ghost Foundation - Released under the MIT license.