5 KiB
RDM Workshop Kit - Slides
This DataLad datasets contains a mix-and-match slide deck for RDM workshops. It is using reveal.js as a presentation framework.
How to use
Initial set up
Clone the dataset:
datalad clone https://hub.datalad.org/edu/slides.git
Get all subdatasets:
datalad get -r .
Retrieve required content, e.g., images or PDFs, via
datalad get <path>
To view or present slides, open the relevant html file with a browser of your choice. You can get an overview of all available modules in the index.html slide.
Mix-and-match
To create a workshop of your choice, open index.html in an editor of your choice. In the "Module Overview" you'll find links to all possible modules.
Then, create a new <your-workshop-title>.html file withhin the workshops/ directory.
You can use modules/template.html or workshops/template-workshop.html as a template.
In the resulting new file, mix-and-match the modules you'd like to keep.
There are two ways to link modules together:
Linking contents via regular hrefs
A simple yet feature-sparse way to link slides is to create href links (e.g., as done in index.html).
| advantages | disadvantages |
|---|---|
| - works without a web server | - lots of clicking needed when using many modules |
| - "(c)lean" workshop slide: just a slide with links rather than the dozens or hundreds of slides it is comprised of | - no elegant way to navigate back from a linked module to the workshop index (hint: use target="_blank" to open linked contents in a separate tab) |
| - every linked module needs to be printed/exported individually |
Linking contents via the reveal-external plugin
A more powerful way to link slides is to use a custom fork of the reveal_external plugin.
Example usage can be found in demo/
The plugin is already a subdataset, and should be available by adding the following to your .html file (already present in the templates):
<script src="../plugin/reveal_external/external/external.js"></script>
Reveal.initialize({
}
...
},
plugins: [ RevealExternal ]
})
Note that RevealExternal should be placed first in the list of plugins inside the Reveal.initialize() function if more plugins (e.g. RevealMarkdown) are used. This ensures that all external HTML files are loaded into the slide deck before other plugins process the slides.
Afterwards, link existing modules into your presentation with a data-external or data-external-replace attribute (e.g., within <section> or <div> tags) and an optional CSS selector.
data-external loads the external module as a child of the existing HTML element. Be careful: Cumulative section nesting from the external module and the loading element can cause breakage!
data-external-replace replaces the existing HTML element with the external module. When in doubt, this is the solution you should choose.
<section data-external-replace="../modules/reproducibility.html#.slides > section"></section>
The additional CSS selector should be appended to the HTML path of modules.
Using #.slides > section includes all content of the module.
The selector can also be used if only a part of the HTML file's content should be loaded, for example:
<--! This includes only slides with the id="contact" tag -->
<section data-external-replace="../modules/help.html##contact"></section>
- To load only the actual slide nodes, use
#.slides > section. - To load a single element by id, use
##<element-id>.
Finally, run a local webserver to present or print:
# for example:
python3 -m http.server
| advantages | disadvantages |
|---|---|
| - no clicking needed, all linked modules form a seemless single presentation | - requires a local webserver |
| - Printing/exporting handles linked modules |
CAVE: When externally linked files from within modules/ contain a
relative link to other files, this relative link may be broken.
If, e.g., workshops/some_workshop.html links modules/some_slides.html,
and modules/some_slides.html contain a link to ./more_slides.html, this
relative link will translate to the non-existent path
workshops/more_slides.html.
Exporting PDFs
In your browser, append ?print-pdf to the URL and save the slide to PDF via your browsers' "print" dialog.
Note: When linked through an "external data link" with the reveal_external plugin, all modules will get exported together.
Modules that are linked via regular href references to your current slide will not be exported - for those, every .html file needs to be printed separately.
Dataset structure:
- index.html: Central slide that links to available modules
- modules/: All available slide modules.
- img/: Illustrations, logos, etc
- pdf: Exported presentations in PDF form
- custom: Files with custom CSS or JS