Skip to content

Commit

Permalink
Merge pull request #213 from marp-team/hide-preview-option
Browse files Browse the repository at this point in the history
Hide preview option and indicate that does not support Chrome >= 81
  • Loading branch information
yhatt committed Mar 19, 2020
2 parents 171f61c + a4aee26 commit e71a306
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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/`.

<!--
### Preview window (_Experimental:_ `--preview` / `-p`)
When conversions were executed together with `--preview` (`-p`) option, Marp CLI will open preview window(s) to check the converted result immediately.
Expand All @@ -213,6 +212,8 @@ Unlike opening with browser, you may present deck with the immersive window. [Wa
> :information_source: `--preview` option cannot use when you are using Marp CLI through official docker image.
-->

## Template

You can choose a built-in HTML templates by `--template` option. Default template is `bespoke`.
Expand Down Expand Up @@ -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 |
Expand Down
6 changes: 5 additions & 1 deletion src/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export default async function(argv: string[] = []): Promise<number> {
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',
},
Expand Down Expand Up @@ -296,6 +297,9 @@ export default async function(argv: string[] = []): Promise<number> {
const preview = new Preview()
preview.on('exit', () => process.exit())
preview.on('opening', (location: string) => {
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}...`
cli.info(chalk.cyan(msg))
Expand Down
2 changes: 1 addition & 1 deletion test/marp-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion test/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CLIError } from '../src/error'
jest.mock('path')
jest.setTimeout(15000)

describe('Preview', () => {
xdescribe('Preview', () => {
const previews = new Set<Preview>()
const preview = (...args) => {
const instance = new Preview(...args)
Expand Down

0 comments on commit e71a306

Please sign in to comment.