Giter Club home page Giter Club logo

Comments (4)

gklimowicz avatar gklimowicz commented on July 30, 2024

The first line of an org file is customarily the #+TITLE line. I don't know whether that is a requirement, or just a custom. (I've not seen an example where the #+TITLE was not first, but I haven't searched the entire Internet.)

Note that zetteldeft-title-prefix starts with it.

Regarding the link highlighting, how have you set zetteldeft-id-regex? That might be related, as I believe you need to set it in such a way that zetteldeft--id-font-lock-setup will be called (like via :custom in use-package).

from zetteldeft.

AtomicNess123 avatar AtomicNess123 commented on July 30, 2024

First, thanks for your help.

I actually learned from other users and set my orgfiles to be of the form:

#+startup: overview
#+startup: indent
#+options: toc:nil num:nil
#+todo: TODO FANCY OPTIONS | DONE
# ...etc.
#+title: My title

I like this approach because I don't have the title and then lots of setting in between the main text and the title, it's just a preamble with settings.

My zetteldeft-title-prefix’s value is:

"#+STARTUP: overview
#+STARTUP: indent
#+TITLE: "
Original value was "#+TITLE: "

I modified to suit my needs.

As for my setteldeft-id-regex, I modified it also:

"[0-9]\\{4\\}\\(-[0-9]\\{2,\\}\\)\\{3\\}-[0-9]\\{2\\}"
Original value was 
"[0-9]\\{4\\}\\(-[0-9]\\{2,\\}\\)\\{3\\}"

from zetteldeft.

EFLS avatar EFLS commented on July 30, 2024

So these are actually two separate issues.

First the titles: Zetteldeft relies on Deft to figure out the title of a note, so the challenge here is to figure Deft correctly. Take a look at deft-strip-title-regexp. I seem to recall a discussion about this topic in Deft's Github repository, perhaps start there? EDIT: It's this issue

Second the link highlighting: this is indeed something Zetteldeft should take care of. How did you customize the zetteldeft-id-regex in your setup? I think two approaches should work: either via setq before requiring Zetteldeft, or via the customize interface. This way, the font-lock is applied correctly, as explained by @gklimowicz

from zetteldeft.

AtomicNess123 avatar AtomicNess123 commented on July 30, 2024

Thanks!

(1) deft-strip-title-regexp:
"\\(?:^%+\\|^#\\+TITLE: *\\|^[#* ]+\\|-\\*-[[:alpha:]]+-\\*-\\|^Title:[ ]*\\|#+$\\)"
This is a regex issue, and I don't know much regex, so I guess I will be stuck here. I read the thread but couldn't figure it out yet. Will keep trying.

(2) zetteldeft-id-regex should be correct:
Its value is "[0-9]\\{4\\}\\(-[0-9]\\{2,\\}\\)\\{3\\}-[0-9]\\{2\\}"
Original value was
"[0-9]\{4\}\(-[0-9]\{2,\}\)\{3\}"

edit: I forgot to answer your question on how I set up this variable:

(setq zetteldeft-id-regex "[0-9]\\{4\\}\\(-[0-9]\\{2,\\}\\)\\{3\\}-[0-9]\\{2\\}")

and I call it on my init AFTER requiring zetteldeft.

edit:

calling it before fixes the issue (2), thanks!

from zetteldeft.

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.