Commit Graph

261 Commits (master)

Author SHA1 Message Date
Li Siyao c6304fb426 Happy new year 2018! (#3620) 2018-01-01 00:41:21 +01:00
Josh Unger 358984ef0c add an example .prettierrc.js config (#3570)
* add an example .prettierrc.js config

* Update configuration.md
2017-12-26 18:26:09 +11:00
Lucas Azzola 4c9d4061da
Prettier Plugin API (#3536)
* Move files around in preparation for refactor

* Update paths in build script

* Extract generic printing logic from the JavaScript printer

* Conform printer API

* Fixup decorator handling

* Fix multiparser

* Create plugin entry for markdown

* Create plugin entry for javascript/typescript

* Create plugin entry for html

* Create plugin entry for graphql

* Create plugin entry for css/less/scss

* Move JSON to JS plugin entry

* Integrate plugins into getSupportInfo()

* Move astFormat to parser definition

* Move util to common

* Implement parser loading

* remark -> mdast

* Rename cli/cli -> cli/index

* Rename builder -> doc package, fix printer resolution

* Fix doc shape assumption in CSS-in-JS logic

* Fix third-party.js prod resolution

* Fixup build-docs script

* Distribute multiparser code

* Remove requirement to forward options

* Flatten closure

* Remove debug directory

* Expose doc

* Add external plugins

* Pass options to loadPlugins

* Export getParsers

* Pin resolve version

* Use getSupportInfo in Markdown embed

* Document plugin API

* Update build-docs

* Add CLI for plugins

* Lint docs

* Fixup build.js

* Add vue language

* Fixup multiparser for vue

* Upgrade rollup and rollup-plugin-commonjs

* Fixup third-party build

* Change AST format in docs
2017-12-26 12:23:50 +11:00
Josh Unger 62bfcac4c5 remove comment in prettier json example since comments are invalid in json (#3567)
remove comment in prettier json file example since comments are invalid in json
2017-12-26 01:15:18 +11:00
Jiawen Geng ea4bc9093e fix recursive in script (#3565)
See more here : https://github.com/prettier/prettier/issues/2078.
2017-12-25 20:16:50 +11:00
Christopher Chedeau c40b061b80
[vue] Introduce proper support for Vue Single File Components (SFC) (#3563)
There's a lot of demand for vue sfc (#2097). This introduces partial support for them: all the html is printed as is, except for the script and style tags which are printed using prettier. I believe that this should cover a lot of the use cases while being simple to support and if we want we can extend to more in the future.

I copy pasted the html parser used by vue (it's just a single 400 lines file) so that we don't run the chancesof conflicts. I'm also very conservative: I only print the style and script at the top level and for the lang attributes we support.

I expect this to be landable as is and provide value, review welcome :)
2017-12-25 01:15:33 +01:00
Jiawen Geng 0a28c7484f Add js version pre-commit (#3541) 2017-12-20 18:08:42 -02:00
Lucas Azzola ed80d6c5bd
Make all CLI logging go through a logger (#3515)
* Make all CLI logging go through a logger

* Add --loglevel docs

* Change default loglevel to log

* Update snapshots

* Switch to YAML eslint files
2017-12-18 23:22:07 +11:00
Lucas Azzola 5e81e75601
Add plugin:prettier/recommended (#3508)
* Add plugin:prettier/recommended

* Revert eslint-plugin-prettier docs changes
2017-12-18 08:39:31 +11:00
Daniel Tschinder 1ba144b617 chore(docs): Add webstorm setup with eslint integration (#3489) 2017-12-14 23:19:54 +11:00
Nick Arnold d6db35c16b docs: update babylon project url (#3484) 2017-12-14 14:23:53 +11:00
Christian Oliff 578156c218 Update VS Code extension name (#3475) 2017-12-13 11:35:20 -02:00
Thomas Broadley 44bad41b3e Fix typo (#3467) 2017-12-13 01:44:49 -02:00
James Leftley 46ecf3ffbb Update ESLint docs code formatting for consistency (#3466) 2017-12-13 00:57:21 -02:00
Roger Sheen 5065608f73 Docs: Add info on ignore file to "Ignoring Code" (#3458)
* docs(ignore): mention ignore file in Ignoring Code

While working on #3321, I needed to ignore an entire file, but the "Ignoring Code" section of the docs only describes how to ignore blocks of code, so I wasn't aware of the default ignore file.

(The `.prettierignore` file is mentioned in the CLI section, but easily overlooked there.)

This commit extends the introduction sentence of the "Ignoring Code" section and adds a new subsection to explain how to ignore files.

https://github.com/prettier/prettier/issues/3321#issuecomment-350072566

* docs(cli): fix nesting error in heading hierarchy

The `--ignore-path` option currently appears as a third-level subsection of `--find-config-path` and `--config`, but this looks like an error.

This commit promotes the `--ignore-path` heading to the same (H2) level as the other CLI options.
2017-12-11 22:23:06 -02:00
Lucas Duailibe c9079926c9
Improve visibility of lint-staged usage warning (#3445) 2017-12-10 00:09:07 -02:00
Alf Eaton 67ec3b2f05 Update instructions for File Watcher in WebStorm (#3424)
Re-use the instructions for setting the File Watcher program path in WebStorm when prettier is installed locally.
2017-12-06 13:35:56 -02:00
Maxime Thirouin a9502f0ab7 Add "md" extension in "Pre-commit hook" documentation (#3421)
It's nice to have all extensions so we can easily copy paste :)
2017-12-06 20:34:58 +11:00
Lipis 20373d6fee Prettify style in playground and code block languages (#3419) 2017-12-05 19:48:11 -07:00
Lucas Azzola c7c1d2e7a4 Upgrade Prettier to Prettier 1.9 (#3395)
* Upgrade to prettier@1.9.0

* Run eslint --fix

* Run prettylint --fix

* Fix playground with editorconfig script
2017-12-05 08:14:03 -02:00
Joseph Frazier cecf0657a5 Re-add EditorConfig support (undo #3213) (#3255)
* Revert "Revert "Respect EditorConfig settings" (#3213)"

This reverts commit d2241fc0d5.

* Comment out EditorConfig docs

See https://github.com/prettier/prettier/pull/3213#issuecomment-343009769

* editorconfig: Support `indent_size = 0`

See https://github.com/prettier/prettier/pull/2760#discussion_r137447715
and c38b84c42a

* Revert "Comment out EditorConfig docs"

This reverts commit ddfa529c55cac4853a1e76e00c8b5e3ef158c01f.

* Mark EditorConfig functionality as v1.9.0+

See https://github.com/prettier/prettier/pull/3255#discussion_r150432508

* editorconfig: Upgrade editorconfig-to-prettier to 0.0.4

* editorconfig: Only enable for CLI, by default

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add tests confirming that editorconfig is ignored by default in the API

https://github.com/prettier/prettier/pull/3255#issuecomment-348420546

* editorconfig: Add/fix CLI option parsing

* editorconfig: Move docs from configuration.md to options.md

* editorconfig: Add `oppositeDescription` to show docs for `--no-editorconfig`

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154542792

* editorconfig: Update test snapshots

* editorconfig: Remove unnecessary options parsing code

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154544560

* editorconfig: Move docs from options.md to api.md and cli.md

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154545979

* resolveConfig: return null if both .prettierrc and .editorconfig are missing

Addresses https://github.com/prettier/prettier/pull/3255#discussion_r154574613

* Don't add now-failing tests

The way these tests work, both `tests_integration/cli/config/.prettierrc`
and `.prettierrc` apply to `tests_integration/cli/config/editorconfig/file.shouldnotexist`,
so the test wouldn't work even on master. Here's a way to confirm that:

```js
const path = require('path')
const assert = require('assert')
const prettier = require('./')

const file = './tests_integration/cli/config/editorconfig/file.shouldnotexist'
console.log(prettier.resolveConfig.sync(file))
assert(prettier.resolveConfig.sync(file) === null)
```
2017-12-05 09:28:27 +11:00
Marko Schulz a05811f8eb Fix link (#3392) 2017-12-05 08:55:32 +11:00
Ika 073c0b16d8 feat(markdown): add `proseWrap: "preserve"` option (#3340)
* test: add test case

* feat(markdown): add `proseWrap: "preserve"` option

* test: add tests

* docs(options): update `proseWrap`

* feat(markdown): change default to `proseWrap: "preserve"`

BREAKING CHANGE

* docs(options): update `proseWrap`

* test: specify option explicitly

* Fix lint after merge

* Fix error after merge
2017-12-02 09:48:40 +11:00
Ika 23c306c8a0
docs(index): fix links on GitHub (#3367) 2017-12-01 10:59:17 +08:00
Ryan Zimmerman d6bb6edeae Add note about proseWrap option under printWidth for clarity (#3364) 2017-11-30 17:54:54 -03:00
Sylvan Mably 562b4e19d1 Fix broken footnote links (#3353) 2017-11-29 18:29:32 -03:00
Ika ac3f74e7a3
docs(options): add available version for `arrow-parens` (#3339) 2017-11-29 00:20:26 +08:00
Suchipi Izumi 6abdd2c6b7 PR feedback 2017-11-27 22:27:34 -07:00
Stephen Scott 9a1e408a3f Add option and specs (no implementation yet)
These new snapshots are from https://github.com/prettier/prettier/pull/2676
2017-11-27 22:26:58 -07:00
Ika 76efb33e75 chore: setup markdown formatting (#3224)
* chore(deps): upgrade prettier to v1.8.2

* chore: setup lint-docs script

* docs: add `<!-- prettier-ignore -->`s

* docs: format docs

* Revert "docs: format docs"

This reverts commit 6dba903987dddc498cb589ca311905f25b6aee53.

* chore(prettierrc): set `--no-prose-wrap`

* docs: format docs

* Revert "docs: format docs"

This reverts commit 139bd744b6921916be8fac4fa3bab83bae5d12df.

* docs: tweak

* docs: format docs

* chore: rename .prettierrc

* chore: rename back to .prettierrc

* chore: split out third-party

* refactor: fix linting

* chore: do not split out third-party on website
2017-11-22 22:27:40 +11:00
Nathaniel Furniss cbed0f487f fix config doc typo (#3298) 2017-11-20 18:26:33 -02:00
Ika b6b601815c docs(webstorm): improve image urls (#3261) 2017-11-14 18:37:15 +11:00
Mark Yu 9f7b4df23f Fix broken Webstorm image links. (#3260) 2017-11-14 10:47:04 +08:00
David Glasser 217992fb3a docs: eslint config is orthogonal to plugin (#3229) 2017-11-10 03:16:11 -02:00
Ika c37e7fae2a
docs(options): add note for available version (#3217) 2017-11-09 13:39:07 +08:00
Mitermayer Reis 813d9b93eb Fix typos (#3212)
* Adding --stdin-filepath option in order to enable filetype inference from
stdin

* Fixing typo on the documentation

* Fixing typos - fixing some typos

* Restoring static lib files back since they are artifacts
2017-11-09 11:44:24 +11:00
Lucas Azzola d2241fc0d5
Revert "Respect EditorConfig settings" (#3213)
* Revert "Respect EditorConfig settings (#2760)"

This reverts commit 8f58ca0f48.
2017-11-09 11:38:58 +11:00
Joseph Frazier 8f58ca0f48
Respect EditorConfig settings (#2760)
This fixes https://github.com/prettier/prettier/issues/42.
It adds support for .editorconfig's `indent_style`, `indent_size`, `tab_width`,
and `max_line_length` properties.

It doesn't support the `end_of_line` property as described in
https://github.com/prettier/prettier/issues/42#issuecomment-327073326,
but that could be added later. The same goes for `quote_type`
(https://github.com/prettier/prettier-atom/issues/293#issue-267288335).

* Make test .prettierrc not set config for all file extensions

This makes it easier to keep tests isolated.
2017-11-08 14:30:28 -05:00
Ika 9652ad75f8
docs(website): fix link (#3206) 2017-11-09 00:49:39 +08:00
Jamel Toms dc9d628874 Fix broken link to configuration page (#3205) 2017-11-09 00:43:30 +08:00
Lucas Azzola 98eb2c98b7
Add proseWrap docs (#3201) 2017-11-08 22:57:08 +11:00
Lucas Azzola 84adbff232
Upgrade docusaurus to beta.10 (#3166)
* Upgrade docusaurus to beta.10

* Fixes for highlightjs

* Load github buttons script
2017-11-07 20:47:21 +11:00
Lucas Azzola 71a5533c4e
Move all docs to website (#3139)
* Sync README -> docs/options.md

* Sync README -> docs/*.md

* Misc fixups

* Remove markdown-toc

* Remove insert-pragma from ToC

* Never again!

* Move all docs to ./docs

* Remove yarn toc

* Fix inter-doc links

* Fix links in footer

* Clean up README.md

* Add basic description to README.md

* Use flat badges

* Move editor guides to website

* Improve prettier-ignore docs

* Fixup bad find/replace

* Add JSON to README

* Fix custom parser API link

* Fixup GitHub centering, add downloads badge

* Add 1.8 docs

* docs(website): mention markdown on homepage (#1)

* Add intro

* Add watching-files.md

* Fix markdown syntax highlighting

* Switch back to .md links
2017-11-07 14:39:07 +11:00
Robin Malfait d4768e1336 Update editors.md (#3144) 2017-11-04 22:30:03 +01:00
Benny Neugebauer fa62a438a5 docs: fix table for `insertPragma` (#3010)
* docs: fix table for `insertPragma`

* Update options.md

* Update options.md
2017-10-11 22:30:03 +11:00
Jake 50f3e646c7 Add option to insert @format to first docblock if absent (#2865)
* Add option to insert @format pragma if absent

prependPragma --> insertPragma

add tst dir, move stripBom, add to README, update snapshots

remove noise from test + update snapshots

use jest@test new functions, update docs, rerun snapshots

fix accidental upgrade to jest@test

update jest-docblock again to latest with strip()

updated snapshot

* updated snapshots

* revert jest dep change

* apply a trim to parsed comments

* remove empty object

* Revert "apply a trim to parsed comments"

This reverts commit 467f71ce5f4b4f8a1b5c4474ee0484bc96c92141.

* rerun snapshots with proper jest version

* pin jest-docblock to latest @test release

* comment out docs for new feature from readme

* remove leading newlines

* ensure blank line between docblock and rest of file

* remove backtick string
2017-10-06 19:37:14 +11:00
ikatyang 7d7fb36499 docs: `requirePragma: <bool>` 2017-09-13 21:43:57 -06:00
Ika 71f5d185a7 docs(readme): port requirePragma docs to README.md (#2812)
* fix default value
2017-09-14 11:26:43 +08:00
Will Binns-Smith d5e5d66407 Add option to require @prettier or @format pragma (#2772)
* Add option to require @prettier or @format pragma

Fixes #2397.

Inspired by `eslint-plugin-prettier` and the discussion in #2397, this
implements requiring a special comment pragma to be present in a file's
first comment in order to be formatted.

This will help large codebases gradually transition to prettier over
time without tons of churn or large code reviews.

I implemented this as a standard prettier "option", not just a typical
`argv` flag, as it is relevant in both the cli and the api. This way it
can be provided programmatically, on the command line, or standardized
in a prettierrc file so like the style options, every user can use this
setting consistently and only apply prettier to relevant files, no
mattier their editor integration.

This requires the pragma begin with `@` (in fact it's inserted if the
user doesn't provide it). Currently the usage implies it must be
"prettier" or "format", but it can technically be any value other than
"none", which is similar to the `trailingCommas` option.

cc @vjeux

* Don't quote anything in runPrettier; this is usually handled by a shell

* Make --require-pragma a boolean option

* Use jest-docblock to find pragmas without parsing the ast

* Clarify docs

* includes -> indexOf

* Move test out of integration
2017-09-13 09:03:18 -07:00
Frank Li dace9ecded Update website setup to use latest version of Docusaurus (#2614)
* Update website to new docusaurus API

* Fix missing comma

* Fix link typo in users.json

* Update docusaurus to version 1.0.0-alpha.35

* Clean up siteConfig.js
2017-08-11 12:34:32 -07:00
Marko Schulz 7544006949 Purge usage of `.eslintrc` (#2592)
* .eslintrc -> .eslintrc.json

Because `.eslintrc` is deprecated.

* Purge second usage of .eslintrc
2017-08-07 19:03:27 +10:00
Adam Hawkins 781ba9580a Fix variable name in git precommit example (#2529)
echo "jsfiles" will not work. The example references a variable, not a static string. This commit makes the example functionally correct.
2017-07-21 08:54:51 -07:00
Mitermayer Reis 38fdb6f851 Update vim-prettier location (#2518) 2017-07-20 11:06:54 +10:00
Lucas Azzola 324fc86618 Sync usage.md from main README 2017-07-08 17:45:52 +10:00
Lucas Azzola 461fb30181 Fix formatted with Marked 2017-07-03 22:13:09 +10:00
Lucas Azzola 65bbbaec58 Add content to website (#2377)
* Add content to website

* Fix linting error

* Cleanup, extract content to JSON files
2017-07-03 12:48:05 +02:00
Frank Li 80f38ce75b Website (#2241)
* initial docusaurus set-up

* Delete why-prettier.md

* Update README.md

* Update Docusaurus structure

* Update package.json

* Update siteConfig.js

* Remove ~ files

* chore(website): update build script

* Add redirect script

* Get eslint working on website

* Fix to allow for baseUrl of '/'

* Update docusaurus version

* Update README.md

* Change redirect script to use baseUrl of '/'

* Fix index.js formatting

* Load redirect script

* General cleanup

* Add projects using prettier
* Update service worker to just scope to playground
* Reduce link repeatition
* Link "Try it out" button to /playground/
* Make header of playground approximately same as main site
* Remove .html from URLs (e.g. users.html -> users/)
* Link Gitter Chat

* Add circleci.yml

* Only run builds on master

* Do deployment using Travis
2017-07-02 10:14:24 +10:00
Lucas Azzola 6f32a40edd Fix multiparser in website, fixes #2328 (#2374) 2017-07-01 18:14:21 +02:00
Christopher Chedeau 5db9407d78 1.5.2 2017-06-27 20:33:35 -07:00
Christopher Chedeau adc71ef6ae 1.5.1 2017-06-27 13:42:31 -07:00
Christopher Chedeau 500cf98c06 1.5.0 2017-06-27 10:09:59 -07:00
Christopher Chedeau 6017ac13c7 Create CNAME 2017-06-27 07:43:54 -07:00
Lucas Azzola eccb17495a Website: speed up load time, enable service worker (#2172)
* feat(website): speed up website load 💥

* chore(package): fix bad merge
2017-06-18 20:25:27 +10:00
Lucas Azzola 40c41f232f Website: usability improvements (#2118)
* feat(website): use worker thread for formatting

* Create index.html

Remove step=5
2017-06-13 09:20:13 -07:00
Lucas Azzola 4e4922b428 feat(website): revamp the website a bit (#2113) 2017-06-12 07:58:06 -07:00
Christopher Chedeau 4758f5a80d 1.4.4
Oops, I forgot to re-run the build scripts, this broke postcss
2017-06-07 16:38:05 -07:00
Christopher Chedeau f702c2c614 1.4.3
* Fix support for node 4 (#1988)
* Fix website on iOS Safari (#1970)

Formatting change:
* Position JSX whitespace (`{" "}`) at the end of lines (#1964)

Lots of small fixes, mainly for TypeScript.
2017-06-07 15:48:34 -07:00
Martin V 820e39b2b3 Clean up build script, add Babel for docs js bundles (#1970)
* Clean up build script, add Babel for docs js bundles

* Update package.json
2017-06-07 15:20:48 -07:00
Christopher Chedeau 86febfe797 1.4.2 2017-06-03 08:54:22 -07:00
Christopher Chedeau f56f9e5e8f 1.4.1
This fixes all the TypeScript problems reported and a few regressions from 1.4.0.
2017-06-02 16:25:57 -07:00
Christopher Chedeau 02c48d284e Fix strictEqual throwing (#1909)
I looked at what is being called with assert and couldn't find anything but `ok` and `strictEqual`.

Fixes #1903
2017-06-02 14:27:03 -07:00
Christopher Chedeau 7fd71fa386 1.4.0 2017-06-02 08:55:04 -07:00
Christopher Chedeau d55640087e Fix building docs (#1838)
The hackiness continues! I'm now bundling an existing bundle again in order for it to get exported as a global variable :p There's likely a better solution, but it kind of works.

Because I have to regenerate the docs, I just tagged it as 1.4.0-beta and added typescript and postcss in there.
2017-05-31 13:37:35 -07:00
CodinCat b354fbd6dc Update repo link in github page (#1500) 2017-05-04 07:46:42 -07:00
Christopher Chedeau 515a565a66 1.3.1 (hotfix) 2017-05-03 14:44:08 -07:00
Christopher Chedeau b481c57470 1.3.0 docs 2017-05-02 16:00:33 -07:00
Christopher Chedeau a81d5c1cd1 1.3.0 2017-05-02 13:15:15 -07:00
Christopher Chedeau 88e004184b 1.2.2 2017-04-19 13:19:26 -07:00
Christopher Chedeau 076804c09c 1.2.1 2017-04-19 12:00:25 -07:00
Christopher Chedeau bc53920734 1.2.0 2017-04-19 11:01:44 -07:00
Aviv Rosental d6e5e6be60 omit 'doc' key from options object before passing it to format() (#1299) 2017-04-16 11:32:06 -07:00
Christopher Chedeau ad637d0744 1.1.0
This fixes a regression from 0.22 around member expressions breaking and fixes no-semi placement around leading comments, plus some other minor fixes.
2017-04-13 18:40:04 -07:00
Christopher Chedeau 33c8a26cd6 Support semi and useTabs options in docs (#1232) 2017-04-13 09:31:37 -07:00
Christopher Chedeau 23756cdc59 1.0 2017-04-13 09:28:42 -07:00
Christopher Chedeau 344401c038 0.22.0 2017-03-09 09:15:40 -08:00
Christopher Chedeau b570154dd5 0.21.0 2017-03-03 14:03:36 -08:00
Christopher Chedeau e09bdd4447 0.20.0 2017-02-28 10:49:30 -08:00
Christopher Chedeau edf2bde590 Fix trailing commas in docs (#825)
I also added support for parser dropdown and stop minifying the bundle so that the flow parser actually works.

Fixes #816
2017-02-27 17:02:41 -05:00
Christopher Chedeau 71a1ca8907 Update docs to 0.19.0 2017-02-23 09:55:03 -08:00
Christopher Chedeau e0cac2049d 0.19.0 2017-02-23 09:52:55 -08:00
Christopher Chedeau 848dfa3505 0.18.0 2017-02-16 09:28:26 -08:00
Brandon Mills eda26398e5 [Docs] Use replaceState API when demo code changes (#710)
In the current demo, every time the code in the left panel is changed,
the new code is stored in the URL hash, which pushes a new history
entry. This effectively "breaks" the back button. This change calls
`history.replaceState` instead, so a single click of the back button
will return the browser to whatever page was open before navigating to
the demo.
2017-02-14 21:02:17 -08:00
Christopher Chedeau fbba7db6e2 0.17.0 2017-02-13 19:11:05 -08:00
Christopher Chedeau 4dca78dbed Add option for putting > on the last line in jsx (#661)
Feel free to suggest a better name for the option. Otherwise it works great :)

Fixes #654
2017-02-13 12:57:05 -05:00
Christopher Chedeau 98d04d8c70 0.16.0 2017-02-05 18:28:20 -08:00
Christopher Chedeau b040be2206 0.15.0 2017-02-01 16:31:11 -08:00
Christopher Chedeau efc3ee0488 0.14.1 2017-01-30 09:56:01 -08:00
Christopher Chedeau 94b137ac47 0.13.0 2017-01-27 14:41:30 -08:00
Christopher Chedeau caf7f2a6f2 0.12.0 2017-01-26 20:24:17 -08:00
Christopher Chedeau ef531274f7 0.11.0 2017-01-23 09:40:01 -08:00
Simon Lydell bb1884320b Use babel-code-frame for syntax errors (#367)
* Use babel-code-frame for syntax errors

* Support the `--color` option more explicitly

* Update rollup config to handle babel-code-frame

* Use exact dependencies
2017-01-23 09:10:51 -08:00
Christopher Chedeau 92f14d79df v0.0.10 (#353) 2017-01-20 10:00:01 -08:00
Christopher Chedeau c468fde106 Add debugging support for doc IR (#347)
This PR adds two things:

`--debug-print-doc` command that prints the formatted doc

```js
echo "<div>&lt;</div>" | ./bin/prettier.js --stdin --debug-print-doc
[
  groupConditional(
    group([
      group([ "<", "div", group([ indent(2, []), softline() ]), ">" ]),
      "&lt;",
      "</",
      "div",
      ">"
    ]),
    [
      group([
        group([ "<", "div", group([ indent(2, []), softline() ]), ">" ]),
        "&lt;",
        "</",
        "div",
        ">"
      ]),
      group([
        group([ "<", "div", group([ indent(2, []), softline() ]), ">" ]),
        indent(2, groupBreak([ hardline(), "&lt;" ])),
        hardline(),
        "</",
        "div",
        ">"
      ])
    ]
  ),
  ";",
  hardline()
];
```

The ability to view the IR in real time on the browser display:

![image](https://cloud.githubusercontent.com/assets/197597/22134741/4f172f20-de7e-11e6-84bc-5f813976dc19.png)

The way it works is pretty cool, we take the doc IR and print a valid JavaScript string out of it, that we then send to prettier in order to make it look good :)
2017-01-20 09:54:32 -08:00
Christopher Chedeau b065eaa582 Update docs to 0.0.9 (#309) 2017-01-18 14:26:22 -08:00
Christopher Chedeau e4b5aaade2 Fix docs (#307)
It doesn't compile cleanly anymore:
- esutils checks for Buffer.isBuffer without ensuring that Buffer exists.
- for version, we require a json file, need a rollup extension for that.

I no longer hardcode the version number.

Note: we need to merge this pull request after we have done the release so that the version number is correct and need to rebuild the minified version in a subsequent commit.
2017-01-18 14:24:42 -08:00
James Long 6f2b01193f Update live editor to 0.0.8 2017-01-17 11:00:02 -05:00
James Long 60c0b52fed Update live editor to 0.0.7 2017-01-13 23:33:38 -05:00
Mikael Brevik cbabefdb0f Adds various prettier-browser changes (#175)
* Adds link to GH repo in title

* Adds popular keybindings (subl) to editor

* Changes theme to base16-dark to fit better with body bg
2017-01-13 17:14:48 -05:00
James Long 3713408871 Update live editor to 0.0.6 2017-01-13 15:40:22 -05:00
Artem Sapegin 7fee1588ae Add title and encoding to the REPL 2017-01-12 13:59:32 +01:00
Christopher Chedeau 4685164faf Add prettier-browser
This is a very handy way of playing out with prettier without having to install it. People have already been using it actively in the issues. Putting it directly inside of the repo would be better than on mine.
2017-01-11 10:56:23 -08:00