Skip to content

Script that converts selected Obsidian Help doc notes to JSON for use with Carl-bot.

License

Notifications You must be signed in to change notification settings

obsidian-community/docs-for-carl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Script that converts selected Obsidian Help doc notes to JSON for use with Carl-bot.

Resources

License

Stars

Watchers

Forks

Languages