Code Monkey home page Code Monkey logo

obsidian-link-archive's Introduction

Obsidian Link Archive

This plugin archives links in your note so they're available to you even if the original site goes down or gets removed.

How it works

Upon pressing the "Archive Links" button in the ribbon/left sidebar, the plugin:

  1. looks up every external link in the current note,
  2. sumbits each of them to https://archive.org,
  3. as soon as they are saved, it embeds an (Archived) link after the regular link in your note.

The plugin will attempt not to recreate archive links for already-archived links (and the archive links themselves) - but this relies on not modifying the formatting of the archive links.

Installation

In Obsidian, navigate to Settings > Community Plugins, turn off Safe mode if you haven't yet, then press the Browse button - you should be able to find it in the list there.

Alternatively, download the latest release of the repository, and copy the main.js, manifest.json and style.css files to you vault's .obsidian/plugins/obsidian-link-archive folder and then enable it under Settings > Community Plugins (the note about disabling above applies here as well).

Changelog

v0.2.0

  • Added error handling.
  • Plugin properly handles markdown links.
  • Added better progress reporting.
  • Refactored plugin into multiple files.
  • Added a setting for a custom link text.
  • Improved logic for detecting already-archived links.

v0.1.1

  • Added missing license.

v0.1.0

Initial release.

Future plans

  • Support for other archive providers

obsidian-link-archive's People

Contributors

tomzorz avatar

Stargazers

TheMattaBase avatar TheBestPessimist avatar Alex Sirac avatar Zhitao Chen avatar Kristian Fredrik avatar  avatar coffeepenbit avatar fyx avatar Ben Lee-Cohen avatar vancaem avatar Jay Soh avatar Michael avatar Deandra avatar  avatar ngrlt avatar AugenAugen avatar Andrey Borzunov avatar  avatar Ivan avatar  avatar  avatar Steven Lombardi avatar  avatar Scott Walter avatar Thea avatar Anna Gerasimova avatar Jean-Baptiste avatar Felipe Meres avatar  avatar  avatar Harry Gallagher avatar KaliMerO666 avatar Cas Olischläger avatar Kyle Hovey avatar  avatar Brian Anderson avatar  avatar  avatar  avatar Andrezza Souza avatar  avatar KIM SOYEON avatar Tom Hoover avatar Cristián Romo avatar Dustin Smith avatar seeumara avatar  avatar Jason avatar Anna avatar  avatar Lukas Schulte Pelkum avatar Sebastian Espei avatar Greg Vari avatar  avatar  avatar Jun Lin avatar  avatar Huy Z avatar a13ph avatar Emory L. avatar F0otsh0T avatar Samej Spenser avatar Eric avatar Luke Harris avatar earnest ma avatar zcwennn avatar  avatar Jimmy Briggs avatar JuestChaOS avatar Alicia Miedl avatar Laura Smith avatar  avatar  avatar  avatar Sean Wang avatar cocoonk1d avatar  avatar Ben Hong avatar Parth Kabra avatar David Romero avatar Zhichao,Feng avatar  avatar Olivia Lucca Fraser avatar José Luis Expósito Robles avatar Miloš Lajtman avatar  avatar Andrew Geng avatar Will Crow avatar Stephen Hepner avatar Darius Dunlap avatar WynterAC  avatar Matthias avatar Glenn 'devalias' Grant avatar  avatar Tom Leary avatar Riedel avatar  avatar Alexander Johnstone avatar Jared Gaut avatar Stanislas avatar

Watchers

James Cloos avatar saasfreelancer avatar Alexey Zaharchenko avatar  avatar  avatar  avatar  avatar

obsidian-link-archive's Issues

Installing from repo does not work

I've copied the contents from this repo by downloading the source as ZIP (0.1.1 tag) to .obsidian\plugins\obsidian-link-archive but I get this error in the console when I try to activate it.

I am on Obsidian version v0.12.15 on Windows

grafik

We will probably need a compiled version as Obsidian does not seem to be able to work with typescript directly.

Update the position information within note of original link before pasting the Archived link

Current behavior

  • When activating the archiving process (that takes a while) and switching to another not, the Archived links get pasted into the other note
  • Also, when moving the link within the same note, the Archived link gets pasted at the location where the original link was initially

Workaround

Manually move the Archived links to the correct position

Proposed solution

  • When triggering archiving process, save the note, the process was triggered for
  • When Archived link is ready for pasting into the note, search the note again for the location of the original link and position the Archived link accordingly

Feature request: don't archive links in frontmatter

Currently, the plugin scans the whole file and archives any links that it finds. This becomes problematic if you make heavy usage of the frontmatter in a note, especially if you also use other plugins that rely on that frontmatter.

It would be helpful to have a way of specifying that the plugin should not archive links in the frontmatter.

Incorrectly formatting markdown links

The text [MyLink](https://mylink.com) is formatted as [MyLink](https://mylink.com[(Archived)](https://archive.org/link/)). Note the mishandling of the final ). The Archived link should be placed following the final ')' of the original markdown link.

Bug: Failed to archive

I keep getting "1/1 Failed to archive [URL]" followed by "Link archiving done!" But it doesn't do anything. There isn't an error in the console:

obsidian.md-1647560582064.log

SYSTEM INFO:
	Obsidian version: v0.13.33
	Installer version: v0.13.31
	Operating system: #1 SMP Debian 5.15.15-1 (2022-01-18) 5.15.0-3-amd64
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: light
	Community theme: Typomagical
	Snippets enabled: 3
	Safe mode: off
	Plugins installed: 40
	Plugins enabled: 2
		1: Divide & Conquer
		2: Link Archive

Any ideas? Thanks!

Feature request: add date to archive text

Currently, the plugin inserts a link to the archived content with the text (Archived). While you can customize it to an extent, it would be great to be able to automatically generate the date/timestamp at which it was archived. (I tried using (Archived on {{date}}) and it didn't work.)

Optimally, it would use the date/timestamp preferences that the user has specified within Obsidian.

Feature request: Add hotkeys

I would like to have a hotkey to archive links on the current note.

Maybe this is already possible within Obsidian settings, but I couldn't find it.

PS: thanks for this plugin, I was about to develop the same thing :)

Feature Request: Run on whole Vault!

I'd like to run this on my whole vault. Alternatively I suppose I could look for all the HTTP links and then put those in a note and run it but I though't i'd ask about feasability here!

Incorrect parsing of URLs with brackets (Wikipedia links)

It didn't quite get this Wikipedia URL right. It's just a URL in the markdown, not formatted as a []() external link. The markdown was like this:
[^1]: Erica (plant) - Wikipedia. Available at: https://en.wikipedia.org/wiki/Erica_(plant) (Accessed: 28 April 2022).
After archiving it ended up like this:
[^1]: Erica (plant) - Wikipedia. Available at: https://en.wikipedia.org/wiki/Erica_ [(Archived)](https://web.archive.org/web/20220428/https://en.wikipedia.org/wiki/Erica_)(plant) (Accessed: 28 April 2022).
The bit of the title in brackets at the end (common in Wikipedia URLs for disambiguation) confused it a bit!

Feature Request: Link Ignore List

Problem

Youtube and some other sides aren't archived correctly. In one of my documents I have about 24 links to youtube and I need to manually remove all these archived links (because none of them are useful)

Solution

It would be nice to have an option in plugin settings with an list of links that are ignored and not archived.

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.