npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

md2gslides

v0.5.1

Published

Convert Markdown to Google Slides

Downloads

40

Readme

md2googleslides – Markdown to Google Slides

Generate Google Slides from markdown & HTML. Run from the command line or embed in another application.

This project was developed as an example of how to use the Slides API.

While it does not yet produce stunningly beautiful decks, you are encouraged to use this tool for quickly prototyping presentations.

Contributions are welcome.

Installation and usage

For command line use, install md2gslides globally:

npm install -g md2gslides

After installing, import your slides by running:

md2gslides slides.md

The first time the command is run you will be prompted for authorization. Credentials will be stored locally in a file named ~/.credentials/md2gslides.json.

Supported markdown rules

md2gslides uses a subset of the CommonMark and Github Flavored Markdown rules for markdown.

Slides

Each slide is typically represented by a header, followed by zero or more block elements.

Begin a new slide with a horizontal rule (---). The separator may be omitted for the first slide.

The following examples show how to create slides of various layouts:

Title slide

Title slide

Section title slides

Section title slide

Section title & body slides

Section title & body slide

Title & body slides

Title & body slide

Main point slide

Add {.big} to the title to make a slide with one big point

Main point slide

Big number slide

Use {.big} on a header in combination with a body too.

Big number slide

Two column slides

Separate columns with {.column}. The marker must appear on its own line with a blank both before and after.

Two column slide

Images

Inline images

Images can be placed on slides using image tags. Multiple images can be included. Mulitple images in a single paragraph are arranged in columns, mutiple paragraphs arranged as rows.

Note: Images are currently scaled and centered to fit the slide template.

Slide with image

Background images

Set the background image of a slide by adding {.background} to the end of an image URL.

Slide with background image

Videos

Include YouTube videos with a modified image tag.

Slide with video

Speaker notes

Include speaker notes for a slide using HTML comments. Text inside the comments may include markdown for formatting, though only text formatting is allowed. Videos, images, and tables are ignored inside speaker notes.

Formatting

Basic formatting rules are allowed, including:

  • Bold
  • Italics
  • Code
  • Strikethrough
  • Hyperlinks
  • Ordered lists
  • Unordered lists

The following markdown illustrates a few common styles.

Additionally, a subset of inline HTML tags are supported for styling.

  • <span>
  • <sup>
  • <sub>
  • <em>
  • <i>
  • <strong>
  • <b>

Supported CSS styles for use with <span> elements:

  • color
  • background-color
  • font-weight: bold
  • font-style: italic
  • text-decoration: underline
  • text-decoration: line-through
  • font-family
  • font-variant: small-caps
  • font-size (must use points for units)

You may also use {style="..."} attributes after markdown elements to apply styles. This can be used on headers, inline elements, code blocks, etc.

Emoji

Use Github style emoji in your text using the :emoji:.

The following example inserts emoji in the header and body of the slide.

Code blocks

Both indented and fenced code blocks are supported, with syntax highlighting.

The following example renders highlighted code.

To change the syntax highlight theme specify the --style <theme> option on the command line. All highlight.js themes are supported. For example, to use the github theme

md2gslides slides.md --style github

You can also apply additional style changes to the entire block, such as changing the font size:

Tables

Tables are supported via GFM syntax.

Note: Including tables and other block elements on the same slide may produce poor results with overlapping elements. Either avoid or manually adjust the layout after generating the slides.

The following generates a 2x5 table on the slide.

Local images

Images referencing local paths temporarily uploaded and hosted to file.io. File.io is an emphemeral file serving service that generates short-lived random URLs to the upload file and deletes content shortly after use.

Since local images are uploaded to a thrid party, explicit opt-in is required to use this feature. Include the --use-fileio option to opt-in to uploading images. This applies to file-based images as well as automatically rasterized content like math expressions and SVGs.

Image rasterization

Slides can also include generated images, using $$$ fenced blocks for the data. Currently supported generated images are math expression (TeX and MathML) as well as SVG. Rasterized images are treated like local images are require opt-in to uploading images to a 3rd party service via the --use-fileio option.

Using TeX:

SVG

Like local images, generated images are temporarily served via file.io.

Pull requests for other image generators (e.g. mermaid, chartjs, etc.) are welcome!

Reading from standard input

You can also pipe markdown into the tool by omitting the file name argument.

Contributing

With the exception of /bin/md2gslides.js, TypeScript is used throughout and compiled with Babel. Mocha and Chai are used for testing.

To compile:

npm run compile

To run unit tests:

npm run test

To lint/format tests:

npm run lint

See CONTRIBUTING for additional terms.

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.