[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 60d64ca07c 117/355: Document ways to change the
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 60d64ca07c 117/355: Document ways to change the front matter |
Date: |
Sun, 26 Jun 2022 23:58:11 -0400 (EDT) |
branch: externals/denote
commit 60d64ca07cba33eff75e7aa36f28e6b0fe098fb0
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Document ways to change the front matter
---
README.org | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
diff --git a/README.org b/README.org
index b6cd5f0137..35450ae3b5 100644
--- a/README.org
+++ b/README.org
@@ -307,6 +307,124 @@ is typically employed in static site generators as source
code for Web
pages). However, when ~denote-front-matter-date-format~ has a string
value, this rule is suspended: we use whatever the user wants.
+** Tweaking the front matter
+:PROPERTIES:
+:CUSTOM_ID: h:f69371d5-1843-493d-9ff5-c1ab3b43024e
+:END:
+
+What follows is for advanced users. When in doubt, only configure
+variables we describe as a "user option": they are declared in the
+source code with the ~defcustom~ keyword.
+
+Denote's code base is designed in a composable way, which lets the user
+make precise interventions to affect the output of the relevant
+commands. One such case is to configure the front matter, such as by
+changing the order the keys appear in, renaming them, or adding new
+elements.
+
+Some examples are in order, starting with the Org file type. This is
+what we have in =denote.el=:
+
+#+begin_src emacs-lisp
+(defvar denote-org-front-matter
+ "#+title: %s
+#+date: %s
+#+filetags: %s
+#+identifier: %s
+\n"
+ "Org front matter value for `format'.
+The order of the arguments is TITLE, DATE, KEYWORDS, ID. If you
+are an avdanced user who wants to edit this variable to affect
+how front matter is produced, consider using something like %2$s
+to control where Nth argument is placed.")
+#+end_src
+
+The default front matter is:
+
+#+begin_example
+#+title: This is a sample note
+#+date: 2022-06-10
+#+filetags: denote testing
+#+identifier: 20220610T202537
+#+end_example
+
+We can add a =PROPERTIES= drawer to it, with something like this:
+
+#+begin_src emacs-lisp
+(setq denote-org-front-matter
+ ":PROPERTIES:
+:ID: %4$s
+:END:
+#+title: %1$s
+#+date: %2$s
+#+filetags: %3$s
+#+identifier: %4$s
+\n")
+#+end_src
+
+The output is now formatted thus:
+
+#+begin_example
+:PROPERTIES:
+:ID: 20220611T092444
+:END:
+#+title: This is a sample note
+#+date: 2022-06-11
+#+filetags: denote testing
+#+identifier: 20220611T092444
+#+end_example
+
+Notice how we can pass a number to the =%s= specifier. This is what
+allows us to change the placement of the provided arguments.
+
+For another example, we will use the plain text variant, as it differs a
+bit from the above. By default it is formatted this way:
+
+#+begin_example
+title: This is a sample note
+date: 2022-06-10
+tags: denote testing
+identifier: 20220610T202232
+---------------------------
+#+end_example
+
+The line with the hyphens is documented in the product of the fifth
+format specifier, as documented in ~denote-text-front-matter~. Its
+value is stored in ~denote-text-front-matter-delimiter~. Say we want to
+have a delimiter both at the top and bottom:
+
+#+begin_src emacs-lisp
+(setq denote-text-front-matter
+ "%5$s
+title: %1$s
+date: %2$s
+tags: %3$s
+identifier: %4$s
+%5$s\n\n")
+#+end_src
+
+Which gives us:
+
+#+begin_example
+---------------------------
+title: This is a sample note
+date: 2022-06-11
+tags: denote testing
+identifier: 20220611T093252
+---------------------------
+#+end_example
+
+Or we would rather use another character instead of hyphens, such as the
+equals sign:
+
+#+begin_src emacs-lisp
+(setq denote-text-front-matter-delimiter (make-string 27 ?+))
+#+end_src
+
+Remember that this is for advanced users. If you want to see changes
+done on this front, you are welcome to share your thoughts and/or
+participate in the development of Denote.
+
* Linking notes
:PROPERTIES:
:CUSTOM_ID: h:fc913d54-26c8-4c41-be86-999839e8ad31
- [elpa] externals/denote 112a12e6e5 130/355: Remove duplicate word from face names, (continued)
- [elpa] externals/denote 112a12e6e5 130/355: Remove duplicate word from face names, ELPA Syncer, 2022/06/27
- [elpa] externals/denote bca23b3e3d 115/355: Clarify how front matter variables are used, ELPA Syncer, 2022/06/27
- [elpa] externals/denote f91d2472c3 128/355: Make the field delimiter face a bit more subtle, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8a35382067 126/355: Rename internal variable for clarity, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 308322afab 108/355: Fix markdown-toml identifier value, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 11be1d6b40 123/355: Change "tml" to "toml" in denote-toml-front-matter, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 6000313eec 118/355: Enforce sluggification of keywords; document it, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 82eeb381dc 110/355: Make all front matter abstractions consistent, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 73dc07ac00 113/355: Make front matter variables "public", ELPA Syncer, 2022/06/27
- [elpa] externals/denote 21e415e2e7 111/355: Remove obsolete symbol of command, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 60d64ca07c 117/355: Document ways to change the front matter,
ELPA Syncer <=
- [elpa] externals/denote 28518416f3 131/355: Name the faces in the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 0bda79ef19 139/355: Move heading further up in the manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 890a335092 149/355: Add denote-dired-rename-expert user option, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 5977a9bc7b 164/355: Add warning about likely changes to denote-link.el, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 3f768cc438 168/355: Remove commented-out 'require', ELPA Syncer, 2022/06/27
- [elpa] externals/denote d6285c8c5a 182/355: Omit current file from backlinks, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 02507c6f0d 171/355: Rename private variable, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 340f9103fd 175/355: Fix typo in manual, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 5c400d80d9 191/355: Document regexp example for file extension, ELPA Syncer, 2022/06/27
- [elpa] externals/denote 8a33364dc6 188/355: Add helper fn to filter files matching regexp, ELPA Syncer, 2022/06/27