Skip to content

Commit

Permalink
Merge pull request #233 from marp-team/v1
Browse files Browse the repository at this point in the history
v1 release
  • Loading branch information
yhatt authored May 17, 2021
2 parents b1cc297 + 850c086 commit 79e651a
Show file tree
Hide file tree
Showing 41 changed files with 3,136 additions and 685 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

## [Unreleased]

### Breaking

- VS Code >= 1.56 is now required ([#231](https://github.com/marp-team/marp-vscode/pull/231))
- Renamed command `markdown.marp.toggleMarpPreview` to `markdown.marp.toggleMarpFeature` ([#235](https://github.com/marp-team/marp-vscode/pull/235))

### Added

- IntelliSense for Marp directives ([#158](https://github.com/marp-team/marp-vscode/issues/158), [#235](https://github.com/marp-team/marp-vscode/pull/235))
- Auto completion for directive keys and some values
- Syntax highlight for recognized directive keys
- Hover help for recognized directives

* `overloading-global-directive` diagnostic: Mark overloaded global directive in the subsequent definition ([#232](https://github.com/marp-team/marp-vscode/pull/232))
* `unknown-theme` diagnostic: Mark if the specified theme name is not recognized by the extension ([#236](https://github.com/marp-team/marp-vscode/pull/236))

### Changed

- Support [Workspace Trust](https://code.visualstudio.com/updates/v1_56#_workspace-trust): Restrict some features in the untrusted workspace ([#231](https://github.com/marp-team/marp-vscode/pull/231))
- Upgrade Marp Core to [v2.0.3](https://github.com/marp-team/marp-core/releases/v2.0.3) ([#237](https://github.com/marp-team/marp-vscode/pull/237))
- Upgrade Marp CLI to [v1.1.1](https://github.com/marp-team/marp-cli/releases/v1.1.1) ([#237](https://github.com/marp-team/marp-vscode/pull/237))
- PPTX export will become to pre-render images with high resolution
- Upgrade dependent packages to the latest version ([#237](https://github.com/marp-team/marp-vscode/pull/237))

## v0.19.1 - 2021-05-11

### Fixed
Expand Down
69 changes: 63 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ See the documentation of [Marpit Markdown](https://marpit.marp.app/markdown) and

## Usage

Marp preview for Markdown document will be enabled when `marp: true` is written in front-matter.
Marp features will be enabled when `marp: true` is written in a front-matter of Markdown document.

```markdown
---
Expand All @@ -34,7 +34,7 @@ marp: true
Start writing!
```

It also can toggle by opening the quick picker from toolbar icon <img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/toolbar-icon.png" width="16" height="16" /> and selecting **"Toggle Marp preview for current Markdown"**. (`markdown.marp.toggleMarpPreview`).
It also can toggle by opening the quick picker from toolbar icon <img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/toolbar-icon.png" width="16" height="16" /> and selecting **"Toggle Marp feature for current Markdown"**. (`markdown.marp.toggleMarpFeature`).

<p align="center">
<img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/toggle.gif" alt="Toggle Marp preview" width="600" />
Expand All @@ -46,7 +46,52 @@ It also can toggle by opening the quick picker from toolbar icon <img src="https

Marp for VS Code can preview your Marp Markdown with the same way as [a native Markdown preview](https://code.visualstudio.com/docs/languages/markdown#_markdown-preview).

### Export slide deck to HTML, PDF, PPTX, and image
### IntelliSense for Marp directives

[Directives](https://marpit.marp.app/directives), the inherited feature from [Marpit framework](https://marpit.marp.app/), is an important syntax to write the deck in Marp.

If enabled Marp feature by `marp: true`, Marp for VS Code extends [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) to support auto completion, syntax highlight, hover help, and diagnostics for Marp directives.

#### Auto completion

Marp for VS Code can suggest global/local directives supported by Marp ecosystem. We remember all so you may forget them! :stuck_out_tongue:

Hit <kbd>Ctrl</kbd> + <kbd>Space</kbd> within [the front-matter](https://marpit.marp.app/directives?id=front-matter) or [HTML comment](https://marpit.marp.app/directives?id=html-comment) to show the list of directives. You can peek the help of selected directive by hitting <kbd>Ctrl</kbd> + <kbd>Space</kbd> again.

<p align="center">
<img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/auto-completion.gif" alt="Auto completion" width="400" />
</p>

Some directives such as `theme` and `paginate` are also supported auto completion for the value.

#### Highlight and hover help

The key of recognized directives are highlighted in the different color from the around. This visualization may help to find out meaningless definitions.

And you can see the help of a defined directive by hovering cursor on the recognized directive.

<p align="center">
<img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/highlight-and-hover-help.png" alt="Highlight and hover help" width="426" />
</p>

#### Diagnostics

Marp for VS Code can detect some basic problems in Marp directives.

<p align="center">
<img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/diagnostics.png" alt="Diagnostics" width="443" />
</p>

| Name | Description | [Quick Fix] |
| :----------------------------- | :---------------------------------------------------------- | :---------: |
| `deprecated-dollar-prefix` | Check [obsoleted directives prefixed by `$`][dollar-prefix] ||
| `overloading-global-directive` | Find out overloaded global directives | |
| `unknown-theme` | Notify a not recognized theme name | |

[quick fix]: https://code.visualstudio.com/docs/editor/refactoring#_code-actions-quick-fixes-and-refactorings
[dollar-prefix]: https://github.com/marp-team/marpit/issues/182

### Export slide deck to HTML, PDF, PPTX, and image :shield:

We have integrated [Marp CLI][marp-cli] to export your deck into several formats.

Expand All @@ -72,7 +117,7 @@ Default file type can choose by `markdown.marp.exportType` preference.

> ⚠️ Export except HTML requires to install any one of [Google Chrome](https://www.google.com/chrome/), [Chromium](https://www.chromium.org/), or [Microsoft Edge](https://www.microsoft.com/edge). You may also specify the custom path for Chrome / Chromium-based browser by preference `markdown.marp.chromePath`.
### Use custom theme
### Use custom theme CSS :shield:

You can register and use [custom theme CSS for Marpit](https://marpit.marp.app/theme-css) / [Marp Core](https://github.com/marp-team/marp-core/tree/main/themes#readme) by setting `markdown.marp.themes`, that includes remote URLs, or relative paths to local files in the current workspace.

Expand Down Expand Up @@ -135,9 +180,21 @@ You can fold the content of slide in editor while editing Marp Markdown.
<img src="https://raw.githubusercontent.com/marp-team/marp-vscode/main/docs/fold.gif" alt="Slide folding in editor" width="360" />
</p>

### Enable HTML in Marp Markdown
### Security

#### [Workspace Trust](https://github.com/microsoft/vscode/issues/106488)

<!-- TODO: Update link to the formal documentation -->

Some features that may met malicious are restricted in the untrusted workspace (marked by the shield icon :shield: in this documentation).

If the workspace is not trusted, you can use only a basic Marp preview and IntelliSense.

#### Enable HTML in Marp Markdown :shield:

You can enable previsualization of HTML code within Marp Markdown with the `markdown.marp.enableHtml` option.

You can enable previsualization of HTML code within Marp Markdown with the `markdown.marp.enableHtml` option. This feature is disabled as a default because it could allow script injection from untrusted Markdown files. Use with caution.
It could allow script injection from untrusted Markdown files. Thus, this feature is disabled as a default and will be _always ignored in the untrusted workspace_. Use with caution.

## Contributing

Expand Down
Binary file added docs/auto-completion.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/diagnostics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/highlight-and-hover-help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 79e651a

Please sign in to comment.