Comments (7)
In recent versions of Denote we no longer support multi-word keywords. The user option denote-file-name-slug-functions
can be used to apply some specific transformation (e.g. to upcase
) the given input. I am thus closing this. Thank you!
from denote.
Hello @djgoku! I am afraid there is no good solution here. The problem with my_name
is that Denote interprets it as _my
and _name
because it appears in the file name like this:
DATE--TITLE__my_name.org
Put differently, by reading the file name we cannot know if those are two separate keywords or a single keyword.
About the use of hyphens, I found this in org.el
:
(defconst org-tag-re "[[:alnum:]_@#%]+"
"Regexp matching a single tag.")
The constraint is that we exclude @
, #
, %
from file names. Changing org-tag-re
will probably break things...
Perhaps we can allow for camelcase like myName
? Otherwise you will have to use single words for the agenda to work.
If there is something else we can do to accommodate this use-case, I am happy to learn about it.
from denote.
Hello @protesilaos! Giving M-x denote
file title
and another_keyword,file_keyword
creates this file
20230109T231457--file-title__another-keyword_file-keyword.org
If I replace dashes in filetags
to underscores like #+filetags: :another_keyword:file_keyword:
then run M-x denote-rename-file-using-front-matter
it renames the file to: 20230109T231457--file-title__another_keyword_file_keyword.org
. Which shows up correctly in org-agenda
edit So maybe using underscores for both filetags
and keywords in the filename would work?
from denote.
So maybe using underscores for both
filetags
and keywords in the filename would work?
What happened in that renaming operation is that the two keywords another_keyword
and file_keyword
were converted into four keywords: another
, keyword
, file
, keyword
. This means that in the keywords' prompt you will get those as completion candidates, even though that was not your intention.
This can work, though it depends on your workflow and the specific words you will use. Though in that case, you can skip the renaming part and just use the individual words as keywords.
from denote.
Ahh good to know.
My denote/org config is:
(setq org-agenda-files '("~/dev/org" "~/dev/notes"))
(use-package
denote
:straight t
:config
(setq denote-directory "~/dev/notes"))
My workflow is M-x denote
and then type in file title and add keywords. I can look into seeing if I can modify the function that modifies keywords that get inserted into #+filetags
and builds the filename string to see if I can get it to work for my workflow.
I'll give an example of what I want and the output I would want so it works in org-agenda
.
M-x denote
File title: notes of things I have learned while writing code
File keyword: emacs_lisp,software_development,data_structures
Wanted Filename created 20230111T162437--notes-of-things-i-have-learned-while-writing-code__data_structures_elisp_software_development.org
Wanted File contents:
#+title: notes of things I have learned while writing code
#+date: [2023-01-11 Wed 16:24]
#+filetags: :data_structures:elisp:software_development:
#+identifier: 20230111T162437
If there is a way to configure the keyword separator for the file name I could configure it to be ___
three underscores or maybe a single dash?
If three underscores:
20230111T162437--notes-of-things-i-have-learned-while-writing-code__data_structures___elisp___software_development.org
If a single dash:
20230111T162437--notes-of-things-i-have-learned-while-writing-code__data_structures-elisp-software_development.org
.
from denote.
Thanks for the detailed explanation! The use of the triple underscores will not solve our problem. With the current approach, we can search for, say, _data
to list all relevant notes. If the underscore is a word separator, we will still get false positives like _structures
.
I think the only way to accommodate the Org agenda while also using multi-word keywords is to employ camelCasing or similar techniques. Denote would still need to be modified to not alter the capitalisation of those words.
Here I should note why the casing of keywords is changed. I did it to streamline the experience. We do not need to worry about typos or possible variations of the same concept like XTerm
, xterm
, Xterm
.
from denote.
With the current approach, we can search for, say,
_data
to list all relevant notes. If the underscore is a word separator, we will still get false positives like_structures
.
Do you mind elaborating on your workflow of how you search for relevant notes?
I think the only way to accommodate the Org agenda while also using multi-word keywords is to employ camelCasing or similar techniques. Denote would still need to be modified to not alter the capitalisation of those words.
Edit: I do understand there is at least two things in play here. There is a need for consistent file naming and from that builds the front matter. Not only would file naming need to be changed or configurable but the way that keywords are saved in front matter would need to change to make valid org-mode
tags.
If the keyword separator in filenames could be configured to a -
(single dash) that should work, no? If there is something more to read within the code to try and understand why or why this won't work, I would be happy to read.
from denote.
Related Issues (20)
- is it possible to create single tag with multiple words seperated by delimter? HOT 3
- Backlink buffer aware of org heading HOT 2
- Can't add link to file from within org-capture: "The current file type is not recognized by Denote" HOT 8
- Problem due to overloading `no-confirm` for "save" HOT 7
- How can I figure out which version of denote is currently used? HOT 4
- Templates are not working in denote-org-capture-with-prompts HOT 5
- Cannot add a denote link in `org-add-log-note` HOT 2
- update the link description if the target title is changed HOT 7
- Announcement: Some upcoming features available in my fork HOT 15
- Add support for adding keywords and/or removing keywords when using `denote-dired-rename-marked-files`
- org-display-inline-images doesn't work for denote: links HOT 2
- Allow listing backlinks for denote files that are not notes HOT 3
- denote-org-extras-convert-links-to-file-type ignores value of org-link-file-path-type HOT 5
- Cusomizing the used token character for the title field separator HOT 3
- Is there an equivalent `denote-org-extras-convert-links-to-file-type ` for markdown files? HOT 4
- Sluggify accented titles HOT 4
- What should be the delimiter of identifiers in file names? HOT 5
- The βdenoteβ links in markdown exported files do not work HOT 2
- Denote file duplication HOT 5
- Using groups for matching regex and other hacks 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.