<commit_before>;;; lang-ebook.el --- E-book file formats

;;; Commentary:
;; Support for ePUB and PDF.

;;; Code:
(use-package ereader :mode ("\\.epub$" . ereader-mode)
  :commands ereader-mode
  :config
  (add-hooks-pair 'ereader-mode
                  'page-break-lines-mode))
<commit_msg>lang: improve ebook by support by using nov.el<commit_after>;;; lang-ebook.el --- E-book file formats

;;; Commentary:
;; Support for ePUB and PDF.

;;; Code:
(require 'base-vars)
(require 'base-keybinds)

(use-package nov :mode ("\\.epub$" . nov-mode)
  :general
  (:keymaps 'nov-mode-map :states 'normal
            "]p"      'nov-next-document
            "[p"      'nov-previous-document
            "<up>"    'nov-scroll-down
            "<down>"  'nov-scroll-up
            "<left>"  'nov-previous-document
            "<right>" 'nov-next-document)
  :preface
  (defvar nov-text-width)
  (defvar cwm-centered-window-width)

  (defun epub-setup ()
    (setq nov-save-place-file (concat my-data-dir "nov-places")
          nov-text-width most-positive-fixnum
          cwm-centered-window-width 120)
    (face-remap-add-relative 'variable-pitch :family "Noto Serif"
                             :height 1.5))
  :init
  (add-hooks-pair 'nov-mode '(epub-setup
                              centered-window-mode)))

{'fraction_non_alphanumeric': 0.1568477429227238, 'fraction_numerical': 0.0038255547054322878, 'mean_word_length': 2.2058823529411766, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1505000', 'n_tokens_mistral': 454, 'n_tokens_neox': 448, 'n_words': 96}