HTML Autoimport
The HTML Autoimport feature allows the application to automatically detect and import bookmarks from HTML files stored in specified directories. This is particularly useful for syncing bookmarks from files generated by browsers or custom HTML bookmark exports.
Bookmarks can be exported as HTML from any browser that supports the Netscape bookmark format. For a full list of supported browsers, see the Browser Support Matrix.
Configuration
The feature is configured via the config.toml file. Add the following section to enable and customize the autoimport functionality:
[html-autoimport]
paths = ["$HOME/shares/bookmarks"]Configuration Options
paths: A list of directories to monitor for HTML bookmark files.- Supports environment variable expansion (e.g.,
$HOME). - Example:
["$HOME/.bookmarks", "/var/www/html/bookmarks"]
- Supports environment variable expansion (e.g.,
How It Works
Directory Monitoring
The application watches the specified directories for changes (file creation, modification, or deletion).HTML File Detection
When an HTML file is detected, it is parsed using a DOM parser (e.g.,goquery).Bookmark Extraction
Bookmarks are extracted from standard HTML formats. The parser looks for:<a>tags withhrefattributes<dl>tags containing bookmark lists- Metadata like
title,description, andtags
Import Process
Extracted bookmarks are imported into the application’s database, preserving their structure and metadata.
Platform Support
This feature works on all supported platforms: Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD.
On Windows bookmark paths typically use:
paths = ["$HOME\\Desktop\\Bookmarks"]Notes
- Only files with
.htmlor.htmextensions are processed. - Duplicate bookmarks (based on URL) are skipped by default.
- Ensure the monitored directories are accessible and readable by the application.