Browse Source

Docs update

pull/82/head
Vitaly Puzrin 10 years ago
parent
commit
2b5aca9642
  1. 17
      CHANGELOG.md
  2. 20
      docs/4.0_migration.md
  3. 5
      docs/architecture.md

17
CHANGELOG.md

@ -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 3.1.0 / 2015-03-05
------------------ ------------------

20
docs/4.0_migration.md

@ -4,7 +4,18 @@ Migration to v4
v4 has the same external API as v3, but significantly changed internals. Plugin v4 has the same external API as v3, but significantly changed internals. Plugin
authors should update their packages. 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) - [Tokens](https://github.com/markdown-it/markdown-it/blob/master/lib/token.js)
are now classes, and allow arbitrary attributes. are now classes, and allow arbitrary attributes.
@ -13,7 +24,10 @@ authors should update their packages.
how to create tokens in new way. how to create tokens in new way.
- [Renderer](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) - [Renderer](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
methods were unified. Number of custom renderer rules were significantly reduced. 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
docs/architecture.md

@ -45,11 +45,11 @@ Instead of traditional AST we use more low-level data representation - *tokens*.
The difference is simple: The difference is simple:
- Tokens are a simple sequence (Array). - 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. - There are special token objects, "inline containers", having nested tokens.
sequences with inline markup (bold, italic, text, ...). 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. for details about each token content.
In total, a token stream is: In total, a token stream is:
@ -68,6 +68,7 @@ to an AST.
More details about tokens: More details about tokens:
- [Renderer source](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js) - [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. - [Live demo](https://markdown-it.github.io/) - type your text ant click `debug` tab.

Loading…
Cancel
Save