Comments (10)
Hello @pprevos!
Several of my notes have an enhanced front matter, Org mode allows a lot more entry types than described in Denote, for example
#+startup:
and#+properties:
,#+options:
. It also allows using bespoke keywords.
I see. You mention "several" which makes me think that you insert those on a case-by-case basis? If you were doing it for all notes, the easiest way to get the renaming and creation of new notes to insert those is to modify the variable denote-org-front-matter
.
Can this function be rewritten to replace the content, instead of replacing the complete front matter?
If the above is not appropriate for you, then yes we will need to rewrite the code.
[ This is, by the way, why the rewriting of the front matter always asks for confirmation and never saves the underlying buffer. ]
from denote.
Each note has a different purpose and can have buffer local variables. I use notes a lot to develop snippets of code in Org source blocks, so I have settings for this. Other notes are math-heavy, so the Latex preview feature is on etc.
Ideally,Denote should respect the existing (non-Denote generated) lines in the front matter.
I assume the same would apply to Markdown. Should someone want o convert the note to a website with the Hugo software for example.
from denote.
Thanks for the explanation! In this case we need a more sophisticated method to rewriting the front matter. Now we take an all-or-nothing approach of changing the entire block. The replacement should be done on a per-line basis.
Will think about it some more and work on it tomorrow morning (local time is close to 23h and I've been awake since ~4).
I shall keep you posted on my progress.
from denote.
Will think about it some more and work on it tomorrow morning (local time is close to 23h and I've been awake since ~4).
"Tomorrow morning" arrived earlier than expected... I just pushed commit 4ebd1e9
in the new refactor-front-matter-rewrite
branch. I have tested it and it seems to work reliably, but I have not merged it into main
yet just to be sure everything is in order.
Can you use git to test this right away? Otherwise I will put together the relevant code you need to evaluate in order to test this.
from denote.
Happy to test now. It is a wonderful chill Sunday morning for me here in Australia.
Look after your health Prot, we all need sleep!
from denote.
Hello again Peter,
I tested it again and updated the documentation. The code is now in the main
branch.
Look after your health Prot, we all need sleep!
Thank you! You are absolutely right. Normally I sleep properly. Yesterday was an exception.
from denote.
Hi Prot,
I tried to test the change, but could not figure out how to jump branches.
Just renamed some test files with non-Denote Org mode keywords at the end, start and in the middle of the front matter. I also added a property drawer.
The new method respects existing Org mode keywords. Thanks for the changes.
from denote.
I tried to test the change, but could not figure out how to jump branches.
No worries! I should have explained it.
Just renamed some test files with non-Denote Org mode keywords at the end, start and in the middle of the front matter. I also added a property drawer.
The new method respects existing Org mode keywords. Thanks for the changes.
So you tried the main
branch, right? I am happy to read this.
If the rewriting works properly in all scenaria, I think it makes sense to align it with the semantics of the user option denote-dired-rename-expert
, so that it does not ask for confirmation. But let's leave that for the future. Just to be sure it does the right thing.
from denote.
I like the confirmation. renaming is a serious task in a system with strict naming conventions.
P.S. I just also tested the Markdown dialects and text file versions - all OK.
from denote.
I like the confirmation. renaming is a serious task in a system with strict naming conventions.
Agreed! Let's keep it as-is.
P.S. I just also tested the Markdown dialects and text file versions - all OK.
Great!
from denote.
Related Issues (20)
- `denote-open-or-create` lisp error when working on an empty `denote-directory` HOT 7
- Denote org capture a template to save in a subdirectory HOT 5
- Org capture with denote while creating title programatically HOT 3
- Providing a way to extend the content of the backlinks buffer ? HOT 5
- "denote:" link for non-note files doesn't open HOT 22
- Adding denote-keywords-add and denote-keywords-remove as call able function HOT 14
- denote--get-silo-path: Symbol’s function definition is void: file-name-parent-directory HOT 7
- denote-file-types plist now has 11 elements and not 8 HOT 1
- defuns for implementing a zettelkasten in denote. HOT 14
- Selecting a non-denote file navigates to only to denote files with `denote-link-find-file` minibuffer HOT 1
- use consult for `denote-link-insert-*` HOT 6
- `denote-link-or-create` enters path instead of note name into title history HOT 5
- add a way to use `denote-link-or-create` programmatically HOT 3
- Delimiters in signatures HOT 6
- denote-rename-file-using-front-matter doesn't work since last update HOT 5
- double `#+title ` when called through keybinding but not through `M-x` HOT 12
- backlinks buffer doesn't support non-latin characters HOT 19
- [feature request] Only display TITLE in tabs HOT 19
- is there a way to skip the "file title" prompt when using the function denote-open-or-create HOT 2
- How to open denote links outside of denote when the note is located in a silo? HOT 2
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.