Comments (3)
Hyphens and underscores (as a single character) are already permitted in titles. The default sluggification of titles replaces spaces and underscores with hyphens. That is probably what you find undesirable. I recommend you try to disable sluggification for all file components, like this:
(setq denote-file-name-slug-functions
'((title . identity)
(signature . identity)
(keyword . identity)))
This way, you can have underscores and hyphens (and uppercase and spaces, etc.) in your titles. If you would like to keep some of the current default sluggification (eg downcasing), you can create your own function. Check denote-sluggify-title
as an example.
As for single underscores in the keywords, this is not currently possible because it is the keywords separator.
In summary, only consecutive -
,_
and =
are reserved in Denote's file names. They can be used as single characters freely (if the default sluggification is disabled), with the exception that single underscores cannot be used in keywords because of the above.
from denote.
from denote.
This is the changed function I'm using now in my workflow.
(based on the existing ones in denote.el)
(defun denote--slug-hyphenate-gb (str)
"Replace spaces with hyphens in STR.
Also replace multiple hyphens with a single one and remove any
leading and trailing hyphen."
(replace-regexp-in-string
"^-\\|-$" ""
(replace-regexp-in-string
"-\\{2,\\}" "-"
(replace-regexp-in-string "\s+" "-" str))))
(defun denote-sluggify-title-gb (str)
"Make STR an appropriate slug for title but keep punctuation."
(downcase (denote--slug-hyphenate-gb (denote--slug-no-punct str))))
from denote.
Related Issues (20)
- When ~denote-org-capture-specifiers~ don't include a format specificer for a link don't call ~org-get-id-create~ HOT 5
- Suggestion a denote-keyword-append function. HOT 12
- error with denote-files-matching-regexp-prompt HOT 5
- Nested silo interferes with `denote-directory-files` (was: "dblock enhancement add a silo target") HOT 10
- denote-rename-file-title ==> Destination file xxx already exists HOT 13
- Make default file permission configurable HOT 2
- How to make heading with custom_id properties searchable? HOT 3
- Backlinks buffer links not working with nested dirs HOT 1
- `denote-create-note` silently HOT 3
- "No links found" when using `denote-find-link` in denote files inside a silo HOT 10
- When exporting all my notes to Markdown, `denote:` links point to `.org` files HOT 7
- Cannot insert links in org indirect buffer HOT 3
- Only use ASCII in file names HOT 7
- A general way to exclude files matching regexp from dblocks and maybe more (was: Exclude keywords while using dblocks) HOT 2
- Lisp error: (void-function denote-link-buttonize-buffer) HOT 1
- Feature request : adding an option to list empty or non-empty notes with denote-sort-dired HOT 1
- denote-rename-file and real-auto-save HOT 5
- Dynamic block backlinks to this-heading-only doesn't work? HOT 4
- [Feature Request] Add indicator of current silo in the prompt when running denote commands HOT 3
- Prettification of links to Denote attachments HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from denote.