All Projects → cglacet → bear

cglacet / bear

Licence: other
Add to each Bear note a back-reference to notes that are citing it.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to bear

zettel-mode
A Zettelkasten-style note-taking helper
Stars: ✭ 32 (+14.29%)
Mutual labels:  zettelkasten
Linkees
Awesome Linktree clone made with React ⚛️
Stars: ✭ 68 (+142.86%)
Mutual labels:  links
markdown-github-bear-toc
Autogenerated Table of Contents for Github Markdown or Bear Notes
Stars: ✭ 79 (+182.14%)
Mutual labels:  bear
quill-magic-url
Automatically convert URLs to links in Quill
Stars: ✭ 86 (+207.14%)
Mutual labels:  links
slipbox
A static site generator for Zettelkasten notes
Stars: ✭ 32 (+14.29%)
Mutual labels:  zettelkasten
nuxt-interpolation
Nuxt.js module as directive for binding every link to catch the click event, and if it's a relative link router will push.
Stars: ✭ 38 (+35.71%)
Mutual labels:  links
Obsidian-Markdown-Parser
This repository will give you tools to parse and fetch useful informations of your notes in your Obsidian vault.
Stars: ✭ 32 (+14.29%)
Mutual labels:  zettelkasten
octopus
Recursive and multi-threaded broken link checker
Stars: ✭ 19 (-32.14%)
Mutual labels:  links
TREE
You wont catch me paying for a monthly subscription to a service like linktree or manylink when I can build my own instead
Stars: ✭ 22 (-21.43%)
Mutual labels:  links
ciencia-da-computacao
🔗 🎓 🎒 lista de links interessantes para professores de determinadas áreas de conhecimento em computação
Stars: ✭ 29 (+3.57%)
Mutual labels:  links
php-linkchecker
Check broken links in html / json files, sitemap.xml, markdown and robots.txt
Stars: ✭ 24 (-14.29%)
Mutual labels:  links
zettelstore
This is a mirror of https://zettelstore.de
Stars: ✭ 16 (-42.86%)
Mutual labels:  zettelkasten
awesome-indie-android-apps
A curated list & timeline of awesome android apps by indie developers / solopreneurs
Stars: ✭ 34 (+21.43%)
Mutual labels:  links
keep-it-markdown
Convert Google Keep notes dynamically to markdown for Obsidian and Notion using the unofficial Keep API
Stars: ✭ 125 (+346.43%)
Mutual labels:  zettelkasten
zk
A note-taking tool based on the famous Zettelkasten method
Stars: ✭ 41 (+46.43%)
Mutual labels:  zettelkasten
Data-Science-and-Machine-Learning-Resources
List of Data Science and Machine Learning Resource that I frequently use
Stars: ✭ 19 (-32.14%)
Mutual labels:  links
ReflectivePELoader
Reflective PE loader for DLL injection
Stars: ✭ 130 (+364.29%)
Mutual labels:  links
ngx-linkifyjs
Angular V8 wrapper for linkifyjs - library for finding links in plain text and converting them to HTML <a> tags via linkifyjs
Stars: ✭ 40 (+42.86%)
Mutual labels:  links
bhugo
A tool to transform Bear notes into Hugo-compatible markdown files
Stars: ✭ 51 (+82.14%)
Mutual labels:  bear
qr
🔲 Generate QR Codes straight in your terminal!
Stars: ✭ 34 (+21.43%)
Mutual labels:  links

Automatically add back-references to all your Bear notes

  • ⚠️ Make sure to backup your notes before trying this, or just try it in test mode.
  • 📅 Running this script will change modification dates of all modified notes (I would like to prevent this, but for now I can't and asked for help here).
  • 💻 Install scripts are mainly disgned for non-developer users, if you are confortable with git/python it may be more confortable for you to proceed with the manual installation.

Back references to notes

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

Back references to sections

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

Running commands in your terminal

How to run a bash command on OSX: Bring spotlight search in by hitting ⌘ + space, search for terminal and validate you search with ↵ enter.

A terminal window shows up, copy paste any of the previous command /bin/bash -c "..." in the terminal then hit ↵ enter to run the bash script.

Why

The suggestion comes from this question on reddit:

There has been interest in this feature already with previous posts:

Is this feature on the near-future roadmap?

I would absolutely love this for the Zettelkasten tool I want to build [based on Niklas Luhmann note scheme]. There are several dedicated software tools out there implementing ZTK specifically [nvALT, The Archive], but they all have downsides. For starters they are not cross platform macOS/iOS/iPadOS...]!

Bear already supported the auto-link-complete feature with [[ notation...

Having a note at the bottom of each note indication other notes that are linking to it would make Bear for me 'the perfect Zettelkasten' tool! And probably that of many others too. No problem if this would be subscription only feature... happy to pay for it, in fact it should be, otherwise the cross platform requirement would be moot ;)

How

The script:

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

Here is what this script does, it:

  • installs all shell dependencies (Git/Python/pyenv) using Homebrew,
  • downloads the most recent sources from here in the repository ~/.github/bear/back-references,
  • sets this directory's default python interpreter to a recent version of python 3.7.
  • runs the python script that actually make all the work, which is:
    • finding all outgoing links from existing Bear notes
    • adding back-references to existing notes.

Theses steps are also described in the manual installation section and more details on how the python script operate on Bear notes can be found here. The installation script can be found here and uses more general scripts from here.

Use in test mode

In test mode, nothing will happen to your notes. The script will only output what it would have added to your notes directly in the terminal. To use the test mode, simply set BEAR_TEST=true before running the script:

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

The result will look like that:

Customize the output

You can set environment variables to modify the output of this program. By default the markdown produced for back-references is the following:

---
Non-referenced incoming links: 

* [Title of the note](link-to-node)
* [Title of another note](link-to-another-node)

For example if we need to modify the introduction text you just need to run:

BEAR_BACKREFERENCES_INTRO_TEXT="Liens entrants vers cette note :" \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/cglacet/bear/master/install.sh)"

Which will render the following markdown:

---
Liens entrants vers cette note : 

* [Title of the note](link-to-node)
* [Title of another note](link-to-another-node)

If you need to have several options:

BEAR_BR_SECTIONS=false \
BEAR_BACKREFERENCES_INTRO_TEXT="# References" \
BEAR_BACKREFERENCES_SECTION="" \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/cglacet/bear/master/install.sh)"
# References

* [Title of the note](link-to-node)
* [Title of another note](link-to-another-node)

Complete documentation on environment variable options

environment variable target/effect default value
BEAR_BACKREFERENCES_SEPARATOR separator ---
BEAR_BACKREFERENCES_INTRO_TEXT introduction text This note is referenced in:
BEAR_BACKREFERENCE_PREFIX prefix of each link \n*
BEAR_ROOT_SECTION_TEXT root section representation /
BEAR_BR_SECTIONS link back references to sections true
BEAR_TEST output text in terminal false

Manual installation

Since non developers may use this I wanted to have a single command to copy paste and make things as simple as possible for everyone. This is why this section doesn't come first. Get the latest version of this repository:

git clone [email protected]:cglacet/bear.git
cd bear

If you already cloned the repository you can just pull the latest version:

cd bear 
git pull origin master

In order to run the script you need python ≥ 3.6:

python --version

If you version is older than 3.6 you will need to update it, and as this drawing shows, dealing with python versions is not really easy:

Therefore I would strongly advise using the amzing pyenv to deal with this mess for you:

brew install pyenv
pyenv install 3.7.7   # Install a more recent version of python (you can pick any version ≥ 3.6)
pyenv local 3.7.7     # Use that interpreter as the default one in the current directory (and only here)

You can now run the script using the environment variables as documented before:

BEAR_TEST=true python insert_backreferences.py

Instead of using environement varaibles everytime, you can also directly edit the values you want to change in constants.py and config.py.

If you have more questions

If you are a developer, maybe you can read the implementation notes. Also, any comment is welcome, feel free to open a new issue (even for discussions).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].