Giter Site home page Giter Site logo

Comments (3)

ndwarshuis avatar ndwarshuis commented on June 21, 2024

I haven't looked into this fully yet but at least limited abbreviation (that is, without any substitutions using %h and %s) shouldn't be hard to add to a new column

from org-sql.

ndwarshuis avatar ndwarshuis commented on June 21, 2024

I added partial support in 140a9f7. Please test and see if this works for you.

Regarding why this is only 'partial', org-element will expand link abbreviations by itself, which means org-sql only sees the expanded link and thus must do a reverse lookup in org-link-abbrev-alist. This isn't a problem if the final expanded link has an exact match, but anything with %s or %h won't work because the tag information that subs into these replacement keys is effectively destroyed by the time the link reaches org-sql. Of course there's hacky ways around this, but nothing I can come up with is very clean or performant.

from org-sql.

jarofromel avatar jarofromel commented on June 21, 2024

I tested with the following results:

  1. new column link_abbrev is visible in the links table
  2. only NULL value is there, i.e. no abbreviations were found in my org mode notes
    • the value of org-link-abbrev-alist in my org config is non nil:
     (("goodreads" . "https://www.goodreads.com/book/show/%s")
     ("doomdir" . "/home/random/.doom.d/%s")
     ("doom-repo" . "https://github.com/doomemacs/doomemacs/%s")
     ("wikipedia" . "https://en.wikipedia.org/wiki/%s")
     ("google" . "https://google.com/search?q=")
     ...)

I'll inspect 2) furthemore.

Regarding the expansion I think the current solution is OK. The link abbreviation in the table tells me which logic was applied during the expansion (because the expansion logic is defined in the org-link-abbrev-list), thus I can reconstruct it by custom SQL (reversing the expanded link_path)

from org-sql.

Related Issues (18)

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.