Skip to main content

H2O2H

This repository is used to help Obsidian publish more conveniently.

Installing

pip install o2h

Getting Started

After o2h package is installed, the cli command obs2hexo is available. The help info is listed here.

obs2hexo -h

usage: obs2hexo [-h] [-o OUTPUT] [-c CATEGORY] [-p | --picgo | --no-picgo] filename

positional arguments:
  filename              get the obs markdown filename

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        get output dir
  -c CATEGORY, --category CATEGORY
                        get category
  -p, --picgo, --no-picgo
                        use picgo

As the Github repository space is limited, so it is not recommanded to upload all the pictures to the repository. So I provide an alternative option -p to upload pictures with picgo.

The default output directory is /tmp/o2houtput.

Configuration

o2h cannot find the position of Obsidian Vault automatically, so it relies on the configuration file. A configuration file should be created in $HOME/.config/o2h/config.json

Here is an example of my config file:

{
    "obsidian_target": [
        "$HOME/Documents/Work/Notes"
    ]
}

If there are multiple Obsidian Vault in you system, you can add them like this:

{
  "obsidian_target": [
    "path_1",
    "path_2",
    ...,
    "path_n"
  ]
}

Example

Here are some examples:

# translate a.md to standard markdown
# the category is "Skill"
# all the picture are copied to a new folder named 'a' in current directory
obs2hexo -o $PWD -c Skill a.md
# translate b.md to /tmp/o2houtput, all the picture are uploaded by picgo
obs2hexo -c Develop -p b.md

Metadata

Release files for o2h 2.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for o2h 2.1.1
File Size Uploaded
o2h-2.1.1.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for o2h 2.1.1
File Interpreter ABI Platform
o2h-2.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / o2h-2.1.1.tar.gz

Download URL o2h-2.1.1.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4fbbffd6a121e2b673f3b4b16c4440dd2706472b2f2224d0c9bc483cb9e94b7f
BLAKE2b-256 checksum
How to use checksums
95060e5a1c3812bd9c20b4f931715e95c3a0ac34c2bb752c63fdd72d906f7cb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release files / o2h-2.1.1-py3-none-any.whl

Download URL o2h-2.1.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3773fcc7362c7c69063b2ed07b9426ad96917b55f8bd8e771ec1375ebe4e9c6
BLAKE2b-256 checksum
How to use checksums
ffd3e634a67998aa4661d8fb64a069e533aba01a730d2a1d0229709c5eda7527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release history Release notifications | RSS feed

This release

2.1.1 This release

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page