npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tiptap-pagination-breaks

v1.0.1

Published

A Tiptap extension for pagination

Downloads

60

Readme

tiptap-pagination-breaks

**tiptap-pagination-breaks** is a Tiptap extension that enables automatic pagination and page breaks within your Tiptap editor. Perfect for applications that require document-like editing features with defined page heights and visual page breaks.

Features

  • Automatic Pagination: Handles content overflow by adding page breaks based on defined page dimensions.
  • Customizable Page Settings: Configure page height, width, and margin to control how content is paginated.
  • Visual Page Breaks: Inserts dashed lines to represent page boundaries in the editor.

Installation

npm install tiptap-pagination-breaks

or

yarn add tiptap-pagination-breaks

Usage

To use this extension, include it in your Tiptap editor setup:

import { Pagination } from 'tiptap-pagination-breaks';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Pagination.configure({
      pageHeight: 1056, // default height of the page
      pageWidth: 816,   // default width of the page
      pageMargin: 96,   // default margin of the page
    }),
    // other extensions
  ],
});

Commands

You can dynamically update pagination options through the provided command:

editor.commands.setPaginationOptions({
  pageHeight: 900,
  pageMargin: 80
});

Styles

Ensure you have a global style to define how the page break will look visually:

.page-break {
  height: 20px;
  width: 100%;
  border-top: 1px dashed #ccc;
  margin: 10px 0;
}

Available Options

pageHeight: Height of each page in the editor (default: 1056). pageWidth: Width of each page in the editor (default: 816). pageMargin: Margin around the content on each page (default: 96).

Example

This extension is useful when you need to visualize content divided into pages, like in a document editor or a publishing platform.

License

This project is licensed under the MIT License.

Made with ❤️ by Aditya Yaduvanshi

For any questions or suggestions, feel free to reach out via email or connect with me on LinkedIn.