[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote b3cd0a7d4c 02/17: Add denote--file-types
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote b3cd0a7d4c 02/17: Add denote--file-types |
Date: |
Mon, 15 Aug 2022 01:57:34 -0400 (EDT) |
branch: externals/denote
commit b3cd0a7d4c22f0f9b3c5efcfb0e51e02d18d8c76
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Add denote--file-types
---
denote.el | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/denote.el b/denote.el
index f881f29303..b013a13860 100644
--- a/denote.el
+++ b/denote.el
@@ -638,6 +638,68 @@ identifier: %s
"Extract keywords list from front matter KEYWORDS-STRING."
(split-string keywords-string "[:,\s]+" t "[][ \"']+"))
+(defvar denote--file-types
+ `((markdown-toml . (".md"
+ ,denote--toml-front-matter
+ "^title\\s-*="
+ denote--surround-with-quotes
+ denote--trim-whitespace-then-quotes
+ "^tags\\s-*="
+ denote--format-keywords-for-md-front-matter
+ denote--extract-keywords-from-front-matter))
+ (markdown-yaml . (".md"
+ ,denote--yaml-front-matter
+ "^title\\s-*:"
+ denote--surround-with-quotes
+ denote--trim-whitespace-then-quotes
+ "^tags\\s-*:"
+ denote--format-keywords-for-md-front-matter
+ denote--extract-keywords-from-front-matter))
+ (text . (".txt"
+ ,denote--yaml-front-matter
+ "^title\\s-*:"
+ identity
+ denote--trim-whitespace
+ "^tags\\s-*:"
+ denote--format-keywords-for-text-front-matter
+ denote--extract-keywords-from-front-matter))
+ (org . (".org"
+ ,denote--org-front-matter
+ "^#\\+title\\s-*:"
+ identity
+ denote--trim-whitespace
+ "^#\\+tags\\s-*:"
+ denote--format-keywords-for-text-front-matter
+ denote--extract-keywords-from-front-matter)))
+ "Alist for Denote's file types.
+Each element is of the form (TYPE-SYMB . TYPE-INFO).
+
+TYPE-INFO is a list of 8 elements:
+
+ extension: The file extension, as a string.
+
+ front-matter: The type's front matter, as a string.
+
+ title-key-regexp: The regexp used to retrieve the title line in
+ a file. The first line matching this regexp is considered the
+ title line.
+
+ title-value-function: The function used to format the raw title
+ string for inclusion in the front matter.
+
+ title-value-reverse-function: The function used to retrieve the raw title
+ string from the string in the front matter.
+
+ keywords-key-regexp: The regexp used to retrieve the keywords
+ line in a file. The first line matching this regexp is
+ considered the keywords line.
+
+ keywords-value-function: The function used to format the
+ keywords list for inclusion in the front matter.
+
+ keywords-value-reverse-function: The function used to retrieve
+ the keywords list from the string in the front matter.")
+
(defun denote--file-extension (file-type)
"Return file type extension based on FILE-TYPE."
(pcase file-type
- [elpa] externals/denote updated (5482ce6dad -> b84d945d58), ELPA Syncer, 2022/08/15
- [elpa] externals/denote 09232baa8d 14/17: Add comments to some functions, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 96c09e65b5 15/17: Add denote--file-types-with-extension, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 24e713f096 01/17: Add a File types section, ELPA Syncer, 2022/08/15
- [elpa] externals/denote b84d945d58 17/17: Merge pull request #89 from jeanphilippegg/cleanup, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 3d7c33e4cf 11/17: Fix denote--format-front-matter, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 2d1664c276 16/17: Use when-let in denote--filetype-heuristics, ELPA Syncer, 2022/08/15
- [elpa] externals/denote e14ca11118 03/17: Implement accessor functions for denote--file-types, ELPA Syncer, 2022/08/15
- [elpa] externals/denote a270951e9b 07/17: Rename denote--retrieve-value-title and denote--retrieve-value-keywords, ELPA Syncer, 2022/08/15
- [elpa] externals/denote f9fbebd9e4 09/17: Use plists in denote-file-types, ELPA Syncer, 2022/08/15
- [elpa] externals/denote b3cd0a7d4c 02/17: Add denote--file-types,
ELPA Syncer <=
- [elpa] externals/denote 759fe4cb4e 10/17: Fix denote--filetype-heuristics, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 685152876e 08/17: Rename denote--file-types to denote-file-types, ELPA Syncer, 2022/08/15
- [elpa] externals/denote c7d8d07119 12/17: Rename save-excursion and save-restriction when using with-temp-buffer, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 1eb8d368b1 04/17: Refactor many functions to use denote--file-types, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 9ea4078fb3 06/17: Remove denote--front-matter-keywords-to-list and use denote--retrieve-value-keywords instead, ELPA Syncer, 2022/08/15
- [elpa] externals/denote 4dc13f44e5 05/17: Refactor denote--migrate-type-files and use denote--retrieve-keywords-line, ELPA Syncer, 2022/08/15
- [elpa] externals/denote b179ea3178 13/17: Refactor denote--get-title-line-from-front-matter and denote--get-keywords-line-from-front-matter, ELPA Syncer, 2022/08/15