Coder Social home page Coder Social logo

micha-a-schmidt / dendron-citations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mivanit/dendron-citations

0.0 0.0 0.0 62 KB

tool for making dendron work well with citing things using bibtex or Zotero

License: GNU General Public License v3.0

Python 100.00%

dendron-citations's Introduction

dendron-citations

tool for making Dendron work well with citing things using bibtex or Zotero

WORK IN PROGRESS. please use with care, since this will overwrite files in your dendron vault

generates a vault of dendron notes corresponding to entries from a bibtex file

this allows the user to reference the dendron notes instead of raw bibtex item (such as when using PandocCiter), which lets us use backlink features from dendron to see where we have cited a paper

Note: I personally put all my references in a separate vault from my main vault, to avoid clutter. I highly recommend this, since this might also prevent you from accidentally overwriting things in your main vault.

Usage:

python refs_vault_gen.py --bib_filename <bibtex_file> --vault_loc <output_dir>

or simply

python refs_vault_gen.py <bibtex_file> <output_dir>

Example:

for example, if the script and a bibtex file refs.bib are both located in the directory containing our vault/, we may write

python refs_vault_gen.py refs.bib vault/refs.

this will create notes of the form refs.some-bibtex-key.md in the vault/ directory.

Given the bibtex file examples/refs.bib, the vault examples/vault/ was generated with

py refs_vault_gen.py examples/refs.bib examples/vault/refs.

tag notes

Not only can we use dendron backlinks to view where we have cited a certain paper, but we can additionally use the backlinks to see all papers by a given author, or all papers with a given keyword!

The argument --make_tag_notes, True by default, will enable the generation of notes for each tag, as long as the tag does not yet exists. Keywords will be processed into tags by removing spaces and other extra characters. Author tags will be of the format <first_char_of_first_name>-<last_name>, with all characters converted to ascii. The actual notes for author tags will contain the full author names.

templates

For now, you need to manually modify the template string DEFAULT_TEMPLATE in the file refs_vault_gen.py to suit your needs. The template is in Mustache format, with some extensions:

  • Add the prefix _bln_ to the name of any iterable variable to get access to a boolean value that is true if the variable is not empty
  • Lists of non-dict items are turned into lists of dicts, where each dict has a single key elt with the value of the item

Roadmap:

bibtex integration

  • given a bibtex file, generate a vault of dendron notes bibtex keys as filenames
  • add tags and other things from bibtex to metadata
  • optional generation of tag files
  • "beneath" each note for the bibtex, add another note for the citation itself.
    • note that this will all break if the bibtex keys change!
  • automatically convert PandocCiter style
    • this will allow for better searching for papers
  • make citations work properly when compiling with Pandoc
  • turn this into a real vscode plugin
    • mostly to simplify installation
    • will probably use vscode-ext

zotero integration

do everything as for bibtex integration, but also:

  • add links/copies in zotero to the dendron notes (when they exist)
  • have zotero item materials inside dendron file
    • zotero notes, plaintext attachments inline
    • links to all other attachments
    • exclude the dendron file to avoid recursion, haha

Misc

  • to allow simpler references to papers in a separate vault, without having to type [[dendron://refs-vault/<bibtex key>]], the user may create a vscode snippet in > Preferences > Configure User Snippets > markdown.json
"dendron-cite": {
	"prefix": "@",
	"body": [
		"[[dendron://refs-vault/refs.$1]]"
	],
	"description": "dendron reference citation"
},

Installation:

not yet on pypi. for now, you just need the files md_util.py and refs_vault_gen.py somewhere, along with the dependencies listed below. This is a WORK IN PROGRESS, so I haven't put much work into streamlining installation.

Dependencies:

dendron-citations's People

Contributors

mivanit avatar micha-a-schmidt avatar

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.