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

hexo-reveal-embed

v1.7.0

Published

This hexo plugin allows you to display slides created with reveal.js on your blog. Both embedded display and full screen display are possible.

Downloads

20

Readme

Hexo Reveal Embed

This Hexo plugin allows you to display slides created with reveal.js on your blog. Both embedded display and full screen display are possible.

Requirements

  • Hexo 6 or later
  • Node.js 18.0 or later

Installation

npm install hexo-reveal-embed

You can find an overview of how to install and configure it in the following blog post (Japanese):
次のブログ記事で、インストールと設定の概要を確認できます:

ブログ記事へのスライド埋め込みプラグイン Hexo Reveal Embed を公開した

How To Use

  1. Create your slides with reveal.js.

    Create a reveal.js slide in markdown format under the source/_slides/ directory. You can see how to create slides using markdown with reveal.js here.

    You can write front-matter at the beginning of markdown. Use this to set the slide page title and slide theme.

  2. Generate slide pages.

    As usual, when you run hexo generate or hexo server, a slide page will be created under the /<public_dir>/slide/ directory.

  3. View slides full screen.

    When you access the URL under /slide/ in your browser, the slide you created will be displayed in full screen.

  4. Embed the slide in a blog post.

    Embed slides in your post with the following tag:

    {% reveal "path/to/file" %}

    Specify the path to the slide in path/to/file. In the above example, the slide created in source/_slides/path/to/file.md and published to /slide/path/to/file.html will be embedded. It will be rendered as follows.

    <div class="hexo-reveal-embed">
      <iframe
        src="/slide/path/to/file.html"
        allowfullscreen
        loading="lazy"
      >
      </iframe>
    </div>
  5. Adjust the design

    This plugin does not make any design adjustments so that you can set the design as you like.

    Use the .hexo-reveal-embed class set in the embedded tag and freely set the css. For example, the following css would display the entire width of the parent element and set the aspect ratio to 16:9.

    .hexo-reveal-embed {
      width: 100%;
      height: 0;
      padding-top: 56.25%; /* 16:9 ratio (9/16 = 0.5625) */
      position: relative;
    }
       
    .hexo-reveal-embed iframe {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
    }

Front-matter

Front-matter allows you to configure the following settings for each slide.

  • title The title of the slide page. This will be displayed in the browser tab.
  • theme You can specify the name of the theme provided by reveal.js. You can check the list here.

Configuration

You can configure the behavior of reveal.js from your blog's _config.yml.

default

Set the default value of front-matter for each slide. For example, to set the theme of all slides to white by default, use the following:

reveal:
  default:
    theme: white

If both are set, front-matter takes precedence.

anchor_target

Set the target attribute of the a tag. Default is _top.

reveal:
  anchor_target: _blank

config

The reveal.config settings will be passed to reveal.js as is. The list of reveal.js settings can be found here.

For example, to enable URL Fragment and Browser History for a slide in full screen view:

reveal:
  config:
    hash: true
    history: true

plugins

You can configure which plugins should be loaded, for example:

reveal:
  plugins:
    # Specify only the name of the plugin bundled with reveal.js:
    - RevealHighlight
    - RevealNotes
    # Specify the `name` and `url` of the third-party plugin
    - name: ThirdPartyPlugin
      url: https://thirt-party.example.com/path/to/plugin.js

NOTE: RevealMarkdown is automatically loaded even if you do not specify it.

Specify the plugin that is bundled with reveal.js. The list of available plugins can be found here.

css_urls / js_urls

You can specify additional css and js to load, for example:

reveal:
  css_urls:
    - https://thirt-party.example.com/path/to/style.css
    - /path/to/local/style.css
  js_urls:
    - https://thirt-party.example.com/path/to/script.css
    - /path/to/local/script.css

Contributing and Development

# Clone this repository and move to the directory:
git clone https://github.com/KentarouTakeda/hexo-reveal-embed.git
cd hexo-reveal-embed

# Install dependencies:
npm install

# Run tests:
npm test

License

Hexo Reveal Embed is open-sourced software licensed under the MIT license.