Skip to main content

# Install

```
pip install bookmd
```

# Usage

```
Usage: bookmd [OPTIONS] COMMAND [ARGS]...

Options:
--help Show this message and exit.

Commands:
init
query
template
transform
```

## `init`

initialize directory structure.

```
$ mkdir /some/directory
$ cd /some/directory
$ bookmd init
$ ls -al
total 0
drwxr-xr-x 4 haoxun staff 136 Dec 8 21:58 .
drwxr-xr-x 24 haoxun staff 816 Dec 8 21:56 ..
drwxr-xr-x 3 haoxun staff 102 Dec 8 20:35 .bookmd-db
drwxr-xr-x 3 haoxun staff 102 Dec 8 17:50 isbn
```

## `query`

drop one or more ISBN files to the `./isbn`, then run

```
$ bookmd query
```

this command would query douban api for book infos and cache the result to
`./.bookmd-db`.

## `template`

generate markdown template.


```
$ bookmd template list ./template.md
$ bookmd template list --keys='title,rating[average]' ./template.md
$ bookmd template table ./template.md
$ bookmd template table --keys='title,rating[average]' ./template.md
```

example of `list`:

```
* <!-- 算法设计与分析基础 --> {{ isbn="9787302311850" template="[{title}]({alt})" }}
* <!-- 金领简历 --> {{ isbn="9787115279262" template="[{title}]({alt})" }}
* <!-- R语言编程艺术 --> {{ isbn="9787111423140" template="[{title}]({alt})" }}
* <!-- 计算广告 --> {{ isbn="9787115392497" template="[{title}]({alt})" }}
* <!-- Word Power Made Easy --> {{ isbn="9781101873854" template="[{title}]({alt})" }}
```

example of `table`:

```
| title | author | rating |
| --- | --- | --- |
{{ isbn="9787302311850" template="| <!-- 算法设计与分析基础 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787115279262" template="| <!-- 金领简历 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787111423140" template="| <!-- R语言编程艺术 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9787115392497" template="| <!-- 计算广告 --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
{{ isbn="9781101873854" template="| <!-- Word Power Made Easy --> [{title}]({alt}) | {author[0]} | {rating[average]} |" }}
```

## `transform`

render templates.

```
$ bookmd transform ./template.md ./doc.md
```

example of generaeted:

```
* <!-- 算法设计与分析基础 --> [算法设计与分析基础](https://book.douban.com/subject/24708288/)
* <!-- 金领简历 --> [金领简历](https://book.douban.com/subject/10779571/)
* <!-- R语言编程艺术 --> [R语言编程艺术](https://book.douban.com/subject/24699632/)
* <!-- 计算广告 --> [计算广告](https://book.douban.com/subject/26596778/)
* <!-- Word Power Made Easy --> [Word Power Made Easy](https://book.douban.com/subject/25977798/)
```

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bookmd-0.1.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bookmd-0.1.1-py2.py3-none-any.whl (9.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file bookmd-0.1.1.tar.gz.

File metadata

  • Download URL: bookmd-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bookmd-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2aef032c46b0a7b82fe191561ae0b11f95527bdea0843fe85fcf4aa5549afdc0
MD5 b81b830a7acbb2f884ffc15e5f30c6ca
BLAKE2b-256 46219598cf52924e366db977d390c938bdd44ebc5ebbf07956efd3b0f777020b

See more details on using hashes here.

File details

Details for the file bookmd-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bookmd-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c26afd6a5d5720371189955c30ccba336320e843b057159eea66e2a5362a1daa
MD5 9232dcd5f8ae9299f62aa4d8384d2bfc
BLAKE2b-256 529a555645f7e0b4b7e40b11fe7d4d6af0daf31c7677416be524b737211d6541

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page