GithubHelp home page GithubHelp logo

Comments (5)

cglacet avatar cglacet commented on July 18, 2024

According to the format I think this shouldn't be a problem to implement for simple cases, but I'm not too sure how this work if, for example, two notes share the exact same title.

from bear.

cglacet avatar cglacet commented on July 18, 2024

I tried it and even bear can't deal with duplicate titles, so there is no real solution to this. On the other hand I can implement a solution that would work in other cases (I feel like duplicate title is the only hard case).

If you have two notes with title Note A bear link will not be tight to either of those but instead to the most recently modified. I think I can reproduce this behaviour.

from bear.

cglacet avatar cglacet commented on July 18, 2024

I've updated the code in the wikilinks branch so we try it out.

Here is what it would look like (I added the strange behaviour we would have with two notes sharing the same title).

If you want to try it out, you need to switch to the test branch in your local copy of this repository:

# depending on where you installed it, this should be the default:
cd ~/.github/bear/back-references  
git fetch
git checkout -t remotes/origin/wikilinks
python insert_backreferences.py

from bear.

benjaminharr avatar benjaminharr commented on July 18, 2024

Awesome, works like a charm!

Two things I'd love to improve (might be translated into separate issues/features)

  1. remove the / at the end of a backlink if in main section. I'd expect the slash only to appear if the link comes from a sub-section.
  2. Add option to auto-execute or schedule the script. I will temporarily set up an Alfredo workflow to execute via shortcut. Might include an auto-backup before executing as well.

from bear.

cglacet avatar cglacet commented on July 18, 2024

@benjaminharr

Actually, 1. already works, you can use the environment variable BEAR_ROOT_SECTION_TEXT to define your own label (here an empty one) for the root section:

BEAR_ROOT_SECTION_TEXT='' \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/cglacet/bear/master/install.sh)"

Or, since you probably work with the python script directly:

BEAR_ROOT_SECTION_TEXT='' \
python insert_backreferences.py

Other available options are documented here. I should add an option to modify the "note - section" separator too.

I also think 2. would be nice, not sure how to do it yet :). This would also help to solve other problems (like modification dates of notes).

from bear.

Related Issues (7)

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.