diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 10b7e8dd..cb3793fe 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,15 +1,28 @@ - + -```js +**Prettier 1.6.1** +[Playground link](https://prettier.io/playground/#.....) +```sh +# Options (if any): +--single-quote +``` + +**Input:** +```jsx +// code snippet +``` + +**Output:** +```jsx // code snippet ``` **Expected behavior:** - -**Actual behavior:** \ No newline at end of file diff --git a/scripts/build/build.js b/scripts/build/build.js index 106f3921..4a321a57 100755 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -4,6 +4,7 @@ const path = require("path"); const pkg = require("../../package.json"); +const formatMarkdown = require("../../website/static/markdown"); const shell = require("shelljs"); const rootDir = path.join(__dirname, "..", ".."); @@ -99,15 +100,22 @@ shell.sed( ); shell.echo("Update ISSUE_TEMPLATE.md"); -shell.sed( - "-i", - /(Prettier Version.+?)\d+\.\d+\.\d+/, - `$1${pkg.version}`, - ".github/ISSUE_TEMPLATE.md" +const issueTemplate = shell.cat(".github/ISSUE_TEMPLATE.md").stdout; +const newIssueTemplate = issueTemplate.replace( + /-->[^]*$/, + "-->\n\n" + + formatMarkdown( + "// code snippet", + "// code snippet", + "", + pkg.version, + "https://prettier.io/playground/#.....", + { parser: "babylon" }, + [["# Options (if any):", true], ["--single-quote", true]], + true + ) ); - -shell.echo("Create prettier-version.js"); -pipe(`prettierVersion = "${pkg.version}";\n`).to(`${docs}/prettier-version.js`); +pipe(newIssueTemplate).to(".github/ISSUE_TEMPLATE.md"); shell.echo("Copy sw-toolbox.js to docs"); shell.cp("node_modules/sw-toolbox/sw-toolbox.js", `${docs}/sw-toolbox.js`); diff --git a/website/pages/playground/index.html b/website/pages/playground/index.html index 936baa6b..72f52b53 100644 --- a/website/pages/playground/index.html +++ b/website/pages/playground/index.html @@ -1,5 +1,5 @@ - +
@@ -11,8 +11,8 @@ - - + + @@ -21,13 +21,15 @@ - - + + + + @@ -35,93 +37,79 @@ +{ok}
: