Skip to main content

Publish obsidian to hexo github page

Project description

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

Project details


Download files

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

Source Distribution

o2h-2.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

o2h-2.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file o2h-2.1.1.tar.gz.

File metadata

  • Download URL: o2h-2.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for o2h-2.1.1.tar.gz
Algorithm Hash digest
SHA256 4fbbffd6a121e2b673f3b4b16c4440dd2706472b2f2224d0c9bc483cb9e94b7f
MD5 798ac95a050496adeabb1039db3ab0a2
BLAKE2b-256 95060e5a1c3812bd9c20b4f931715e95c3a0ac34c2bb752c63fdd72d906f7cb8

See more details on using hashes here.

File details

Details for the file o2h-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: o2h-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for o2h-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3773fcc7362c7c69063b2ed07b9426ad96917b55f8bd8e771ec1375ebe4e9c6
MD5 810d14eee758391d5433e57e92dbb435
BLAKE2b-256 ffd3e634a67998aa4661d8fb64a069e533aba01a730d2a1d0229709c5eda7527

See more details on using hashes here.

Supported by

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