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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: o2h-2.0.3.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for o2h-2.0.3.tar.gz
Algorithm Hash digest
SHA256 e5b5d0862f0b9282b3a1bbeb0d5f6ca0b16492df829efb56570706ba19796829
MD5 cae3fb34df6b13b43a2cf424c4fdd50b
BLAKE2b-256 370cb558bcf829387cd9456ffe93b8f018ee3a30d41b37734159a5afaef75ab5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: o2h-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for o2h-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 61df366a1279b6da5d11baead4fc2a73118287c34eb50dd521f0a21f6b80a4db
MD5 960c851a4d5d98f88d7a9e281dbcd9c1
BLAKE2b-256 42dc1f1f8390f7da3189c12fb28a68a97a19b45a72e380000f410ba465e0918a

See more details on using hashes here.

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