SiyuanYuque
Sync SiYuanNote & Yuque.
Install
Use pip to install.
pip install SiyuanYuque
Execute like this:
python -m SiyuanYuque
Remember to create a sqconfig.toml
config file in the current directory.
user_token = ""
siyuan_token = ""
api_host = "https://www.yuque.com/api/v2"
last_sync_time = "20210915225457"
Fill in your Yuque user_token and siyuan_token.
Set Atrribute in SiyuanNote
You can only sync documents to Yuque.
Set Attributes like this:
yuque: true
yuque-workspace: your workspace
Workspace format: username/repo
Then run python -m SiyuanYuque
, and check the attributes again.
You'll see yuque-id
appended to your document's attributes. Don't manually modify this unless you know what you are doing.
That's the basic usage for the time being.
Remember not to edit the documents sync from SiYuan, as the update will be lost upon the next sync.
Custom Sync
It is supported to sync documents by SQL.
A simple example:
user_token = ""
siyuan_token = ""
api_host = "https://www.yuque.com/api/v2"
last_sync_time = "20210916223903"
[[custom_sync]]
sql = "select * from blocks where hpath like '%Math/%' and type='d'"
yuque-workspace = "clouder0/gaokao"
Multiple custom syncs can be defined.
user_token = ""
siyuan_token = ""
api_host = "https://www.yuque.com/api/v2"
last_sync_time = "20210916223903"
[[custom_sync]]
sql = "select * from blocks where hpath like '%Math/%' and type='d'"
yuque-workspace = "clouder0/gaokao"
[[custom_sync]]
sql = "select * from blocks where hpath like '%Chinese/%' and type='d'"
yuque-workspace = "clouder0/gaokao"
More Config
yuque-public: 1 for public and 0 for private.
yuque-slug: the slug of the document. https://www.yuque.com/siyuannote/docs/siyuanyuque