Skip to content

Commit eb4347d

Browse files
Copilotstreed
andcommitted
Rename import command to import-url and add documentation
Co-authored-by: streed <805140+streed@users.noreply.github.com>
1 parent 181def2 commit eb4347d

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A powerful command-line note-taking application with semantic vector search capa
99
## ✨ Features
1010

1111
- 📝 **Complete Note Management** - Create, edit, delete, and organize notes with powerful CLI tools
12+
- 🌐 **Website Import** - Import web pages as notes with headless browser support and image URL preservation
1213
- 🌐 **Modern Web Interface** - Beautiful, responsive web UI with real-time markdown preview and graph visualization
1314
- 🏷️ **Smart Tagging System** - Organize notes with tags, search by tags, and manage tag collections
1415
- 🔍 **Triple Search Methods** - Semantic vector search, traditional text search, and tag-based search
@@ -455,6 +456,28 @@ ml-notes delete -f 123
455456
ml-notes delete --all
456457
```
457458

459+
#### Import Website Content
460+
```bash
461+
# Import a website as a new note
462+
ml-notes import-url https://blog.example.com/article
463+
464+
# Import with custom tags
465+
ml-notes import-url https://docs.example.com/guide --tags "docs,reference,tutorial"
466+
467+
# Import with AI auto-tagging
468+
ml-notes import-url https://example.com/post --auto-tag
469+
470+
# Import with custom timeout for slow-loading sites
471+
ml-notes import-url https://heavy-site.com --timeout 60s
472+
```
473+
474+
**Features:**
475+
- **Headless Browser**: Uses Chrome to render JavaScript and dynamic content
476+
- **Smart Content Extraction**: Prioritizes main content areas (article, main) while filtering out navigation, ads, and sidebars
477+
- **Image URL Preservation**: Converts relative image URLs to absolute URLs while maintaining external/CDN links
478+
- **Markdown Conversion**: Clean HTML-to-markdown conversion with proper formatting
479+
- **Security-First**: Uses secure browser settings with SSL validation for live websites
480+
458481
### Tag Management
459482

460483
#### Managing Tags

cmd/import.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ import (
2020
)
2121

2222
var importCmd = &cobra.Command{
23-
Use: "import <url>",
23+
Use: "import-url <url>",
2424
Short: "Import a website as a new note",
2525
Long: `Import a website by URL and create a new note with the page title and content converted to markdown.
2626
2727
This command uses a headless browser to load the webpage, waiting for dynamic content to load,
2828
then extracts the title and converts the body content to markdown format.
2929
3030
Examples:
31-
ml-notes import https://example.com
32-
ml-notes import https://blog.example.com/article --auto-tag
33-
ml-notes import https://docs.example.com --tags "docs,reference"`,
31+
ml-notes import-url https://example.com
32+
ml-notes import-url https://blog.example.com/article --auto-tag
33+
ml-notes import-url https://docs.example.com --tags "docs,reference"`,
3434
Args: cobra.ExactArgs(1),
3535
RunE: runImport,
3636
}

docs/USAGE_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ ml-notes search "first note"
285285
|---------|---------|---------|
286286
| `init` | Set up ml-notes | `ml-notes init -i` |
287287
| `add` | Create new notes | `ml-notes add -t "Title"` |
288+
| `import-url` | Import website as note | `ml-notes import-url https://example.com` |
288289
| `list` | View all notes | `ml-notes list --limit 10` |
289290
| `get` | Retrieve specific note | `ml-notes get 123` |
290291
| `edit` | Modify existing notes | `ml-notes edit 123` |

0 commit comments

Comments
 (0)