Skip to content

Instantly share code, notes, and snippets.

@ebal
Created December 3, 2022 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebal/27e75fd21eead21112b4ca1ba76c2201 to your computer and use it in GitHub Desktop.
Save ebal/27e75fd21eead21112b4ca1ba76c2201 to your computer and use it in GitHub Desktop.
a simple BoostNote cson converted to MarkDown format
#!/usr/bin/env python
import os
import sys
import cson
path = sys.argv[1]
i=0
for x in os.listdir(path):
if x.endswith(".cson"):
with open(path+x, 'rb') as fin:
obj = cson.load(fin)
if ( obj['type'] == "MARKDOWN_NOTE" ):
md_file = obj['title']+".md"
md_text = obj["content"]
i += 1
print ("Converting "+ str(i) + " : " + obj['title']+".md")
f = open(md_file, "w")
f.write(md_text)
f.close()
print ("Finished")
@ebal
Copy link
Author

ebal commented Dec 3, 2022

./BoostNote-to-md.Converted.py /opt/Boostnote/notes/
Converting 1 : Archlinux Gitlab.md
Converting 2 : docker notes.md
Converting 3 : GitLab CI CD for building RPM.md
Converting 4 : Dovecot GitLab CI CD.md
...
Converting 164 : Android VPN IPSec Hybrid XAuth RSA.md
Converting 165 : Qemu KVM notes.md
Converting 166 : a simple DoH DoT using only dnsdist.md
...
Converting 516 : Using template file with terraform.md
Converting 517 : LibreDNS DnsOverTLS no ads with systemd-resolved.md
Finished

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment