How to paginate ckeditor content in django?

I have ckeditor content as book content. I want to show the content in a fixed width and height container. Instead of scroll. there will be option to navigate pages. Next button and previous button for navigate pages.

from django.db import models
from django_ckeditor_5.fields import CKEditor5Field

class Book(models.Model):
    title = models.CharField(max_length=255)
    slug = AutoSlugField(populate_from='title')
    description = models.TextField()
    content = CKEditor5Field(config_name="extends") 

At first I have tried this feature with the default models.TextField(). By counting the words I have splited as pages in javaScript. It was ok but for more text formatting I have to use ckeditor and the ckeditor saves content as html so I can't figure out how I will split the page. Because If I want to split with the previous approch it's possible to miss starting or ending tag in a page. I am using django-ckeditor-5

Вернуться на верх