revealgo

package module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 19 Imported by: 2

README

revealgo

revealgo is a small web application for giving Markdown-driven presentations implemented in Go! The revealgo command starts a local web server to serve the your markdown presentation file with reveal.js. The presentation can be viewed in a web browser. The reveal.js library offers comprehensive presenting features such as slide transitions, speaker notes and more.

Installation

Binary

Download the binary from GitHub Releases and install it somewhere in your $PATH. revealgo currently provides pre-built binaries for Linux, macOS and Windows.

Homebrew

You can also install via hombrew on macOS:

$ brew install yusukebe/tap/revealgo
Source

To install from the source, use go install after git clone:

$ git clone git@github.com:yusukebe/revealgo.git
$ cd revealgo
$ git submodule update --init --recursive
$ go install ./cmd/revealgo

Usage

The usage:

$ revealgo [options] MARKDOWN.md

Then access the local web server such as http://localhost:3000 with Chrome, Firefox, or Safari.

Available options:

-p, --port            TCP port number of this server (default: 3000)
--theme               Slide theme or original css file name. default themes:
                      beige, black, blood, league, moon, night, serif, simple, sky, solarized, and white (default: black.css)
--transition          Transition effect for slides: default, cube, page, concave, zoom, linear, fade, none (default: default)
--separator           Horizontal slide separator characters (default: ^---)
--vertical-separator  Vertical slide separator characters (default: ^___)
--multiplex           Enable slide multiplex
Screenshots

Run revealgo command:

Command Line

Open the server address with your web browser:

Slides

Sample Makrdown
## This is an H2 Title

Description...

The horizontal slide separator characters are '---'

---

# This is second title

The vertical slide separator characters are '^___'

___

## This is a third title

---

## This is a forth title

<!-- .slide: data-background="#f70000" data-transition="page" -->

You can add slide attributes like above.
Customize Theme

While revealgo is running, open another terminal and get the theme file black.css:

$ curl http://localhost:3000/revealjs/css/theme/black.css > original.css

Edit original.css, And then run revealgo with --theme option:

$ revealgo --theme original.css slide.md
Customize Slide Configurations

Get the default slide HTML file:

$ curl http://localhost:3000/ > slide.html

Edit slide.html, and then open http://localhost:3000/slide.html with your browser. A slide with the modified configurations will come up.

Using slide multiplex

The multiplex plugin allows your audience to follow the slides of the presentation you are controlling on their own phone, tablet or laptop

--- reveal.js site

When --multiplex is enabled, the client slides can be found on the / path and the master ones under /master/. The master presentation will push its changes to all the client ones for every transition, is like having a remote control!

For example, your laptop's IP address in the local network is 192.168.100.10 and you are using the port 3000, so your audience should see the slides on http://192.168.100.10:3000/, and you should be able to control their slides through http://192.168.100.10:3000/master/.

NOTE: Bear in mind multiplex feature will not work as expected when 1) the presenter computer firewall denies incomig traffic or 2) the local network does not allow traffic between devices on the port you picked

Contributing

See docs/CONTRIBUTING.md.

Contributors

Thanks to all contributors!

Author

Yusuke Wada http://github.com/yusukebe

License

Distributed under the MIT License. See LICENSE for more information.

Documentation

Index

Constants

View Source
const (
	ExitCodeOK    = 0
	ExitCodeError = 1
)

Variables

View Source
var Version string = "v1.2.2"

Functions

This section is empty.

Types

type CLI

type CLI struct {
	OutStream, ErrStream io.Writer
	// contains filtered or unexported fields
}

func (*CLI) Run

func (cli *CLI) Run(args []string) int

type CLIOptions

type CLIOptions struct {
	Port              int    `short:"p" long:"port" description:"TCP port number of this server" default:"3000"`
	Theme             string `` /* 184-byte string literal not displayed */
	DisableAutoOpen   bool   `long:"disable-auto-open" description:"Disable automatic opening of the browser"`
	Transition        string `` /* 134-byte string literal not displayed */
	Separator         string `long:"separator" description:"Horizontal slide separator characters" default:"^---"`
	VerticalSeparator string `long:"vertical-separator" description:"Vertical slide separator characters" default:"^___"`
	Multiplex         bool   `long:"multiplex" description:"Enable slide multiplexing"`
	Version           bool   `short:"v" long:"version" description:"Show the version"`
}

type MultiplexParam added in v1.1.0

type MultiplexParam struct {
	IsMaster   bool
	Secret     string
	Identifier string
}

type RevealMultiplexData added in v1.1.0

type RevealMultiplexData struct {
	Secret   string                 `json:"secret,omitempty"`
	SocketId string                 `json:"socketId"`
	State    map[string]interface{} `json:"state"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) Serve

func (server *Server) Serve(param ServerParam)

type ServerParam

type ServerParam struct {
	Path              string
	Theme             string
	OriginalTheme     bool
	DisableAutoOpen   bool
	Transition        string
	Separator         string
	VerticalSeparator string
	Multiplex         MultiplexParam
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL