Skip to content

Commit

Permalink
Docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Puzrin committed Mar 11, 2015
1 parent 3ba6f8b commit 2b5aca9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
4.0.0 / 2015-03-11
------------------

- Breaking internal API changes. See [v4 migration notes](https://github.com/markdown-it/markdown-it/blob/master/docs/4.0_migration.md). In usual case you will need to update plugins.
- Token internals changed
- Unified the most of renderer methods.
- Changed tokens creation - use `state.push(...)` (see sources)
- Moved `normalizeUrl()` to root class as `.normalizeLink()` &
added `normalizeLinkText()` method.
- Moved `.validateUrl()` to root class and simplified logic - no more need to
replace entities.
- Joined md unescape & replace entities logic to `utils.unescapeAll()`.
- `md.utils.lib` now exposes useful libs for plugins.
- Use entities data from external package.
- Fixed emphasis regression, caused by CM v0.18 spec (#65).


3.1.0 / 2015-03-05
------------------

Expand Down
20 changes: 17 additions & 3 deletions docs/4.0_migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ Migration to v4
v4 has the same external API as v3, but significantly changed internals. Plugin
authors should update their packages.

## Tokens and renderer
## For users

External API did not changed.

- If you used `markdown-it` with plugins - make shure to update those.
- If you modified renderer - see dev info below.
- If you did not used plugins and renderer modification - no chanches needed.


## For Developpers

### Tokens and renderer

- [Tokens](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js)
are now classes, and allow arbitrary attributes.
Expand All @@ -13,7 +24,10 @@ authors should update their packages.
how to create tokens in new way.
- [Renderer](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
methods were unified. Number of custom renderer rules were significantly reduced.
Custom renderer functions need update due tokens format change.

## Other changes
### Other changes

- `.validateLink()` moved to root (MarkdownIt) class.
- `.validateUrl()` -> moved to rooot class `.validateLink()`
- added `.normalizeLink()` & `.normalizeLinkText()` to root class, and removed
`normalizeUrl()` from utils.
5 changes: 3 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ Instead of traditional AST we use more low-level data representation - *tokens*.
The difference is simple:

- Tokens are a simple sequence (Array).
- Opening and closing tags are separate tokens.
- Opening and closing tags are separate.
- There are special token objects, "inline containers", having nested tokens.
sequences with inline markup (bold, italic, text, ...).

See [source](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js)
See [token class](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js)
for details about each token content.

In total, a token stream is:
Expand All @@ -68,6 +68,7 @@ to an AST.
More details about tokens:

- [Renderer source](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
- [Token source](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js)
- [Live demo](https://markdown-it.github.io/) - type your text ant click `debug` tab.


Expand Down

0 comments on commit 2b5aca9

Please sign in to comment.