Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yannickperrenet/bookmarkdown
✅ Parse your browser's exported HTML bookmark file to Markdown.
https://github.com/yannickperrenet/bookmarkdown
brave brave-browser html-parser html-to-markdown html-to-md markdown
Last synced: 2 months ago
JSON representation
✅ Parse your browser's exported HTML bookmark file to Markdown.
- Host: GitHub
- URL: https://github.com/yannickperrenet/bookmarkdown
- Owner: yannickperrenet
- License: mit
- Created: 2021-09-06T18:30:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-08T18:44:20.000Z (over 3 years ago)
- Last Synced: 2024-10-08T09:58:45.047Z (4 months ago)
- Topics: brave, brave-browser, html-parser, html-to-markdown, html-to-md, markdown
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 17
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - yannickperrenet/bookmarkdown - ✅ Parse your browser's exported HTML bookmark file to Markdown. (Python)
README
# bookmarkdown
Parse your browser's exported HTML bookmark file to Markdown.
Supported browsers: Brave.
## Installation
```bash
pip install bookmarkdown
```## Usage
### CLI
```bash
# Convert "bookmarks.html" to markdown and output to STDOUT
btm bookmarks.html# Convert "bookmarks.html" to markdown and write to "bookmarks.md"
btm --output=bookmarks.md bookmarks.html# Alternatively
btm bookmarks.html > bookmarks.md
```### Python
The `BookmarkHTMLParser` is an instance of the Python standard library's
[`HTMLParser`](https://docs.python.org/3/library/html.parser.html) and thus supports all its
methods.```python
from bookmarkdown import btmparser = btm.BookmarkHTMLParser()
parser.feed(html_content)# Access the data
parser.data
```## FAQ
### Concerns
* Minimal dependencies. `bookmarkdown` is likely to be installed on the system level Python to make
use of the `btm` script.
* Correctness. No one likes to lose a bookmark nor a different ordering.### Future ideas
> The current application solves my needs pretty well, but there are additional applications I can
> think of. Such as merging multiple bookmark files.Add functionality to the CLI and Python codebase to support the following:
```bash
# Merge bookmark html-file into existing markdown file.
btm --merge=[md-file] [html-file]btm [html-file] # already implemented
# Read the `-r` as "reverse", i.e. instead of bookmark to markdown it
# becomes markdown to bookmark.
btm -r [md-file]btm -r --merge=[md-file] [html-file]
```### Project structure
The project structure was automatically set up using `cookiecutter` and my Python template:
[cutter-py](https://github.com/yannickperrenet/cutter-py).