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

small spelling and grammatical corrections #415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ responsible for separating markdown syntax from plain text. The parsers scan the
markdown content and use various rules to produce a list of tokens.

Each token represents either a piece of markdown syntax (for example, the
begining of a fenced code block, a list item, etc.) or plain text that will be
beginning of a fenced code block, a list item, etc.) or plain text that will be
included as-is (escaped) in the final HTML text. The tokens will be later be
used by the [Renderer][renderer] to produce actual HTML.

Expand All @@ -15,7 +15,7 @@ There are three kind of parsing rules in Remarkable:
2. [Block rules][block]
3. [Inline rules][inline]

Each uses different datastructures and signatures. Unless you wish to modify the
Each uses different data structures and signatures. Unless you wish to modify the
internal workflow of Remarkable, you will most probably only deal with Block and
Inline rules.

Expand All @@ -41,13 +41,13 @@ Parsing rules will usually generates at least three tokens:
1. The start or open token marking the beginning of the markdown structure
2. The content token (usually with type `inline` for a block rule, or `text` for
an inline rule)
3. The end or close token makring the end of the markdown structure
3. The end or close token marking the end of the markdown structure

### Tag token

Tag tokens are used to represent markdown syntax. Each tag token represents a
special markdown syntax in the original markdown source. They are usually used
for the open and close tokens. For example the "\`\`\`" at the begining of a
for the open and close tokens. For example the "\`\`\`" at the beginning of a
fenced block code, the start of an item list or the end of a emphasized part of
a line.

Expand All @@ -68,7 +68,7 @@ A text token has a `content` property containing the text it represents.
Inline tokens represent the content of a block structure. These tokens have two
additional properties:

* `content`: The content of the block. This might include inline mardown syntax
* `content`: The content of the block. This might include inline markdown syntax
which may need further processing by the inline rules.
* `children`: This is initialized with an empty array (`[]`) and will be filled
with the inline parser tokens as the inline parsing rules are applied.
Expand Down
10 changes: 5 additions & 5 deletions docs/parsing_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ or several full lines at once and emitting the [tokens][tokens] required to
represent these markdown blocks. For example, block code, blockquotes, headers,
hr, etc.

A block rule is a function expecting the following argumnents:
A block rule is a function expecting the following arguments:

1. `state`: an instance of `StateBlock`
2. `startLine`: the index of the current line
3. `endLine`: the index of the last available line
4. `checkMode`: a flag indicating whether we should simply check if the current
line marks the begining of the syntax we are trying to parse.
line marks the beginning of the syntax we are trying to parse.

Both `startLine` and `endLine` refer to values used to index several
informations about lines within the `state`.
pieces of information about lines within the `state`.

The `checkMode` is here for optimization, if it's set to `true`, we can return
`true` as soon as we are sure the present line marks the beginning of a block we
Expand Down Expand Up @@ -66,15 +66,15 @@ proceed with the complete parsing.
NB: It is your responsibility to make sure you have reached the maximum nesting
level allowed by comparing `state.level` and `state.options.maxNesting`.

NB: If for any reason, the block you are trying to parse is incorrectly formated
NB: If for any reason, the block you are trying to parse is incorrectly formatted
and you are unable to parse it, you must abort and return `false` without
modifying `state` in any way.

To completely parse a block, you will need to emit additional [tokens][tokens]
in `state.tokens`.

Once you are sure the current line marks the beginning of one of "your" blocks,
you should push an [open tag token][tokens] corresponding to the begining of
you should push an [open tag token][tokens] corresponding to the beginning of
your block. You will also need to find its end. Use the `state` methods to help
you with this.

Expand Down
4 changes: 2 additions & 2 deletions docs/parsing_core.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ of:
* `src`: the complete string the parser is currently working on
* `tokens`: the tokens generated by the previous core rules, up to now
* `env`: a namespaced data key-value store to allow core rules to exchange data
* `inlineMode`: a flag mentionning whether the parser is currently working as inline-mode only
* `inlineMode`: a flag mentioning whether the parser is currently working as inline-mode only
or standard mode

The rest are mostly components of the underlying remarkable instance.
Expand All @@ -21,7 +21,7 @@ Some core rules process directly the `src` to produce a new set of tokens,
others process the existing list of tokens in order to produce a new one.

The most important predefined core rules are `block` and `inline` which are
reponsible for calling the subparsers for the [block][block] and
responsible for calling the subparsers for the [block][block] and
[inline][inline] rules.

To better understand how the core rules work, please read the code in
Expand Down
10 changes: 5 additions & 5 deletions docs/parsing_inline.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ only part of a line of text and emitting the [tokens][tokens] required to
represent them. For example, a link, bold, emphasis, super/sub scripts, inline
code, and so on.

An inline rule is a function expecting two argumnents:
An inline rule is a function expecting two arguments:

1. `state`: an instance of `StateInline`
4. `checkMode`: a flag indicating whether we should simply check if the current
position marks the begining of the syntax we are trying to parse.
position marks the beginning of the syntax we are trying to parse.

The `checkMode` is here for optimization, if it's set to `true`, we can return
`true` as soon as we are sure the present position marks the beginning of an
Expand Down Expand Up @@ -42,22 +42,22 @@ The most important methods are:
## Rule parser behaviour

If `checkMode` is set to true, simply return a boolean depending on whether the
current position should be considered has the begining of your
current position should be considered has the beginning of your
syntax. Otherwise, proceed with the complete parsing.

NB: It is your responsibility to make sure you have reached the maximum nesting
level allowed by comparing `state.level` and `state.options.maxNesting`.

NB: If for any reason, the syntax you are trying to parse is incorrectly
formated and you are unable to parse it, you must abort and return `false`
formatted and you are unable to parse it, you must abort and return `false`
without modifying `state` in any way.

To completely parse a block, you will need to push new [tokens][tokens] by
calling `state.push(token)`.

Once you are sure the current position marks the beginning of the syntax you are
trying to parse, you should push an [open tag token][tokens] corresponding to
the begining of your inline section. You will also need to find its end.
the beginning of your inline section. You will also need to find its end.

Your next decision should be whether you wish to allow other inline syntaxes to
be nested in your content or not. If you do, you will need to invoke
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Remarkable converts markdown to HTML in two steps:
1. Parsing markdown raw text to a list of tokens
2. Rendering the list of tokens to actual HTML code.

Parsing rules are divided into three differents kind of rules
Parsing rules are divided into three different kinds of rules
([core][core parsing], [block][block parsing] and [inline][inline parsing]).

To add a parsing rule, you will need to get the relevant parser for your rule
Expand Down
2 changes: 1 addition & 1 deletion docs/renderer.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Renderer

Renderering is the second part of converting markdown to HTML. The renderer
Rendering is the second part of converting markdown to HTML. The renderer
converts the list of [tokens][parser] produced by the [Parsers][parser] to
produce actual HTML code.

Expand Down