Plugins

Print

nizel-plugin-print adds block directives for page breaks, print-only content, screen-only content, and page split control.

Install

npm install nizel-plugin-print

Usage

import { useNizel } from 'nizel';
import { printPlugin } from 'nizel-plugin-print';
import 'nizel-plugin-print/style.css';

const nizel = useNizel({
  plugins: [printPlugin()],
});

Preview

This note appears in print/PDF output.

This block is marked to avoid page splits.

Syntax

:::pagebreak
::
:::pagebreak-before
# New section
::
:::pagebreak-after
End of section.
::
:::keep
This block should avoid splitting across pages.
::
:::print-only
This content only appears in print/PDF.
::
:::screen-only
This content only appears on screen.
::
:::no-print
This content is hidden when printing.
::
:::print-wide
This block may use wider print layout.
::

Options

OptionTypeDefaultDescription
injectCssbooleantruePrepends the default print CSS in rendered HTML.
collectMetadatabooleantrueAdds controls to result.meta.print.controls.
classPrefixstring'nizel'Prefix used for generated classes.

Metadata

{
  print: {
    controls: [
      { type: 'pagebreak' },
      { type: 'keep' }
    ],
    settings: {
      title: 'Markdown Plugin Guide',
      pageSize: 'A4'
    }
  }
}

The plugin ships minimal print CSS and does not set margins, page size, colors, or typography.