Small changes to make this more suitable as a command line utility

This commit is contained in:
NunoSempere 2021-06-28 16:38:06 +02:00
parent 183e550385
commit 6c35ae7909
2 changed files with 5 additions and 1 deletions

View File

@ -1,11 +1,12 @@
This package takes a markdown file, and creates a new markdown file in which each link is accompanied by an archive.org link, in the format [...](original link) ([a](archive.org link)) This package takes a markdown file, and creates a new markdown file in which each link is accompanied by an archive.org link, in the format [...](original link) ([a](archive.org link))
## How to install ## How to install
Copy [this file](https://github.com/NunoSempere/longNowForMd/blob/master/longnowformd.sh) to your .bashrc file, or, for Ubuntu distributions Focal Fossa and above: Copy [this file](https://github.com/NunoSempere/longNowForMd/blob/master/longnowformd.sh) to your .bashrc file, or, for Ubuntu distributions 20.04 (Focal Fossa) and above:
``` ```
$ sudo add-apt-repository ppa:nunosempere/longnowformd $ sudo add-apt-repository ppa:nunosempere/longnowformd
$ sudo apt-get update $ sudo apt-get update
$ sudo apt install longnowformd
``` ```
This utility requires [archivenow](https://github.com/oduwsdl/archivenow) as a dependency, which itself requires a python installation. It can be installed with This utility requires [archivenow](https://github.com/oduwsdl/archivenow) as a dependency, which itself requires a python installation. It can be installed with

View File

@ -1,3 +1,5 @@
#!/bin/bash
function getMdLinks(){ # Use: Takes a markdown file file.md, extracts all links, finds the unique ones and saves them to file.md.links function getMdLinks(){ # Use: Takes a markdown file file.md, extracts all links, finds the unique ones and saves them to file.md.links
echo "" echo ""
echo "Extracting links..." echo "Extracting links..."
@ -91,3 +93,4 @@ function longnow(){
fi fi
} }
longnow "$1" ## don't copy this line into your .bashrc file