Commit 334e7f3a authored by Jason Blevins's avatar Jason Blevins

Examples of file creation and naming rules

parent b7602841
......@@ -282,7 +282,12 @@ The possible cases are as follows:
When `deft-use-filename-as-title` is non-`nil`, the filter string
will be used as the filename for new files (with the appropriate
file extension appended to the end).
file extension appended to the end). An example of new file creation
in this case:
* Filter string: "My New Project"
* File name: "My New Project.txt"
* File contents: [empty]
3. **Readable filenames** (`deft-use-filename-as-title` is
`nil` but `deft-use-filter-string-for-filename` is non-`nil`):
......@@ -301,6 +306,25 @@ The possible cases are as follows:
documentation for `deft-file-naming-rules` for additional
details.
As an example, with the following value for
`deft-file-naming-rules`, Deft will replace all slashes and
spaces with hyphens and will convert the file name to
lowercase:
(setq deft-file-naming-rules
'((noslash . "-")
(nospace . "-")
(case-fn . downcase)))
Below is an example in this case, with the above file naming
rules. Notice that the filter string is inserted as the first
line of the file but it is also used to generate a "readable"
file name.
* Filter string: "My New Project"
* File name: "my-new-project.txt"
* File contents: "My New Project"
Titles inserted into files from the filter string can also be
customized for two common modes, `markdown-mode` and `org-mode`, by
setting the following variables:
......
......@@ -308,7 +308,12 @@
;; When `deft-use-filename-as-title' is non-`nil', the filter string
;; will be used as the filename for new files (with the appropriate
;; file extension appended to the end).
;; file extension appended to the end). An example of new file creation
;; in this case:
;; * Filter string: "My New Project"
;; * File name: "My New Project.txt"
;; * File contents: [empty]
;; 3. **Readable filenames** (`deft-use-filename-as-title' is
;; `nil' but `deft-use-filter-string-for-filename' is non-`nil'):
......@@ -327,6 +332,25 @@
;; documentation for `deft-file-naming-rules' for additional
;; details.
;; As an example, with the following value for
;; `deft-file-naming-rules', Deft will replace all slashes and
;; spaces with hyphens and will convert the file name to
;; lowercase:
;; (setq deft-file-naming-rules
;; '((noslash . "-")
;; (nospace . "-")
;; (case-fn . downcase)))
;; Below is an example in this case, with the above file naming
;; rules. Notice that the filter string is inserted as the first
;; line of the file but it is also used to generate a "readable"
;; file name.
;; * Filter string: "My New Project"
;; * File name: "my-new-project.txt"
;; * File contents: "My New Project"
;; Titles inserted into files from the filter string can also be
;; customized for two common modes, `markdown-mode' and `org-mode', by
;; setting the following variables:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment