liu0013 / static-marks

Shareable bookmarks

Home Page:https://darekkay.com/static-marks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static Marks

Travis npm license

Convert your plain bookmark files into a static web app.

  • Share your bookmarks app via a single HTML file.
  • It's free and open source.
  • Browser-independent.
  • Import bookmarks from Chrome, Firefox or Pocket.

đź”– View Live Demo

Demo

Quickstart

  • Install Static Marks:
npm install -g static-marks
  • Convert your (exported) browser bookmarks to YAML:
static-marks import browser-bookmarks.html > bookmarks.yml
  • Generate your bookmarks app:
static-marks build bookmarks.yml > bookmarks.html

Installation

  • As a globally available CLI tool:
npm install -g static-marks
  • As a local dependency in your project:
npm install --save static-marks

Usage

static-marks [options] <command>

Options:
  -V, --version               output the version number
  -h, --help                  output usage information

Commands:
  build [options] <files...>  build bookmarks app
  import [options] <file>     import bookmarks from chrome, firefox or pocket

Run static-marks <command> --help to view the usage of a specific command.

Build bookmarks app

static-marks build [options] <files...>

Options:
  -o, --output [file]     output to a file (use stdout by default)
  -t, --title [title]     set document title
  --template-file [file]  use a custom web page template

Examples:

static-marks build bookmarks.yml > bookmarks.html  # Single file
static-marks build -o bookmarks.html bookmark.yml  # Alt. notation
static-marks build f1.yml f2.yml > bookmarks.html  # Multiple files
static-marks build files/* > bookmarks.html        # All files at path

Import bookmarks

static-marks import [options] <file>

Options:
  -o, --output [file]  output to a file (use stdout by default)

Examples:

static-marks import exported.html > imported.yml

Features

  • Use custom browser search engines with a ?search=%s URL param (example).
  • Use custom web page templates. If you don't like the default UI, provide your own (example based on this template).

File format

Bookmark files are written in YAML. There are multiple levels of hierarchy:

Collection:
  - Bucket:
    - Link: https://example.com

A link URL can be expressed either as an item property or as a child item:

- Link 1: https://example.com
- Link 2:
  - https://example.com

Notes and nested links are added as children of a link (the first element is the link URL):

- Link with notes:
  - https://example.com
  - This is a text note
  - Link note: https://example.com</pre>

Here's a complete example:

Collection:
  - Bucket:
    - Link 1: https://example.com
    - Link 2:
      - https://example.com
    - Link with notes:
      - https://example.com
      - This is a text note
      - Link note: https://example.com</pre>

If multiple files are provided to static-marks, they will become selectable via a menu.

Development and Contribution

The frontend part of Static Mark is maintained in another repository, where a template file (_template.html) is being generated. This approach makes it possible to include the whole application and user-defined bookmarks in a single HTML file.

If you want to provide any frontend-related changes, please create a PR in the other repository. Changes to the core CLI application are handled here instead.

License

Copyright 2019 Darek Kay hello@darekkay.com

This project and its contents are open source under the MIT license.

About

Shareable bookmarks

https://darekkay.com/static-marks

License:MIT License


Languages

Language:HTML 94.9%Language:JavaScript 5.1%