Skip to content

Move all docs to website#3139

Merged
azz merged 27 commits intoprettier:masterfrom
azz:docs-to-website
Nov 7, 2017
Merged

Move all docs to website#3139
azz merged 27 commits intoprettier:masterfrom
azz:docs-to-website

Conversation

@azz
Copy link
Member

@azz azz commented Nov 3, 2017

Moves all documentation to the website.

  • Includes Rationale.md
  • Move contents and delete /editors directory
  • Breaks up Usage into many pages. Technically a breaking change for /usage.html URLs.

Closes #2825
Supersedes #3116

Closes #3028
Closes #3138

docs/api.md Outdated

## `prettier.format(source [, options])`

`format` is used to format text using Prettier. [Options](#options) may be provided to override the defaults.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Options](./options.html)

docs/api.md Outdated
searching from the current directory).
Or you can pass directly the path of the config file as `options.config` if you don't wish to search for it.
A promise is returned which will resolve to:
* An options object, providing a [config file](#configuration-file) was found.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[config file](./configuration.html)

docs/cli.md Outdated
---

Run Prettier through the CLI with this script. Run it without any
arguments to see the [options](#options).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[options](./options.html)

docs/cli.md Outdated
## `--find-config-path` and `--config`

If you are repeatedly formatting individual files with `prettier`, you will incur a small performance cost
when prettier attempts to look up a [configuration file](#configuration-file). In order to skip this, you may
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[configuration file](./configuration.html)

The configuration file will be resolved starting from the location of the file being formatted,
and searching up the file tree until a config file is (or isn't) found.

The options to the configuration file are the same the [API options](#options).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[API options](./options.html)

}
```

For more information on how to use the CLI to locate a file, see the [CLI](#cli) section.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[CLI](./cli.html)

[Babylon](https://github.com/babel/babylon) parser with all language
features enabled, but you can also use the
[Flow](https://github.com/facebook/flow) parser with the
`parser` API or `--parser` CLI [option](#options).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[option](./options.html)

docs/options.md Outdated
* [`json`](https://github.com/babel/babylon/tree/f09eb3200f57ea94d51c2a5b1facf2149fb406bf#babylonparseexpressioncode-options) _Since v1.5.0_
* [`graphql`](https://github.com/graphql/graphql-js/tree/master/src/language) _Since v1.5.0_

[Custom parsers](#custom-parser-api) are also supported. _Since v1.5.0_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Custom parsers](./api.html#custom-parser-api)

docs/index.md Outdated


[empty lines]:/docs/en/rationale.html#empty-lines
[multi-line objects]:/docs/en/rationale.html#multi-line-objects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to use relative path?

[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](#badge)

Prettier is an opinionated code formatter with support for:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier is an opinionated code formatter

A simple description here would be better I think.

@ikatyang
Copy link
Member

ikatyang commented Nov 3, 2017

Footer needs to be updated as well, especially Usage.

<h5>Docs</h5>
<a href={this.url("/why-prettier.html")}>Why Prettier?</a>
<a href={this.url("/usage.html")}>Usage</a>
<a href={this.url("/options.html")}>Options</a>
<a href={this.url("/editors.html")}>Editor Integeration</a>

@azz
Copy link
Member Author

azz commented Nov 3, 2017

Thanks for the review! Should have marked as wip - I knew about the links needing to be changed.


Prettier enforces a consistent code **style** (i.e. code formatting that won't affect the AST) across your entire codebase because it disregards the original styling[\*](#styling-footnote) by parsing it away and re-printing the parsed AST with its own rules that take the maximum line length
into account, wrapping code when necessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep this part here (not the title "What does prettier do?")

Prettier is an opinionated code formatter. It enforces a consistent style by parsing
your code and re-printing the parsed AST with its own rules that take the
maximum line length into account, wrapping code when necessary.

For example, take the following code:
<!-- and so on -->

You can try it on our interactive REPL: http://prettier.io/playground

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d still include the example to make it more clear what prettier does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to avoid too much copy-pasting. We're doing this to remove the need to sync the docs.

However, I think it would be a great idea to write a different, more concise summary of Prettier in the README, with a basic example.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm just saying an example would be very good here, I don't really care which one :-)

I suggested keeping the one there just for the sake of simplicity

README.md Outdated
[![Codecov](https://img.shields.io/codecov/c/github/prettier/prettier.svg)](https://codecov.io/gh/prettier/prettier)
[![NPM version](https://img.shields.io/npm/v/prettier.svg)](https://www.npmjs.com/package/prettier)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](#badge)
![](https://cloud.githubusercontent.com/assets/311752/24736977/385d81c8-1a40-11e7-8adc-c4c879ba6c31.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

![Prettier Banner](https://raw.githubusercontent.com/prettier/prettier-logo/master/images/prettier-banner-dark.png)?

docs/options.md Outdated
* [`graphql`](https://github.com/graphql/graphql-js/tree/master/src/language) _Since v1.5.0_

[Custom parsers](#custom-parser-api) are also supported. _Since v1.5.0_
[Custom parsers](./custom-parser-api.html) are also supported. _Since v1.5.0_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is a special case: [Custom parsers](./api.html#custom-parser-api)

@azz azz force-pushed the docs-to-website branch from 5bdfb6b to 52cb134 Compare November 3, 2017 14:07
@azz azz mentioned this pull request Nov 4, 2017
9 tasks
@azz
Copy link
Member Author

azz commented Nov 4, 2017

OK I think this is good to go, any final comments?

@ikatyang
Copy link
Member

ikatyang commented Nov 4, 2017

Just realized we forgot to mention the markdown support on homepage: azz#1

Copy link
Collaborator

@existentialism existentialism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

docs/ignore.md Outdated

## Markdown

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```markdown ( ```md will cause yarn build failed)

image

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I had to remove vim from a bunch of places for the same reason. Should investigate because vim is supported by Prism.

Copy link
Member

@ikatyang ikatyang Nov 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the prism in docusaurus is outdated, I didn't see any vim in website/node_modules/docusaurus/lib/core/Prism.js, and the new [email protected] seems replaced it with highlight.js.

@azz
Copy link
Member Author

azz commented Nov 5, 2017

Not sure why codecov is saying coverage decreased. Didn't touch any source code.

docs/cli.md Outdated
---

Run Prettier through the CLI with this script. Run it without any
arguments to see the [options](./options.html).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docusaurus.io/docs/en/doc-markdown.html#linking-other-documents

This can help when you want to navigate through docs on GitHub since the links there will be functional links to other documents (still on GitHub), but the documents will have the correct html links when they get rendered.

[options](./options.html) -> [options](options.md)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh neat. I'll check if it works with the version we're using.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested, it works. 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@azz azz merged commit 71a5533 into prettier:master Nov 7, 2017
@azz azz deleted the docs-to-website branch November 7, 2017 03:39
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants