Giter VIP home page Giter VIP logo

reveal_slides's Introduction

About the project

Update history

1.0 This work incorporated my personal preference and removed the need to serve markdown indirectly. Also relatively convenient and portable.

1.1 Now the repo is serving as a subfolder, which leaves your work directory (markdown and html) cleaner.

1.2 Centered around a new html-rich "slide.md" file, with +js,css customizable scripts. Also have md_strip_html.py to strip down to plain markdown file.

Thanks to theno's selection of tools and jgm's pandoc for converting markdown to html.

Testing

plain text

  • 1
    • 1.1
      • 1.1.1
        • 1.1.1.1
          • 1.1.1.1.1
  • formula
    • $e^{ \pm i\theta } = \cos \theta \pm i\sin \theta$
    • $\displaystyle F1=\frac{2PrecisionRecall}{Precision+Recall} = \frac{2TP}{2TP+FP+FN}$
  1. d1
    1. d2
      1. d3
        1. d4
          1. d5

Contact

Contact Rui for any questions ๐Ÿ˜Š

Documentation

Installation

install_requirement.sh

apt update && apt intall curl wget pandoc # sudo if needed

Download the release

# download the latest release to subfolder [reveal_slides]
curl -s https://api.github.com/repos/ruixiao85/reveal_slides/releases/latest \
| grep "tarball_url" \
| cut -d \" -f 4 \
| xargs wget -qO - | tar zxvf - && \
mv `ls -td *reveal_slides*/ | head -1` reveal_slides

Prepare your markdown

If you don't have any, you can copy the included example to your work directory:

cp reveal_slides/slide.md . # template needed to create slides
cp reveal_slides/slide*.html . # pre-rendered html slides

Make one single revealjs slidedeck

md_revealjs.sh

bash reveal_slides/md_revealjs.sh # [input markdown] [output html]

Optional positional arguments allow you to pass other markdown file and output html. If not provided, default to [slide.md] and output to [slide.html]. The script content is shown below:

#!/usr/bin/env bash
echo "self, scpt=${0}"; scpt=${0}
FI=${1:-slide.md}; echo "arg1, fille_input=$FI"
FO=${2:-${FI%.*}.html}; echo "arg2, file_output=$FO"

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

cat ${SCRIPT_DIR}/revealjs_before.html > ${FO}
pandoc -f markdown -t revealjs --no-highlight --number-sections --slide-level 3 ${FI} >> ${FO}
cat ${SCRIPT_DIR}/revealjs_after.html >> ${FO}

Make multiple revealjs slidedecks

md_revealjs.py

bash reveal_slides/md_revealjs.py # [input markdown] [output html] [heading split level, 0-nosplit, 1-split@heading1 '#']

This allows you to further split at high heading levels, for example, "#". As a result, the input markdown file will be split into multiple markdown files and lower-level headings will move up accordingly.

  • main.md
# topic 1
## section 1.1
## section 1.2
# topic 2
## section 2.1
  • main_topic1.md
# section 1.1
# section 1.2
  • main_topic2.md
# section 2.1

Strip html tags for plain markdown

md_strip_html.py

python3 reveal_slides/md_strip_html.py # [input markdown with html] [output markdown without html]

This removes all style blocks, any line starts or ends with '<' or '>', and convert img tag src="pic.jpg" to markdown styled ![](pic.jpg).

Check the results

  • You should be able to directly open the output html in any browser. The subfolders [css, js, lib, plugin] are required for the html file to function properly.

  • "#" heading 1 may require the entire slide without any other content for the verticle movement to work (2-level hierachy).

reveal_slides's People

Contributors

ruixiao85 avatar

Watchers

 avatar

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.