Module bookmarks

Simple sqlite3 bookmarks

This module provides a Lua API for accessing and modifying bookmarks, but does not provide a user interface. In order to add/remove bookmarks and view all bookmarks in a single page, you'll need the bookmarks_chrome module.

Functions

bookmarks.init ()

Connect to and initialize the bookmarks database.

bookmarks.get (id)

Get a bookmark entry by its ID number.

Parameters

  • id
    Type: number
    The ID of the bookmark entry to get.

Return Values

  • table
    The bookmark entry.

bookmarks.remove (id)

Remove a bookmark entry by its ID number.

Parameters

  • id
    Type: number
    The ID of the bookmark entry to remove.

bookmarks.tag (id, new_tags, replace)

Update the tags on a bookmark entry.

Parameters

  • id
    Type: number
    The ID of the bookmark entry to update.
  • new_tags
    Type: table or string
    The tags to add to the bookmark entry.
  • replace
    Type: boolean
    true if the new tags should replace all existing tags.

bookmarks.untag (id, name)

Remove a tag from a bookmark entry.

Parameters

  • id
    Type: number
    The ID of the bookmark entry to update.
  • name
    Type: string
    The tag to remove from the bookmark entry.

bookmarks.add (uri, opts)

Add a new bookmark entry.

Parameters

  • uri
    Type: string
    The URI to bookmark.
  • opts
    Type: table
    A table of options.

Return Values

  • number
    The ID of the new bookmark entry.

Properties

bookmarks.db_path

Type: any type
Read-write
Path to bookmarks database.

Attribution

Copyright