yuque-sync
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

yuque-sync

Sync articles and toc from Yuque

Usage

import syncBook from 'yuque-sync'
 
const bookId = '<your book id or namespace>'
 
const outputDir = '<your target directory>'
 
async function foo {
    await syncBook ({
        token: process.env.YUQUE_TOKEN,
        bookId,
        dir: outputDir
    })
 
    // will write markdown files and sidebar.json and _sidebar(docsify) to given dir
}
 

You can provide a custom loader, to parse markdown file contents, for example replace image links.

import syncBook from 'yuque-sync'
 
const bookId = '<your book id or namespace>'
 
const outputDir = '<your target directory>'
 
const myLoader = markdown => {
    // do something
    return markdown
}
 
async function foo {
    await syncBook ({
        token: process.env.YUQUE_TOKEN,
        bookId,
        dir: outputDir,
        loader: myLoader
    })
 
    // will write markdown files and sidebar.json and _sidebar(docsify) to given dir
}
 

Readme

Keywords

Package Sidebar

Install

npm i yuque-sync

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

38.3 kB

Total Files

13

Last publish

Collaborators

  • banyudu