Default Options

The RyuseiLight constructor takes default options:

const ryuseilight = new RyuseiLight( { language: 'ts' } );
JavaScript

The apply() and html() methods keep referring the options unless overwriting them.

// Highlight pre elements in the TypeScript langauge
ryuseilight.apply( 'pre' );
JavaScript

By passing local options, they can be overwritten:

ryuseilight.apply( 'pre', { language: 'css' } );
JavaScript

Options

language

Specifies a language by the ID or the alias.

type: string default: 'none'


span

Determines whether to use span element instead of code for each fragment.

type: boolean default: false


wrap

Determines whether to wrap code or not. If true, white-space CSS property will be pre-wrap.

type: boolean default: false

false (default)
console.log( 'Lorem ipsum dolor sit amet, purto vituperata elaboraret an vis. Nam ad soleat semper, velit sapientem principes quo et. Cu usu fabulas copiosae corrumpit, eu ius nulla ridens. Dictas iuvaret persecuti te sed, has et putent vulputate.' );
JavaScript
true
console.log( 'Lorem ipsum dolor sit amet, purto vituperata elaboraret an vis. Nam ad soleat semper, velit sapientem principes quo et. Cu usu fabulas copiosae corrumpit, eu ius nulla ridens. Dictas iuvaret persecuti te sed, has et putent vulputate.' );
JavaScript

There is a limitation for using this with the LineNumbers extension and html().

See this document for more information.


Additional options are available for extensions. They are explained in the document of each extension.