Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
writing in atom
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Jan 8, 2015
1 parent 68bb87a commit e791a51
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This book is open source under a Creative Commons license.

To check the current progress and planned content of the book, check out the [outline](outline.md).


## How To Generate the Book

There are two ways to generate e-book content from this source code.
Expand Down
Binary file added book/02-using-atom/images/dictionary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/02-using-atom/images/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/02-using-atom/images/spellcheck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 65 additions & 4 deletions book/02-using-atom/sections/05-writing.asc
Original file line number Diff line number Diff line change
@@ -1,12 +1,73 @@
:compat-mode:
[[_atom_markdown]]
=== Writing in Atom

Though it is probably most common to use Atom to write software code, Atom can also be used to write prose quite effectively. Most often this is done in some sort of markup language such as Markdown or Asciidoc (as this manual is written in).
Though it is probably most common to use Atom to write software code, Atom can also be used to write prose quite effectively. Most often this is done in some sort of markup language such as Markdown or Asciidoc (as this manual is written in). Here we'll quickly cover a few of the tools Atom provides for helping you write prose.

* editing markdown
Here we'll concentrate on writing in Markdown, but other prose markup languages like Asciidoc have packages that provide similar functionality.

==== Spell Checking

If you're workng in text (which includes plain text files, GitHub markdown and Git commit messages by default), Atom will automatically try to check your spelling.

Any misspelled words will be highlighted (by default with a dashed red line beneath the word) and you can pull up a menu of possible corrections by hitting `cmd-:` (or by choosing ``Correct Spelling'' from the right-click context menu or from the Command Palette).

.Checking your spelling
image::images/spellcheck.png[spell checking]

To add more types of files to the list of what Atom will try to spell check, go to the Spell Check package settings in your Settings view and add any grammars you want to spell check.

By default it's set to ``text.plain, source.gfm, text.git-commit'' but you can add something like ``source.asciidoc'' if you wish to check those types of files too.

The Atom spell checker uses the system dictionary, so if you want it to check your spelling in another language or locale, you can change it easily.

.Changing your spell checking dictionary
image::images/dictionary.png[spell check dictionary]

The spell checking is implemented in the https://github.com/atom/spell-check[atom/spell-check] package.

==== Previews

==== Spell Checking
When writing prose in a markup language, it's often very useful to get an idea of what the content will look like when it's rendered. Atom ships with a markdown preview plugin by default.

`cntl-shift-M`:: Will toggle Preview mode for Markdown.

.Preview your prose
image::images/preview.png[preview prose]

As you edit the text, the preview will also update by default. This makes it fairly easy to check your syntax as you type.

You can also copy the rendered HTML from the preview pane into your system clipboard. There is no keybinding for it, but you can find it in the Command Palette by searching for ``Markdown Preview Copy HTML''.

Markdown preview is implemented in the https://github.com/atom/markdown-preview[atom/markdown-preview] package.

==== Snippets

There are also a number of great snippets available for writing Markdown quickly.

If you type `img` and hit `tab` you get Markdown formatted image embed code like `![]()`. If you type `table` and hit `tab` you get a nice example table to fill out.

[source]
----
| Header One | Header Two |
| :------------- | :------------- |
| Item One | Item Two |
----

There are only a handful of them (`b` for bold, `i` for italic, 'code' for a code block, etc), but it can easily save you time from having to look up the more obscure syntaxes. Again, you can easily see a list of all available snippets for the type of file you're currently in by hitting 'alt-shift-S'


==== Wrapping customization

Many people prefer for their prose files to soft wrap lines but not their code. Atom allows you to customize settings for specific grammars, so we can easily override the wrapping settings specifically for our prose files.

Open your config file via the command palette type ``open config'', and hit enter. Add a snippet of configuration text like this:

[source,js]
----
'.source.gfm': # markdown overrides
'editor':
'softWrap': true
----

* spell checking
This will set the soft wrapping on by default for any Markdown files.

0 comments on commit e791a51

Please sign in to comment.