Giter Site home page Giter Site logo

notion-md's Introduction

notion-md

中文说明

convert notion pages into markdowns (and download images).

markdown is hugo compatible.

install

go install github.com/xujiahua/notion-md

usage

$ notion-md -h
convert notion pages into markdowns

Usage:
  notion-md [flags]

Flags:
      --config string   config file (default is $HOME/.notion-md.yaml)
  -h, --help            help for notion-md
  -i, --id string       id of root page which contains subpages
  -v, --listview        use listview hold blogs, contain category, tags
  -o, --output string   output directory of markdowns and images (default "./output")
  -p, --prefix string   hugo markdown image prefix (relative path to image folder)
  -t, --token string    notion token

example

notion-md -i 8ae7005e8b154431940ab03c0a2ef08a -t ${TOKEN}

example listview

notion-md -i cab2ea6d530341769e5dc9a269a1097e -t ${TOKEN} -o /Users/jiahua/hugo-blogger/content/posts -p ../../images/ -v

credit:

https://github.com/kjk/notionapi

notion-md's People

Contributors

xujiahua avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

notion-md's Issues

How to get the ID of the root page?

Hi @XUJiahua ,
Thanks for you wonderful code.
I have read your blog on how to import markdown from notion to Hugo. However, I cannot figure out how to access the ID of the root page, like cab2ea6d530341769e5dc9a269a1097e in your example.

notion-md -i cab2ea6d530341769e5dc9a269a1097e -t ${TOKEN} -o /Users/jiahua/hugo-blogger/content/posts -p ../../images/ -v

Could you share with us more about the ID? Thanks in advance. 🤝

运行时出现panic

hi,notion-md -i pageid -t token -o xxx,运行时panic:

panic: condition failed

goroutine 1 [running]:
github.com/kjk/notionapi.panicIf(0x1448b01, 0x0, 0x0, 0x0)
        /Users/zhangjie/go/pkg/mod/github.com/kjk/[email protected]/page.go:151 +0x1a5
github.com/kjk/notionapi.(*Page).GetSubPages(0xc0000d0600, 0x7ffeefbff4cd, 0x20, 0xc0000d0600)
        /Users/zhangjie/go/pkg/mod/github.com/kjk/[email protected]/page.go:211 +0xc8
github.com/xujiahua/notion-md/pkg/notion.Manager.Do(0xc00009bc80, 0x7ffeefbff591, 0x6, 0x7ffeefbff591, 0x6, 0x7ffeefbff4cd, 0x20, 0x0, 0x0, 0xc00009bcb0, ...)
        /Users/zhangjie/notion-md/pkg/notion/notion.go:57 +0x7f0
github.com/xujiahua/notion-md/cmd.glob..func1(0x17929a0, 0xc0000be660, 0x0, 0x6)
        /Users/zhangjie/notion-md/cmd/root.go:40 +0xfc
github.com/spf13/cobra.(*Command).execute(0x17929a0, 0xc0000c0010, 0x6, 0x6, 0x17929a0, 0xc0000c0010)
        /Users/zhangjie/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x17929a0, 0x10014b0, 0x0, 0x0)
        /Users/zhangjie/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/zhangjie/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/xujiahua/notion-md/cmd.Execute()
        /Users/zhangjie/notion-md/cmd/root.go:47 +0x2d
main.main()
        /Users/zhangjie/notion-md/main.go:27 +0x25

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.