Giter Site home page Giter Site logo

obsidian-people-link's Introduction

Obsidian People Link

Easily create links to people within your notes.

Features:

  • Type @ to show a list of people's suggestions sourcing from a specific folder or tag, and press enter to create a link to the selected note for the person.
  • Select <person name> (new) to create a new note for the person in a splited pane.

Installation

Prerequisite:

  1. To ensure proper functionality, you must install Obsidian Dataview alongside this plugin.
  2. If you also installed Natural Language Dates, make sure to change its "Trigger phrase" to something other than @, or just disable its data autosuggest feature.

This plugin is currently under review by the moderators before added to the official plugins directory. if you want to try it now, please use the BRAT Plugin to install it.

How to use

Setup

After installing the plugin, you should first enable it and open the settings modal:

The most important setting is "Dataview Source", it's used to identify notes for people, the default value is "People" (no trailing slash), which means to search people from the "People" folder and all its sub folders. You should change it according to your vault's structure.

You can also use tags to define "Dataview Source", for example #contact, this will search all the notes with the tag #contact.

If you have multiple folders or tags for people, you can use the or operator, the following example will search all the notes with the tag #contact or the folder "People": #contact or "People".

For more information, please refer to the Dataview documentation of Sources.

Basic usage

Simply type @ in a note, you'll see a list of suggestions of the people in your vault.

People in the suggestions list are sorted by their last modified date from newest to oldest. The number of results is limited to 5, you can change this in the settings.

When you start typing more letters, a fuzzy search will be performed, updating the most relevant suggestions as you type.

You can use the arrow keys or ⌃ n, ⌃ p to navigate through the suggestions. When you press Enter, the link to the selected note will be created.

Create new note for a person

If the person does not exist yet, the color of the suggestion is dimmed and has a (new) suffix, indicating that it will be created when you press Enter. This behavior could be disabled in the settings.

The new note is create at the specified location in the settings. Upon creation, it opens in a split pane, but can be adjusted to open in a new tab through the settings.

Unless it's an exact match, the new person suggestion is always appeared at the bottom, making it possible to create a new person even if people with similar names are suggested.

Cancel suggestion

You can press (ESC) or ⇧ ⏎ (Shift + Enter) to cancel the suggestion, leaving the content you typed unchanged.

Diagnostics

You would see the following warnings in the setting tab if the plugin does not work properly:

Please follow the instructions to fix the issues. If there's no warnings in the settings tab, but the plugin still does not work, please open an issue in this repository.

Settings reference

  • Trigger Prefix

    Character(s) that will cause the people autosuggest to open

  • Dataview Source

    The dataview source is used to identify notes for people. It can be folders, tags, files, or a combination of them. Check more information at Dataview docs: Sources

  • Suggestions Limit

    The maximum number of suggestions to show.

  • Create person if not exists

    Create a person when press enter if one doesn't already exist.

  • New person location

    New person will be created at this folder location.

  • Open new person in split pane

    If disabled, new person will be opened in a new tab.

Credits

This project is made possible by the community surrounding it and especially the projects listed below:

obsidian-people-link's People

Contributors

reorx avatar

Stargazers

 avatar  avatar a13ph avatar Andrew Mason avatar Jamie Brynes avatar Luke Evans avatar Ha'ani Whitlock avatar Ed avatar Herb Brewer avatar Mark Kelly-Smith avatar  avatar  avatar  avatar  avatar Dustin Smith avatar Jack Chronicle avatar Sascha Brossmann avatar  avatar  avatar Mohamad El-baba avatar  avatar  avatar Thomas Vander Wal avatar Matthew Turk avatar Karl Q. avatar Nicholas De Nova avatar Yves Goldberg avatar Andrejs Agejevs avatar  avatar  avatar limichange avatar gaoryrt avatar soothsayer avatar Axel avatar  avatar Owain  gaunders avatar

Watchers

 avatar Tristan Rentz avatar  avatar  avatar  avatar  avatar

obsidian-people-link's Issues

Add Template to "Create person if not exists"

Is your feature request related to a problem? Please describe.
I'd like to add a template to each person I'm creating.

Describe the solution you'd like
Allow setting to add from template or add to document on creation.

Describe alternatives you've considered
Manually adding the information to the page after it is created.

Additional context
My sample use case is to use dataview to add to the page all the instances where I have mentioned the individual. This snippet displays a table that shows all backlinks to the person page.

TABLE WITHOUT ID 
file.inlinks AS Mentions
WHERE 
file.name = this.file.name 

please add support for "full/canonical" links

Is your feature request related to a problem? Please describe.

I have the plugin setup and working. DataView is properly returning a list of files from my $root/contacts folder.

If i have a $root/contacts/sam.md file, I can type @ and will see sam as one of the auto-complete entries.

When I hit enter to confirm that I want @sam, I am left with [[sam]]. Since there is only one sam.md in my entire vault, the link is very short but this breaks some other personal workflow/automation/tooling in place that relies on full and canonical paths in all links.

Describe the solution you'd like

In obsidian settings, under Files & Links I have the New link format set to Absolute path in vault. If it's not possible for a plugin to observe the state of this user setting, I would like a simple control exposed on the plugin settings page to adjust the behavior to "full/explicit path" rather than the current behavior of "shortest possible".

Describe alternatives you've considered

Right now, I have a very crude script that looks for [[$someStringHere]] and - provided that there is also a contacts/someStringHere.md file - the script will adjust the link.

Additional context

Setup Issues

I found that after installing via BRAT, I was able to turn on an configure the plugin options. When I went to a note to test it, typing at opened a menu with the options "Today, Yesterday, Later". I found that the popular "Natural Language Dates" pluggin uses @ by default to trigger a menu. I turned off that feature of it's plugin, but then found that People Link still wasn't working, @ didn't do anything. I tried to go back to the configuration page, but People Link now doesn't show a configuration page. It's in the list of plugins, shows it's turned on, has a heart and an X option, but no configuration icon. Note that I've exited Obsidian a number of times hoping to get it to open fresh and work, but no dice.

Doesn't work when @ is added to a bullet

Describe the bug
When typing @ on a bullet, it doesn't display the people menu.

Environments (please complete the following information):

  • OS: MacOS
  • Obsidian v1.3.5

To Reproduce
Steps to reproduce the behavior:

  1. Add a bullet using "-" (no quotes)
  2. Then type "@" (not quotes)
  3. People list doesn't appear (but it works fine when not in a bullet)

Expected behavior
Display the list of people.

Screenshots
An example (with source view off):
image

The same example (in source view):
image

Other plugins active:
image

Add support for a template to create the person page

Is your feature request related to a problem? Please describe.
When creating new person/contact, the file is a 0 byte file. I would like to have an option to define a free chosable template file here, so I can fill up it later with additional information.

Describe the solution you'd like
another option field to define a template for new contacts file creation.

Describe alternatives you've considered
replacing the new 0-byte file with a suitable template file.

Additional context

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.