Coder Social home page Coder Social logo

Comments (15)

protesilaos avatar protesilaos commented on July 28, 2024 1

Very well! Let's keep this open for a while longer. There may be some more refinements to be made. Will keep you posted.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Hello @atanasj!

If I understand this correctly: you want the front matter to stay as-is and have the file name be renamed according to that data, right?

If so, check the command denote-rename-file-using-front-matter. Documented here: https://protesilaos.com/emacs/denote#h:3ab08ff4-81fa-4d24-99cb-79f97c13a373

[ Try it with a test file before operating on your actual data. ]

from denote.

atanasj avatar atanasj commented on July 28, 2024

Thanks for that, I did try that, but it did not work. I get the message:

denote-rename-file-using-front-matter: No front matter for title and/or keywords

The format of the yaml front matter looks like below:

---
date: 2017-07-25T05:38:27+0000
identifier: "20170725T053827"

title: "IASP - Special Interest Group: Suicidal Behaviour in Adolescents"
tags: ["Treatment"]
url: https://iasp.info/suicidal_behaviour_in_adolescents.php
source: web.clip

---

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Yes, I forgot to mention that the file name must already have an identifier. It should, at the very least, be named 20170725T053827.md.

We will need to update the command to work on any file that ends with one of our supported extensions. Will look into it now.

from denote.

atanasj avatar atanasj commented on July 28, 2024

Okay… that worked after I renamed the file to that. I could probably fudge something on the command line to rename using the identifier, but if it is built in, all the better! Thanks for being so responsive!

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Yes, it should be provided by Denote. There is no reason to keep the current restriction.

from denote.

atanasj avatar atanasj commented on July 28, 2024

That would be awesome!

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

@atanasj You are pulling directly from git, right? If so, please check the latest commit 1bdd0eb. I just tried it with sample.md and valid front matter and got the expected renamed name.

from denote.

atanasj avatar atanasj commented on July 28, 2024

@protesilaos, yes! That works as expected. 😄

from denote.

atanasj avatar atanasj commented on July 28, 2024

Okay… I seem to be having problems in marking and bulk renaming in dired.... I have ranger installed, so not sure if this is causing an issue... However, I disabled the ranger and it still did not work. The message I get is:

No marked files; aborting

Could it be something with my setup? I am also using evil, however the problem persists in emacs-mode within doomemacs.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Which command did you use? The error most likely is internal to Denote.

from denote.

atanasj avatar atanasj commented on July 28, 2024

I am using denote-dired-rename-marked-files-using-front-matter

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I just pushed a change. It basically relaxes the condition of what counts as a writable file. Same idea with what I did for the single file renaming. Please try commit 46f123c.

from denote.

atanasj avatar atanasj commented on July 28, 2024

WORKING! Nice job! This solves the issue for me, so I'll gratefully close! 😄

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Very well! Thanks again for your feedback!

from denote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.