Skip to content

Instantly share code, notes, and snippets.

View Xheldon's full-sized avatar
🎯
Focusing

Xheldon Xheldon

🎯
Focusing
View GitHub Profile
@Xheldon
Xheldon / IPTV.m3u
Last active March 24, 2024 15:14
自用联通 IPTV 单播地址
#EXTM3U x-tvg-url="http://epg.51zmt.top:8000/e.xml.gz"
#EXTINF:-1 tvg-name="北京卫视",BRTV北京卫视[高清]
http://192.168.5.2:4022/rtp/239.3.1.241:8000
#EXTINF:-1 tvg-name="BTV新闻",BRTV新闻[高清]
http://192.168.5.2:4022/rtp/239.3.1.159:8000
#EXTINF:-1 tvg-name="BTV影视",BRTV影视[高清]
http://192.168.5.2:4022/rtp/239.3.1.158:8000
#EXTINF:-1 tvg-name="BTV文艺",BRTV文艺[高清]
http://192.168.5.2:4022/rtp/239.3.1.242:8000
#EXTINF:-1 tvg-name="BTV财经",BRTV财经[高清]
@Xheldon
Xheldon / Craft2Notion
Last active September 27, 2023 12:43
A way to export Markdown files with images from Craft and import them into Notion while also uploading the images to Notion's own AWS S3 service (instead of using image links). Recursively call pandoc command to convert from markdown with pictures to docx.
const fs = require('fs');
const path = require('path');
const exec = require('child_process').execSync;
/**
* I use this script to transfer notes from Craft to Notion. The process involves the following considerations:
* 1. Craft can export Markdown and place images in a folder at the same level as the Markdown file, with the extension .assets.
* 2. Notion only uploads images to its own AWS S3 server when importing Word (.docx format) files, while other formats only include a link to the image.
* 3. Therefore, I need to convert the Markdown files exported from Craft to docx files before importing them into Notion.
* 4. Notion only supports files at the same level, not nested directories, when importing Word files, so I convert the nested notes exported from Craft to Word format and place them all in a specified directory (absolute path).
/**
Craft's markdown api has the following problems.
1. Nested lists are not supported.
2. The order of Nested blockquote and is incorrectly.
3. only the latter will be recognized as a reference block.
4. urlBlock (may called 'bookmark'?) will be recognized as a link(in this function, you can custom render tag of jekyll, you can modify this as you wish)
Note:
1. not support toggle/formula, because markdown not support those too, but you can make it.
2. I use this function for may jekyll blog workflow, you can modify it to fit your workflow.
3. caption(#####) is used for image caption if it is right next to the image(in my case, it not render as `###### xxx`).