From 889cbe3f79016f33521ec97100f16f8309012c00 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 27 Jan 2019 20:13:25 +0700 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20Release=202.0.0-rc.2=20?= =?UTF-8?q?=F0=9F=94=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8484a94..a22943e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# [2.0.0-rc.2](https://github.com/Rebilly/ReDoc/compare/v2.0.0-rc.1...v2.0.0-rc.2) (2019-01-27) + + +### Bug Fixes + +* make padding for md code blocks and code samples consistent ([007752d](https://github.com/Rebilly/ReDoc/commit/007752d)) +* make syntax highlighting for md js code blocks same as for payload samples ([d197c0f](https://github.com/Rebilly/ReDoc/commit/d197c0f)) +* Only display API version if present ([#773](https://github.com/Rebilly/ReDoc/issues/773)) ([fb3cb36](https://github.com/Rebilly/ReDoc/commit/fb3cb36)) + + + # [2.0.0-rc.1](https://github.com/Rebilly/ReDoc/compare/v2.0.0-rc.0...v2.0.0-rc.1) (2019-01-17) diff --git a/package.json b/package.json index bef23f02..4b477f47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redoc", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "description": "ReDoc", "repository": { "type": "git", From 4e8ee0305d0830ebdbd7442613b834c9ca343ec6 Mon Sep 17 00:00:00 2001 From: Siarhei Bautrukevich Date: Thu, 31 Jan 2019 04:51:44 +0300 Subject: [PATCH 2/4] feat(cli): Add templateOptions param to pass additional data to custom template (#792) * Add templateOptions param to pass additional data to custom template * Update README for ReDoc cli --- cli/README.md | 1 + cli/index.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cli/README.md b/cli/README.md index 7b836f47..9c4d8dd6 100644 --- a/cli/README.md +++ b/cli/README.md @@ -17,5 +17,6 @@ Some examples: - Bundle with main color changed to `orange`:
`$ redoc-cli bundle [spec] --options.theme.colors.primary.main=orange` - Serve with `nativeScrollbars` option set to true:
`$ redoc-cli serve [spec] --options.nativeScrollbars` - Bundle using custom template (check [default template](https://github.com/Rebilly/ReDoc/blob/master/cli/template.hbs) for reference):
`$ redoc-cli bundle [spec] -t custom.hbs` +- Bundle using custom template and add custom `templateOptions`:
`$ redoc-cli bundle [spec] -t custom.hbs --templateOptions.metaDescription "Page meta description"` For more details run `redoc-cli --help`. diff --git a/cli/index.ts b/cli/index.ts index d3609499..3abe4c6f 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -26,6 +26,7 @@ interface Options { output?: string; title?: string; templateFileName?: string; + templateOptions?: any; redocOptions?: any; } @@ -65,6 +66,7 @@ YargsParser.command( ssr: argv.ssr, watch: argv.watch, templateFileName: argv.template, + templateOptions: argv.templateOptions || {}, redocOptions: argv.options || {}, }; @@ -112,6 +114,7 @@ YargsParser.command( cdn: argv.cdn, title: argv.title, templateFileName: argv.template, + templateOptions: argv.templateOptions || {}, redocOptions: argv.options || {}, }; @@ -128,6 +131,9 @@ YargsParser.command( describe: 'Path to handlebars page template, see https://git.io/vh8fP for the example ', type: 'string', }) + .options('templateOptions', { + describe: 'Additional options that you want pass to template. Use dot notation, e.g. templateOptions.metaDescription', + }) .options('options', { describe: 'ReDoc options, use dot notation, e.g. options.nativeScrollbars', }).argv; @@ -207,7 +213,7 @@ async function bundle(pathToSpec, options: Options = {}) { async function getPageHTML( spec: any, pathToSpec: string, - { ssr, cdn, title, templateFileName, redocOptions = {} }: Options, + { ssr, cdn, title, templateFileName, templateOptions, redocOptions = {} }: Options, ) { let html; let css; @@ -241,15 +247,16 @@ async function getPageHTML( ssr ? 'hydrate(__redoc_state, container);' : `init("spec.json", ${JSON.stringify(redocOptions)}, container)` - }; + }; `, redocHead: ssr ? (cdn - ? '' - : ``) + css + ? '' + : ``) + css : '', title, + templateOptions, }); } From c366cf434f47775847cd08fb38eea58d44e429f3 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Thu, 31 Jan 2019 09:55:27 +0800 Subject: [PATCH 3/4] chore: update mobx peer dependency version fixes #741 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b477f47..02e22d79 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "yaml-js": "^0.2.3" }, "peerDependencies": { - "mobx": "^4.2.0", + "mobx": "^4.2.0 || ^5.0.0", "react": "^16.2.0", "react-dom": "^16.2.0", "styled-components": "^4.0.1" From 12cfb6ebdea2cc9ee6a42a0d3ee0eaa8275aa086 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Thu, 31 Jan 2019 19:25:03 +0800 Subject: [PATCH 4/4] chore: update styled components peer dep closes #801 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 02e22d79..92485e2e 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "mobx": "^4.2.0 || ^5.0.0", "react": "^16.2.0", "react-dom": "^16.2.0", - "styled-components": "^4.0.1" + "styled-components": "^4.1.1" }, "dependencies": { "classnames": "^2.2.6",