From 4d2d62ffe4444429f56bf76365978d74a540edb9 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sun, 15 Mar 2020 18:12:00 +0900 Subject: [PATCH 1/4] Hide preview option because of unmaintained carlo --- README.md | 8 ++++---- src/marp-cli.ts | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1619dd8d..0ef58b3b 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,6 @@ npx @marp-team/marp-cli -w slide-deck.md # Server mode (Pass directory to serve) npx @marp-team/marp-cli -s ./slides - -# Open converted HTML in preview window -npx @marp-team/marp-cli -p slide-deck.md ``` > :information_source: You have to install [Google Chrome] (or [Chromium]) to convert slide deck into PDF, PPTX, and image(s). @@ -205,6 +202,8 @@ Marp CLI server will provide the list of served files by default, but you can pl Place Markdown named `index.md` or `PITCHME.md` ([GitPitch style](https://gitpitch.com/docs/getting-started/pitchme/)) to served directory. It would be redirected just accessing to `http://localhost:8080/`. + + ## Template You can choose a built-in HTML templates by `--template` option. Default template is `bespoke`. @@ -430,7 +431,6 @@ By default we use configuration file that is placed on current directory, but yo | `options` | object | | The base options for the constructor of engine | | `output` | string | `--output` `-o` | Output file path (or directory when input-dir is passed) | | `pdf` | boolean | `--pdf` | Convert slide deck into PDF | -| `preview` | boolean | `--preview` `-p` | Open preview window _(EXPERIMENTAL)_ | | `server` | boolean | `--server` `-s` | Enable server mode | | `template` | `bare` \| `bespoke` | `--template` | Choose template (`bespoke` by default) | | `theme` | string | `--theme` | Override theme by name or CSS file | diff --git a/src/marp-cli.ts b/src/marp-cli.ts index 5c51ceb9..9e6d8076 100644 --- a/src/marp-cli.ts +++ b/src/marp-cli.ts @@ -81,7 +81,8 @@ export default async function(argv: string[] = []): Promise { preview: { alias: 'p', describe: 'Open preview window (EXPERIMENTAL)', - hidden: !!process.env.IS_DOCKER, + // hidden: !!process.env.IS_DOCKER, + hidden: true, // https://github.com/marp-team/marp-cli/issues/211 group: OptionGroup.Basic, type: 'boolean', }, @@ -296,6 +297,9 @@ export default async function(argv: string[] = []): Promise { const preview = new Preview() preview.on('exit', () => process.exit()) preview.on('opening', (location: string) => { + cli.error( + 'The EXPERIMENTAL preview option does no longer work with the current stable Chrome >= 81 because of the unmaintained dependent package carlo. See details: https://github.com/marp-team/marp-cli/issues/211' + ) const loc = location.substr(0, 50) const msg = `[Preview] (EXPERIMENTAL) Opening ${loc}...` cli.info(chalk.cyan(msg)) From 8aa8b7a776feccdfb0232d622d4e6d028687624a Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Sun, 15 Mar 2020 18:31:38 +0900 Subject: [PATCH 2/4] Skip tests with preview option --- test/marp-cli.ts | 2 +- test/preview.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/marp-cli.ts b/test/marp-cli.ts index 81e26919..6c8593ab 100644 --- a/test/marp-cli.ts +++ b/test/marp-cli.ts @@ -157,7 +157,7 @@ describe('Marp CLI', () => { expect(error).toBeCalledWith(expect.stringContaining('Usage')) }) - describe('Preview option', () => { + xdescribe('Preview option', () => { it('outputs help about --preview option', async () => { expect(await run()).toBe(0) expect(error).toBeCalledWith(expect.stringContaining('--preview')) diff --git a/test/preview.ts b/test/preview.ts index 345d90b6..c28d5726 100644 --- a/test/preview.ts +++ b/test/preview.ts @@ -7,7 +7,7 @@ import { CLIError } from '../src/error' jest.mock('path') jest.setTimeout(15000) -describe('Preview', () => { +xdescribe('Preview', () => { const previews = new Set() const preview = (...args) => { const instance = new Preview(...args) From c2fd1b8469c99038182048b074818c6c17716d57 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 20 Mar 2020 04:14:07 +0900 Subject: [PATCH 3/4] Update warning to express well what happening --- src/marp-cli.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/marp-cli.ts b/src/marp-cli.ts index 9e6d8076..50369578 100644 --- a/src/marp-cli.ts +++ b/src/marp-cli.ts @@ -297,8 +297,8 @@ export default async function(argv: string[] = []): Promise { const preview = new Preview() preview.on('exit', () => process.exit()) preview.on('opening', (location: string) => { - cli.error( - 'The EXPERIMENTAL preview option does no longer work with the current stable Chrome >= 81 because of the unmaintained dependent package carlo. See details: https://github.com/marp-team/marp-cli/issues/211' + cli.warn( + `${chalk.yellow`[DEPRECATION WARNING]`} Due to the unmaintained dependent package ${chalk.cyan`carlo`} and incompatible Chrome / Chromium >= 81, the EXPERIMENTAL preview option provided by ${chalk.yellow`--preview`} or ${chalk.yellow`-p`} may no longer work correctly. See details: ${chalk.blueBright`https://github.com/marp-team/marp-cli/issues/211`}` ) const loc = location.substr(0, 50) const msg = `[Preview] (EXPERIMENTAL) Opening ${loc}...` From a4aee266e753a3266009d58713510e0b10270487 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Fri, 20 Mar 2020 04:42:46 +0900 Subject: [PATCH 4/4] [ci skip] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7436cdd2..7f6259c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Upgrade dependent packages to the latest version ([#212](https://github.com/marp-team/marp-cli/pull/212), [#215](https://github.com/marp-team/marp-cli/pull/215)) +### Deprecated + +- Hide the experimental `--preview` / `-p` option and show deprecation warning when used ([#211](https://github.com/marp-team/marp-cli/issues/211), [#213](https://github.com/marp-team/marp-cli/pull/213)) + ## v0.17.2 - 2020-02-25 ### Fixed