nbconvert icon indicating copy to clipboard operation
nbconvert copied to clipboard

Is there a simple way to customize Reveal.initialize arguments?

Open paugier opened this issue 2 years ago • 3 comments

I would need to change values of Reveal.initialize arguments (see https://revealjs.com/presentation-size/). Is there a simple way to do that? I would like to avoid writing a custom exporter for that.

paugier avatar Aug 27 '22 16:08 paugier

Inside reveal.js there is a chunk of code that exposes configuration options:

		// Compose our config object in order of increasing precedence:
		// 1. Default reveal.js options
		// 2. Options provided via Reveal.configure() prior to
		//    initialization
		// 3. Options passed to the Reveal constructor
		// 4. Options passed to Reveal.initialize
		// 5. Query params

		config = { ...defaultConfig, ...config, ...options, ...initOptions, ...Util.getQueryHash() };

So the query string ( remove # at end of url and add ?config_option=value ) is used to set configuration options first and whatever is not set, gets set by initOptions ( Reveal.initialize() ) and whatever is not set by initOptions is set by the arguments of the Reveal constructor and so on.

So to answer your question, the only way that I think might be simpler is to put your settings in the url.

For example: ..yourslides.html?embedded=false&width=600&height=700&margin=0.04&minScale=0.4&maxScale=1.0#/

bouzidanas avatar Sep 08 '22 02:09 bouzidanas

Thank you for this! This helped me tremendously

canyon289 avatar Dec 24 '22 18:12 canyon289

Is there also a way to have this set in the standalone HTML file?

franzhaas avatar Jul 30 '23 18:07 franzhaas