2020-10-13 21:30:46 +02:00
|
|
|
# url2markdown
|
2020-10-12 14:23:23 +02:00
|
|
|
|
2020-10-13 23:20:27 +02:00
|
|
|
!!!url2markdown is still under development and not suited for production yet!!!
|
|
|
|
|
2020-10-12 14:23:23 +02:00
|
|
|
url2markdown lets you download an URL and save it as a Markdown file.
|
|
|
|
Additionally you can provide a list of tags which will get added to the top of
|
|
|
|
the file. The main idea behind the script is to download articles and feed them
|
|
|
|
to an Obsidia.md vault already extended with internal Obsidian links.
|
|
|
|
|
|
|
|
```
|
|
|
|
url2markdown https://docs.python.org/3/howto/argparse.html --tags=Python,CLI
|
|
|
|
```
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- Provide an URL on the command line.
|
|
|
|
- Provide a text file with a list of URLs and tags.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2020-10-13 23:20:27 +02:00
|
|
|
Install url2markdown by cloning the repository and inside it run:
|
2020-10-13 21:30:46 +02:00
|
|
|
|
|
|
|
```bash
|
2020-10-13 23:20:27 +02:00
|
|
|
make init
|
2020-10-13 21:30:46 +02:00
|
|
|
```
|
|
|
|
|
2020-10-13 23:22:00 +02:00
|
|
|
However url2markdown relies on newspaper to function. Please refer to its
|
|
|
|
documentation to install otherwise url2markdown will not work properly
|
|
|
|
(actually not a all):
|
|
|
|
https://newspaper.readthedocs.io/en/latest/
|
|
|
|
|
2020-10-13 22:15:06 +02:00
|
|
|
## Usage
|
|
|
|
|
2020-10-13 23:20:27 +02:00
|
|
|
Currently you have to navigate into the repository and run `python3 url2markdown` in order to run the programm.
|
|
|
|
|
2020-10-13 22:15:06 +02:00
|
|
|
```bash
|
|
|
|
usage: url2markdown [-h] (--file FILE | --url URL) [--topics TOPICS]
|
|
|
|
|
|
|
|
optional arguments:
|
|
|
|
-h, --help show this help message and exit
|
|
|
|
--file FILE A file containing one URL per line.
|
|
|
|
--url URL The URL of the article to convert to Markdown.
|
|
|
|
--topics TOPICS A list of comma separated topics e.g. 'foo,bar'.
|
|
|
|
```
|
|
|
|
|
|
|
|
You can either provide the URL to an article or a file containing multiple
|
|
|
|
URLs. Make sure that you only have one URL per line. On the command line you
|
|
|
|
can optionally provide topics to which the Markdown version of the article
|
|
|
|
should get linked to.
|
|
|
|
|
|
|
|
```bash
|
2020-10-13 23:20:27 +02:00
|
|
|
python3 url2markdown --url https://docs.python.org/3/library/argparse.html --topics Python,command line
|
2020-10-13 22:15:06 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
If you provide a file add the topics right behind the
|
|
|
|
URL separated by a space:
|
|
|
|
|
|
|
|
```
|
|
|
|
https://docs.python.org/3/library/argparse.html Python,command line,argparse
|
|
|
|
https://docs.pytest.org/en/latest/parametrize.html Python,pytest,argparse
|
|
|
|
```
|
|
|
|
|
2020-10-12 14:23:23 +02:00
|
|
|
## Contribute
|
|
|
|
|
|
|
|
- Issue Tracker: github.com/Nebucatnetzer/url2markdown/issues
|
|
|
|
- Source Code: github.com/Nebucatnetzer/url2markdown
|
|
|
|
|
2020-10-13 21:30:46 +02:00
|
|
|
### Development
|
|
|
|
|
|
|
|
If you want to start developing run the following two commands to make sure
|
|
|
|
your'e ready to go:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
make init
|
|
|
|
make test
|
|
|
|
```
|
|
|
|
|
2020-10-12 14:23:23 +02:00
|
|
|
## Support
|
|
|
|
|
|
|
|
You can open an issue at the Github repository however I don't garantee any
|
|
|
|
support whatsever since this is a fully personal project more seen as an
|
|
|
|
excersice.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
The project is licensed under the GPLv3 license.
|