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.0.3.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

o2h-2.0.3-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

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