Code Monkey home page Code Monkey logo

vscode-reveal's Introduction

vscode-reveal install

codecov Quality Gate Status

This extension let you display a reveal.js presentation directly from an opened markdown document.

demo

Full documentation here

Features

Markdown

Create reveal.js presentation directly from markdown file, open or create a new file in markdown and use default slide separator to see slide counter change in the status bar and title appear in the sidebar.

Since Reveal.js use marked to parse the markdown string you can use this in your document:

  • GitHub flavored markdown.
  • GFM tables

If you need a sample file you can get it here: https://raw.githubusercontent.com/evilz/vscode-reveal/master/sample.md

Status bar

As soon as your markdown document has at least two slides, slides counter will appear in the status bar on right.

Clicking on slide counter will launch preview on right, and you can now see the local address of express server used to host Reveal presentation. Clicking on the address will launch presentation in the browser.

You can stop express server when you want by clicking on the red square.

Sidebar and navigation

Now in version 2, you can see a list of all your slides on the sidebar. The list will show the first line of text that is found in the slide, most of the time it will be a title, but it can also be an image or something else.

Blue icon is used to show horizontal slide, orange is used for vertical ones.

Clicking on slide name will move the cursor on beginning of the slide in the editor. If the preview is opened it will also show the selected slide on it.

Theme

reveal.js comes with a few themes built in:

  • black - Black background, white text, blue links (default)
  • white - White background, black text, blue links
  • league - Gray background, white text, blue links
  • beige - Beige background, dark text, brown links
  • sky - Blue background, thin dark text, blue links
  • night - Black background, thick white text, orange links
  • serif - Cappuccino background, gray text, brown links
  • simple - White background, black text, blue links
  • solarized - Cream-colored background, dark green text, blue links
  • blood - Dark background, thick white text, red links
  • moon - Dark blue background, thick grey text, blue link

You can set it using revealjs.theme parameter in Vs code config or in the document itself using front matter.

If you want a custom theme you can do it! Just add custom style to a CSS file in the same folder that your markdown.

example: if your file name is my-theme.css just add this in the front matter header :

---
customTheme : "my-theme"
---

Note that you can use both theme and custom theme at the same time. Your custom theme will be loaded after to override default reveal.js theme.

Highlight Theme

You can use code block in your markdown that will be highlighted by highlight.js. So you can configure the coloration theme by setting revealjs.highlightTheme parameter of VS Code, or set it using front matter.

---
highlightTheme : "other theme"
---

Get the theme list here https://highlightjs.org/

Reveal.js Options

You can customize many setting on for your reveal.js presentation.

NameDescriptionDefault
revealjs.notesSeparatorRevealjs markdown note delimiternote:
revealjs.separatorRevealjs markdown slide separator^( ?| )---( ?| )$
revealjs.verticalSeparatorRevealjs markdown vertical separator^( ?| )--( ?| )$
revealjs.themeRevealjs Theme (black, white, league, beige, sky, night, serif, simple, solarizedblack
revealjs.highlightThemeHighlight ThemeZenburn
revealjs.controlsDisplay controls in the bottom right cornertrue
revealjs.progressDisplay a presentation progress bartrue
revealjs.slideNumberDisplay the page number of the current slide
revealjs.historyPush each slide change to the browser history
revealjs.keyboardEnable keyboard shortcuts for navigationtrue
revealjs.overviewEnable the slide overview modetrue
revealjs.centerVertical centering of slidestrue
revealjs.touchEnables touch navigation on devices with touch inputtrue
revealjs.loopLoop the presentation
revealjs.rtlChange the presentation direction to be RTL
revealjs.shuffleRandomizes the order of slides each time the presentation loads
revealjs.fragmentsTurns fragments on and off globallytrue
revealjs.embeddedFlags if the presentation is running in an embedded mode, i.e. contained within a limited portion of the screen
revealjs.helpFlags if we should show a help overlay when the questionmark key is pressedtrue
revealjs.showNotesFlags if speaker notes should be visible to all viewers
revealjs.autoSlideNumber of milliseconds between automatically proceeding to the next slide, disabled when set to 0, this value can be overwritten by using a data-autoslide attribute on your slides
revealjs.autoSlideMethodThe direction in which the slides will move whilst autoslide is activetReveal.navigateNext
revealjs.autoSlideStoppableStop auto-sliding after user inputtrue
revealjs.mouseWheelEnable slide navigation via mouse wheel
revealjs.hideAddressBarHides the address bar on mobile devicestrue
revealjs.previewLinksOpens links in an iframe preview overlay
revealjs.transitionTransition style (none/fade/slide/convex/concave/zoom)default
revealjs.transitionSpeedTransition speed (default/fast/slow)default
revealjs.backgroundTransitionTransition style for full page slide backgrounds (none/fade/slide/convex/concave/zoom)default
revealjs.viewDistanceNumber of slides away from the current that are visible3
revealjs.parallaxBackgroundImageParallax background image
revealjs.parallaxBackgroundSizeParallax background size (CSS syntax, e.g. 2100px 900px)
revealjs.parallaxBackgroundHorizontalNumber of pixels to move the parallax background per slide
revealjs.parallaxBackgroundVerticalNumber of pixels to move the parallax background per slide

YAML Front Matter

You can change settings directly in your markdown file using front matter style. You can change all extention settings like this :

---
theme : "white"
transition: "zoom"
---

Note do not add revealjs. prefix before setting name.

Open preview on right side

To display the preview on the right side you can :

  • click on slide count in status bar
  • click split icon in sidebar header
  • call command Revealjs: Show presentation by side

The preview will be synchronize with the current cursor position.

Open in browser

To display presentation in the browser you can:

  • click on server address in the status bar
  • click the icon in sidebar header
  • call command Revealjs: Open presentation in a browser

This will try to use Chrome that is the best browser to use for reveal.js presentation, if it can't find it, your default browser will be used.

Print to PDF

To export your presentation to pdf you can:

  • click on PDF icon in the sidebar
  • call the command Revealjs: Export in PDF

This will try to launch Chrome or your default browser and launch printing. Be sure to set print setting correctly:

  • No margin
  • print background

Export static Website

To export your presentation to a static website you can:

  • click on HTML icon in the sidebar
  • call the command Revealjs: Export in HTML

This will try to launch Chrome in headless or your default browser it takes about 10sec and then open the export folder.

Plugins

Disable slideout menu

---
enableMenu: false
---

Disable chalkboard

---
enableChalkboard: false
---

Disable title footer

---
enableTitleFooter: false
---

Disable zoom

---
enableZoom: false
---

Disable search

---
enableSearch: false
---

FAQ

Note : The first time, Windows will ask you about the firewall. If you open the port for the application, you can see your presentation remotely.

Known Issues

Please add issues on github.

vscode-reveal's People

Contributors

code-factor avatar damageboy avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar distantcam avatar evil-shrike avatar evilz avatar fuhrmanator avatar hamen avatar imgbotapp avatar johnnyreilly avatar mjbvz avatar rdbartram avatar vbshift avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-reveal's Issues

How exactly do you use this?

Where are the instructions? Do you make a markdown file? Or an html file?

I create a markdown file and run the command:

Reaveljs: Open presentation in browser

and I get the notification:

Command: vscode-revealjs.showRevealJSInBrowser not found

I get similar notifications for every RevealJS command.

The documentation seems to have a ton of information about the details of the different options and commands and stuff, but it has almost no info on how to actually get started. Do you have to install reveal.js locally in your HTML?

#confused.

upgrade to reveal.js 3.7

Hi there,

Reveal.js v 3.7 brings the new Key Bindings API. This allows the users (well... me at least) to more easily hack Template.js and add a custom script to allow local plug-ins (stored side by side with the .md files) by configuring part of them post-initialization.

E.g.

function setCustomKeys() {
  // clear chalkboard when 'DEL' is pressed
  Reveal.addKeyBinding( 46, function() {
    RevealChalkboard.clear();
  });
  // reset chalkboard data on current slide when 'BACKSPACE' is pressed
  Reveal.addKeyBinding( 8, function() {
    RevealChalkboard.reset();
  });
}

window.onload = () => {
  setCustomKeys();
}

If you have some spare time, I would really appreciate a new release with updated dependencies.
Thank you,
dezGusty

CustomTheme broken?

Hi,
I'm using vs-code version 1.31.0 together with current vscode-reveal 3.2.0 on MacOsx Mojave.

However there seems to be a problem with customTheme entries. When I use a cusomTheme in the preamble of my slides the theme is not loaded in preview or browser preview. The slides fall back to the default theme.

The css-File for the custom theme I want to use is the same directory as my markdown slides. Filename is custom.css, preamble of my markdown document is

---
customTheme : "custom"
transition: "fade"
highlightTheme: "obsidian"
---

I don't know if that has something to do with the the issue stated above, however it also seems that images cannot be found - as preview and browser preview cannot load and display images.

When switching back to version 2.0.0 (Preview) form vscode market-place everything works fine. Thanks for your help.

Default separator broken

Versions : vscode-reveal extension = 3.2.0, vscode = 1.31.0 (January 2019)

When no slide separator is specified, --- works fine with the extensions (slide count, slide explorer) but does not work in the side preview and in the browser: only one slide is recognized.

When --- is specified as slide separator in the header, side preview and in browser rendering are fine but slide count and slide explorer now take into account the --- used to specify the header.

Example:

---
highlightTheme: "darkula"
slideNumber: true
separator: ^( ?| )---( ?| )$
---

# Hello

Slide 1

---

## Slide 2

Slide 2

---

Slide 3

When defining and using ---- as slide separator, slide count and slide explorer are still falsy.

Allow shorthand for GitHub image URL

Much similar to #8

But ![](/image.png) should automatically mean ![](https://github.com/<USERNAME>/<REPO>/blob/master/image.png?raw=true),

and ![](../<BRANCH>/image.png) means ![](https://github.com/<USERNAME>/<REPO>/blob/<BRANCH>/image.png?raw=true).

without having to upload to GitHub first.

Support local images

Images are not loaded from local files

Given pres.md file with joke.gif beside it

# A slide with a joke
![joke.gif](joke.gif)

won't show the image.

Images with http urls work fine.

Option for offline MathJax

First of all, thanks for this amazing extension! It's just so convenient!

While it is very easy to set the path to the default browser, It seems that it's not straightforward to change the location of mathjax, e.g. for offline use. At least as far as I know reveal.js loads mathjax from an online source, but I do have sometimes limited connection and like to create presentations with math rendering nonetheless.

Is there an easy way to change the mathjax path and I just missed it?
Could you add this as an option if it is not yet included?

Add all plugins. Config enable/disable

there is no way to add plugins now

try to add chalkboard.js plugin

---
theme : "night"
transition: "slide"
history: true
dependencies: [
  { src: "./chalkboard.js" }
]
---

and this will overwrite the whole dependencies

how can i render mermaid in slides?

I used mermaid in markdown, like:

sequenceDiagram
   participant A
   participant B
   A -> B: test
Loading

It can be render well in markdown preview, but it just shown as original code not a diagram in the slides. How can i do to make the presentation support mermaid in markdown?

Add tree view to list all slides

  • manage tree (parent/child)
  • Display main text H1 then h2 ...
  • on selection navigate to slide
  • command with icon to add new slide
  • command with to mode up/down
  • command with icon to delete
  • command to clone silde(s)
  • Button to display preview on right
  • Button to open in browser
  • Button to export in pdf
  • Button to export in HTML

Allow to disable custom explorer view on startup

Every time a new project is opened, this extension will create a custom explorer view. VSCode allow users to hide custom explorer views out of the box. However, doing this hiding stuffs on multiple projects is quite tedious. By allowing users to disable custom explorer view at all help reduce these kind of task a lot.

I don't see if VSCode already provide an option to disable any custom explorer view by default (microsoft/vscode#34557). So that's why I open this issue.

Extension doesn't work

VSCode version - 1.31.0
Extension version - 3.0.0

Slides doesn't appear after markdown document was opened.
Render server seems to be not started.
I've tried to uninstall/install extension but it doesn't help.

Auto separator for heading tags

automatically create a slide show broken up into sections by using the # and ## heading tags and create a new slide without a header using a horizontal rule (----).

not used

when refresh, the presentation start from the first slide, this is not good!

Bad refresh on onDidChangeActiveTextEditor

mainThreadExtensionService.ts:44 TypeError: Cannot read property 'refresh' of undefined
at refreshAll (C:\Users\Riges.vscode\extensions\evilz.vscode-reveal-2.0.2\out\src\extension.js:31:30)
at vscode.window.onDidChangeActiveTextEditor.editor (C:\Users\Riges.vscode\extensions\evilz.vscode-reveal-2.0.2\out\src\extension.js:54:13)
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:238)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:485:858
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:218)
at e.$acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:435:723)
at t.e.invoke (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:516:87)
at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:580)
at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:357:270)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:356:206
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:358:204
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:85:988
at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:218)
at Socket. (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:135:717)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream
mainThreadExtensionService.ts:43 [evilz.vscode-reveal]Cannot read property 'refresh' of undefined
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
e.invoke @ abstractThreadService.ts:42
e._invokeHandler @ rpcProtocol.ts:109
e._receiveOneMessage @ rpcProtocol.ts:96
(anonymous) @ rpcProtocol.ts:32
(anonymous) @ rpcProtocol.ts:157
e.fire @ event.ts:142
(anonymous) @ ipc.net.ts:81
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560

FR: Page title in YAML

I would like to be able to set the page title in the YAML front matter. Something like:

title: "My presentation"

Would be great. I realize that this is (obviously) not a RevealJS option, and might not be the easiest thing to implement.

Rendering/export broken with version > 3.0

Hi,
I'm coming across some errors making the extension not usable since the version 3.0.0 (2.03 being the last working version )

this is a screen shot of what I have in the side panel or in the browser
image

and the following errors inside the chrome console:
image

My setup:
Version: 1.31.0 (user setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

Easier access to fragments

Hey there, really enjoying the extention so far

I was wondering if there are any plans to integrate fragments ino he markdown syntax, since writing HTML in Markdown just doesn't feel right

Thanks in advance

Can we customize CSS?

I'd like to override a few of the CSS rules in the reveal theme css

e.g. I'd like to do things like turn off text-transform: uppercase; for headings change the color of inline code by adding a rule like .reveal code { color: aquamarine; } etc

Is there already a way to accomplish this?

If not, could there be a way to insert a special command in the markdown that points at a CSS file of customizations to get copied as part of the presentation.

thanks

reveal-md backend

I have a workspace with reveal.json and reveal-md.json and a custom theme folder (replaces MathJax with KaTeX in html template plus custom CSS). Is there a way to use this extension in combination with reveal-md as backend and still get synced slide preview inside of vscode?

YAML header with settings for current presentation

Hi
Plugin has a lot of settings (Extension Settings) but they can be set only globally.
It'd be nice to support some YAML header at the top of Markdown-file.

---
theme: white
---
# First Slide 
---
## Second Slide

Allow configuration of google chrome path

Thanks for writing this very useful plugin!

On one of my machines running arch linux I use "Chromium" instead of "Google Chrome". Currently the path is hardcoded in file ChromeHelpers. Is it possible to make the path configurable in the future?

Workaround (in case anybody has a similar issue):

sudo ln -s /usr/bin/chromium /usr/bin/google-chrome

Problem with background in Highlight Theme

Hi,

i use a light (white) theme and want to put some code in a dark highlight theme like monokai.
Unfortunateley the background of hjs elements are always set to none.

---
title: Bug with highlightTheme
theme: "simple"
highlightTheme: "monokai"
---

```bash
cd ~/src
mkdir newProject
cd newProject
```

Actual is:
wrong

Should be:
ok

Cannot read property 'toString' of undefined:

I'm seeing this error while saving files (usually my settings):

shell.ts:419 [evilz.vscode-reveal] Cannot read property 'toString' of undefined: TypeError: Cannot read property 'toString' of undefined
	at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:345115
	at e.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:55287)
	at e.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:57078)
	at BrowserContentProvider.update (/Users/matb/.vscode-insiders/extensions/evilz.vscode-reveal-0.0.9/out/src/BrowserContentProvider.js:23:27)
	at context.subscriptions.push.vscode.workspace.onDidSaveTextDocument (/Users/matb/.vscode-insiders/extensions/evilz.vscode-reveal-0.0.9/out/src/extension.js:80:22)
	at e.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:55287)
	at e.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:57078)
	at e.$acceptModelSaved (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:347983)
	at t.e.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:423343)
	at e._invokeHandler (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:28:279983)

I'll submit a PR with a fix

It can't find my chrome

Every action that requires chrome throws:
Can find Chrome on your computer, try with default browser...
But:
$ which google-chrome
/usr/bin/google-chrome

and xdg-open works

Pause with B or . does not toggle the pause black screen in normal mode

Some information about what I've noticed about this :

In normal mode, it looks like pressing B or . does not toggle the pause black screen (pressing those does not do anything actually).

However in speaker view mode, I noticed that B toggles the chalkboard, and . toggles the pause black screen correctly

Is there any way to toggle the pause black screen in normal mode ?

enable syntax highlighting

awesome extension, just wondering if there is a way to enable syntax highlighting?
For example, if I do this, the correct highlightjs tags seem to get generated in HTML but the style sheets seem to be missing so there is no syntax highlighting.

```csharp
var x = Hello.World("Hello World");
```

Can't get fragments to work

Hi have tried

- asdfas<!-- .element: class="fragment" data-fragment="1" -->
- asdfas<!-- .element: class="fragment" data-fragment="2" -->
- asdfasd<!-- .element: class="fragment" data-fragment="3" -->

To use fragments but can't get it to work. And it's a awesome extension.

Question: Should speaker mode be possible in preview

Hello,

should it be possible to use the speaker mode when presenting through the integrated preview ("show presentation by side")? If I press s nothing happens. If I use the browser view ("Open presentation in browser"), then it works

VERSION 3 checklist

  • new webview api for split view
  • new activitybar for slides explorer
  • showRevealJSInBrowser
  • stopServer
  • container.goToSlide
  • exportPDF
  • exportHTM
  • new template

PLUGINS

  • plugin marked

  • markdown

  • highlight

  • search

  • zoom

  • notes

  • chalkboard

  • Chart

  • csv2chart

  • embed-tweet

  • menu

  • math.js

  • title-footer

  • reveal-code-focus

  • Readme

Side by side wiev does not refresh

Thanks guys for the tool love it.

I might have missed something but i have not found a way to get the side by side view to refresh when
the MD file is updated. exept triggering a new side by side view

it would be neice to be able to reload it or even auto reload on changes

Export does not create notes.html

The HTML Export feature does not copy the notes.html file used for the presenter and notes view (opened via pressing s on the keyboard).

What i am doing wrong

I installed it but when i call it it fails with:

command 'vscode-revealjs.showRevealJSInBrowser' not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.