From 85ccf0ccfae4aa5dd4505332b5c4fc8e3ea9067c Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 25 Dec 2023 05:55:30 +0200 Subject: Add gnosis-faces --- gnosis-faces.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gnosis.el | 6 ++++-- 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 gnosis-faces.el diff --git a/gnosis-faces.el b/gnosis-faces.el new file mode 100644 index 0000000..9d8875d --- /dev/null +++ b/gnosis-faces.el @@ -0,0 +1,57 @@ +;;; gnosis-faces.el --- Spaced Repetition Learning Tool -*- lexical-binding: t; -*- + +;; Copyright (C) 2023 Thanos Apollo + +;; Author: Thanos Apollo +;; Keywords: extensions +;; URL: https://git.thanosapollo.org/gnosis +;; Version: 0.0.1 + +;; Package-Requires: ((emacs "27.2") (compat "29.1.4.2")) + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program 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 General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This is part of the package gnosis.el + +;;; Code: + +(defgroup gnosis-faces nil + "Faces used by gnosis." + :group 'gnosis + :tag "Gnosis Faces" + :prefix 'gnosis-face) + + +(defface gnosis-face-extra + '((t :inherit markdown-italic-face)) + "Face for extra-notes from note." + :group 'gnosis-faces) + +(defface gnosis-face-main + '((t :inherit default)) + "Face for main section from note." + :group 'gnosis-face-faces) + +(defface gnosis-face-seperator + '((t :inherit homoglyph)) + "Face for section seperator." + :group 'gnosis-face) + + +(provide 'gnosis-faces) +;;; gnosis-faces.el ends here + + diff --git a/gnosis.el b/gnosis.el index 025d9b7..c89e0cc 100644 --- a/gnosis.el +++ b/gnosis.el @@ -36,6 +36,7 @@ (require 'emacsql-sqlite) (require 'cl-lib) (require 'gnosis-algorithm) +(require 'gnosis-faces) (defgroup gnosis nil "Spaced repetition learning tool." @@ -81,13 +82,14 @@ Example: (switch-to-buffer (get-buffer-create "*gnosis*")) (erase-buffer) - (fill-paragraph (insert question))))) + (fill-paragraph (insert (propertize question 'face 'gnosis-face-main)))))) (defun gnosis-display--extra (id) "Display extra information for note ID." (let ((extras (gnosis-get 'extra-notes 'extras `(= id ,id)))) (with-current-buffer (switch-to-buffer (get-buffer-create "*gnosis*")) - (fill-paragraph (insert (concat "\n\n" extras)))))) + (insert (propertize "\n\n-----\n" 'face 'gnosis-face-seperator)) + (fill-paragraph (insert (concat "\n" (propertize extras 'face 'gnosis-face-extra))))))) (cl-defun gnosis--prompt (prompt &optional (downcase nil) (split nil)) "PROMPT user for input until `q' is given. -- cgit v1.2.3