;;; ycp-markup.el -- My config for markup formats -*- lexical-binding: t -*- ;; Copyright (C) 2023 Free Software Foundation. ;; Author: Yuchen Pei ;; Package-Requires: ((emacs "28.2")) ;; This file is part of dotfiles. ;; dotfiles is free software: you can redistribute it and/or modify it under ;; the terms of the GNU Affero General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; dotfiles is distributed in the hope that it will be useful, but WITHOUT ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General ;; Public License for more details. ;; You should have received a copy of the GNU Affero General Public ;; License along with dotfiles. If not, see . ;;; Commentary: ;; My config for markup formats. ;;; Code: ;;; parsing and formatting markup and serialization languages: html, markdown, ;;; xml, yaml, etc. ;;; Some parts adapted from prot-dotfiles (my-package shr (:delay 30) (advice-add 'shr-heading :around #'my-shr-add-id-advice) (setq shr-use-colors nil) (setq shr-use-fonts nil) (setq shr-max-image-proportion 0.6) (setq shr-image-animate nil) (setq shr-width fill-column) (setq shr-max-width fill-column) (setq shr-discard-aria-hidden t) (setq shr-cookie-policy nil) ) (my-package tex-mode (:delay 60) (setq latex-run-command "pdflatex") (setq tex-print-file-extension ".pdf")) (my-package texinfo (:delay 60) (my-keybind texinfo-mode-map "C-c C-c" #'makeinfo-buffer)) (my-package yaml-mode (:delay 60) (:install t) (add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) (add-hook 'yaml-mode-hook #'display-line-numbers-mode)) ;;; markdown (my-package markdown-mode (:delay 60) (my-keybind markdown-mode-map "C-c C-l" 'markdown-insert-link) (setq markdown-hide-urls t) (put 'markdown-translate-filename-function 'safe-local-variable 'functionp) (require 'my-markdown) (my-keybind markdown-mode-map "" 'my-markdown-maybe-follow-thing-at-point)) (my-package wiki (my-keybind wiki-mode-map "C-'" #'my-wiki-grok-wikipedia) (my-setq-from-local wiki-sites) (wiki-define-site-commands)) (my-package ledger-mode (:install t) (:delay 60) (add-hook 'ledger-mode-hook (lambda () (setq-local tab-always-indent 'complete) (setq-local completion-cycle-threshold t) (setq-local ledger-complete-in-steps t) (setq-local company-mode nil))) (setq ledger-binary-path "hledger")) ;;; todo: open epub in emacs client with nov (my-package nov (:delay 15) (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)) (setq nov-text-width fill-column) (add-hook 'nov-mode-hook 'follow-mode) (require 'my-nov) (my-override nov-render-title) (my-override nov-scroll-up) ) ;;; json-mode (my-package json-mode (:delay 30) (:install t) (require 'my-prog) (add-hook 'json-mode-hook 'my-json-setup-hook) ) (provide 'ycp-markup) ;;; ycp-markup.el ends here