Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 1.53 KB

README.md

File metadata and controls

56 lines (35 loc) · 1.53 KB

Obsidian docs to json for Carl-bot

This repo contains a python script that will transform some of the Obsidian docs into json files. The content is either limited to the first 10 lines of each file or all the headings, if any, which are linked to the published help vault. This script is for use with Carl-bot tags.

Installation

  1. Clone this repo.
git clone https://github.com/obsidian-community/obsidian-jsons
  1. cd into the cloned folder and run
git clone [email protected]:obsidianmd/obsidian-docs.git

if you want to use SSH or

git clone https://github.com/obsidianmd/obsidian-docs.git

if you want to use HTTPS.

Usage

If you want to create the json files:

python3 make_jsons.py <api_dev_key> <api_user_key>

All files will be uploaded, the old files will be deleted on Pastebin.

The tagscript file is updated every time, so is the paste_ids.py file.

The paste api_paste_private key is set to 1, so pastes are unlisted. Keep in mind the limit of 10 unlisted pastes for free accounts. Set it to 0 to upload public pastes.

Testing

For testing, I have left in the counter variable. You need to uncomment it in three places if you want to limit uploads:

#counter : int = 0

for dirpath, dirnames, files in os.walk("./obsidian-docs/en/"):
    for file_name in files:
        if file_name.endswith(".md"):
            normalised_path = os.path.normpath(dirpath + "/" + file_name)
            if file_name in included_files:# and counter < 3:
                #counter += 1