Reveal.js plugin for marking selected lines or regions of text

Overview

Reveal.js / Mark.js plugin

Based on the highlight plugin from Reveal.js, which supports animated marking (emphasizing) of specific code regions by line or line range.

This plugin additionally supports marking content:

  • That is not code
  • By matched regexp
  • Across HTML element boundaries

The latter is particularly important if you are trying to mark regions in code that already has HTML syntax highlighting. That might be the case, for example, if you use Jekyll to render your markdown.

This magic is accomplished by harnessing the wonderful Mark.js library.

Note
Unlike the highlight plugin from Reveal.js, this plugin does not do any code syntax highlighting. If you need that functionality, you might want to use the two plugins together… or use a preprocessor like jekyll to get highlighting.

Usage

Just as marking with reveal's plugin is controlled by attaching a data-highlight attribute to the thing to be emphasized, this plugin uses a data-mark attribute, with a compatible (superset) syntax. Marking steps are separated by vertical bars, and can target zero or more comma-separated regions, each of which can be a line number or a line range, e.g.

<pre data-mark="1,3|2,5-7|4"><code>
   ...
</code><pre>

In this example, lines 1 and 3 start out marked, after the first animation step lines 2, 5, 6 and 7 are marked, and after the second animation step only line 4 is marked.

In this plugin, regions can also be specified as JavaScript regular expressions delimited by an arbitrary non-|, non-digit. The first match for the regular expression is marked, e.g.

<blockquote data-mark="|/creative/,#design#|4">
   ...
</blockquote>

This example starts out with no marks, then the first occurrences of “creative” and “design” in the <blockquote> are marked, then line 4 of the <blockquote> is marked.

Syntax

Arbitrary whitespace is allowed at the beginning and end of the data-mark string, and around step delimiters (|), region delimiters (,) and line range delimiters (-).

To include a regexp delimiter in a regexp literally, you can escape it with a backslash, but you may be better off choosing a different regexp delimiter.

The final delimiter of a regexp can be followed by an arbitrary string composed of the characters dgimsuy, indicating the standard JS regexp flags.

You might also like...

Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions.

chartjs-plugin-regression Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions using

Dec 18, 2022

Draggable data points plugin for Chart.js

Draggable data points plugin for Chart.js

chartjs-plugin-dragdata.js Now compatible with Chart.js v3 🎉 Looking for a version compatible to Chart.js 2.9.x? Then visit the v2 branch! A plugin

Dec 18, 2022

Chart.js plugin to defer initial chart updates

Chart.js plugin to defer initial chart updates

Chart.js plugin to defer initial chart updates until the user scrolls and the canvas appears inside the viewport, and thus trigger the initial chart a

Nov 9, 2022

Chart.js plugin for Prometheus data loading

Chart.js plugin for Prometheus data loading

Welcome to chartjs-plugin-datasource-prometheus 👋 A Prometheus datasource for ChartJS. Dependencies: requires chart.js 2.7 or later. requires moment.

Dec 6, 2022

Chart.js plugin to display labels on data elements

Overview Highly customizable Chart.js plugin that displays labels on data for any type of charts. Requires Chart.js 3.x. Documentation Introduction Ge

Dec 24, 2022

Crosshair plugin for ChartJS

Crosshair plugin for ChartJS

Chart.js plugin to draw vertical crosshair, zoom, interpolate values and sync chart interactions. Requires Chart.js 3.4.0 or later. Documentation Inst

Dec 12, 2022

Annotation plugin for Chart.js

Annotation plugin for Chart.js

chartjs-plugin-annotation.js An annotation plugin for Chart.js = 3.0.0 This plugin needs to be registered. It does not function as inline plugin. For

Dec 30, 2022

A logseq plugin that lets you find #tags

A logseq plugin that lets you find #tags

Logseq Tags Plugin A plugin that lets you find and search all of your #tags. This plugin will query and list all #tags, #[[tags]] and page-tags(tags::

Dec 29, 2022

Line focus plugin for Highlight.js

Line focus plugin for Highlight.js

Highlight.js Focus Plugin This plugin provide the ability to highlight a focused line when using Highlight.js To use, first, register this plugin with

Jun 20, 2022
Owner
stlab
stlab
The CCF Backstage Plugin is a tool to estimate energy use (kilowatt-hours) and carbon emissions (metric tons CO2e) from public cloud usage that is meant to be consumed as a plugin into a Backstage application

CCF Backstage Plugin Understand how your cloud usage impacts our environment and what you can do about it. This plugin brings the functionallity of th

Cloud Carbon Footprint 21 Nov 6, 2022
A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser

jQuery Sparklines This jQuery plugin makes it easy to generate a number of different types of sparklines directly in the browser, using online a line

Gareth Watts 1.2k Jan 4, 2023
A Versatile and Expandable jQuery Plotting Plugin

jQPlot Pure JavaScript plotting plugin for jQuery. jqPlot home page: http://www.jqplot.com Users forum: http://groups.google.com/group/jqplot-users De

jqPlot 222 Sep 8, 2022
JQuery plugin for creating charts

JQuery Linechart JQuery plugin for building a linechart. Chart ruler completely on HTML/CSS/JS. Bar chart, calendar view visualisation. Diagram, graph

Kirill Stepkin 42 Oct 25, 2022
JQuery plugin for creating charts

JQuery Linechart JQuery plugin for building a linechart. Chart ruler completely on HTML/CSS/JS. Bar chart, calendar view visualisation. Diagram, graph

Kirill Stepkin 42 Oct 25, 2022
Zoom and pan plugin for Chart.js

chartjs-plugin-zoom A zoom and pan plugin for Chart.js >= 3.0.0 For Chart.js 2.6.0 to 2.9.x support, use version 0.7.7 of this plugin. Panning can be

Chart.js 510 Jan 2, 2023
Chart.js plugin for more styling options

chartjs-plugin-style Chart.js plugin for more styling options This plugin requires Chart.js 2.6.0 or later. Installation You can download the latest v

Akihiko Kusanagi 57 Oct 27, 2022
Chart.js plugin for live streaming data

chartjs-plugin-streaming Chart.js plugin for live streaming data chartjs-plugin-streaming 2.x requires Chart.js 3.0.0 or later. If you need Chart.js 2

Akihiko Kusanagi 401 Dec 27, 2022
This plugin for Chart.js that makes your bar chart to 100% stacked bar chart.

chartjs-plugin-stacked100 This plugin for Chart.js that makes your bar chart to 100% stacked bar chart. Requires Chart.js 3.x. Demo: https://y-takey.g

y-take 106 Jan 3, 2023
Chart.js plugin to create charts with a hand-drawn, sketchy, appearance

chartjs-plugin-rough Chart.js plugin to create charts with a hand-drawn, sketchy, appearance Version 0.2 requires Chart.js 2.7.0 or later, and Rough.j

Akihiko Kusanagi 73 Dec 1, 2022