Coder Social home page Coder Social logo

vuepress-plugin-yuque's Introduction

vuepress-plugin-yuque

NPM version NPM downloads

本插件需要 VuePress >= 1.0.0-alpha.37

特性

  • 简单:Zero-Markdown,只需配置你的语雀 repo 地址,就能获得一个 VuePress 站点;
  • 高效:自动生成的文档主页、侧边栏让你享受 “高效” 的文档生成体验;
  • 缓存:完美地解决语雀 Open API 调用次数超限的问题;

想了解更多,请移步:

快速上手

在 VuePress 中配置 repoUrl

// .vuepress/config.js
module.exports = {
  title: 'Ant Design 实战教程',
  description: '基于 umi 的 Ant Design 实战教程',
  plugins: [
    ['vuepress-plugin-yuque', {
      repoUrl: 'https://www.yuque.com/ant-design/course',
    }]
  ]
}

你就能获得这个Site,更多使用方法,可参见文档

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

vuepress-plugin-yuque © ULVIZ, Released under the MIT License.
Authored and maintained by ULVIZ with help from contributors (list).

github.com/ulivz · GitHub @ULVIZ · Twitter @_ulivz

vuepress-plugin-yuque's People

Contributors

dependabot[bot] avatar fychinesepjj avatar ulivz avatar zyoric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuepress-plugin-yuque's Issues

需要添加authToken才能使用

现在语雀所有的开放 API 都需要 Token 验证之后才能访问,需要添加

plugins: [
   ['vuepress-plugin-yuque', {
     authToken: 'xxx',
   }]
 ]

才能构建

一个不知名的错误

按照“快速上手”,我已经完成前面的步骤,但是执行yarn dev时,就抛出这样的错误。

Error: Cannot find module '@vuepress/shared-utils'
Require stack:

  • E:\Github\my-site\node_modules@vuepress\plugin-medium-zoom\index.js
  • E:\Github\my-site\node_modules@vuepress\core\lib\app\resolvePlugin.js
  • E:\Github\my-site\node_modules@vuepress\core\lib\app\normalizePlugin.js
  • E:\Github\my-site\node_modules@vuepress\core\lib\app\appUse.js
  • E:\Github\my-site\node_modules@vuepress\core\lib\app\index.js
  • E:\Github\my-site\node_modules@vuepress\core\lib\index.js
  • E:\Github\my-site\node_modules@vuepress\cli\lib\commands\build\build.js
  • E:\Github\my-site\node_modules@vuepress\cli\lib\commands\build\index.js
  • E:\Github\my-site\node_modules@vuepress\cli\lib\commands\index.js
  • E:\Github\my-site\node_modules@vuepress\cli\lib\index.js
  • E:\Github\my-site\node_modules@vuepress\cli\bin\vuepress.js
  • E:\Github\my-site\node_modules\vuepress\bin\vuepress.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (E:\Github\my-site\node_modules@vuepress\plugin-medium-zoom\index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    error Command failed with exit code 1.

缓存

我成功建立项目,部署在github.io上面了

但是我在语雀发的新的文章,修改目录等操作后,使用yarn dev启动服务,还是第一次启动时候的目录

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

按照教程来操作,用教程上面的 repoId 或者 repoUrl 都是报错。

yarn run v1.22.0
$ vuepress dev .
wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...
tip Apply plugin yuque (i.e. "vuepress-plugin-yuque") ...
tip Apply plugin @vuepress/medium-zoom (i.e. "@vuepress/plugin-medium-zoom") ...
✖ Please check your repoId: 214564 response: {"status":401,"message":"Unauthorized"}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

build error Cannot infer repoId from repoUrl

AssertionError [ERR_ASSERTION]: [CANNOT_FIND_GROUP] Cannot infer repoId from repoUrl: https://www.yuque.com/ant-design/course
    at Function.inferRepoByUrl (/Users/qixiaobo/work/yuque-doc/node_modules/vuepress-plugin-yuque/lib/yuque.js:110:5)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
{
  "name": "yuque-doc",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "vuepress": "^1.0.0-rc.1",
    "vuepress-plugin-yuque": "^0.6.1"
  },
  "scripts": {
   "dev": "vuepress dev .",
   "build": "vuepress build ."
 }
}

ul and li style is diffrent in yuque and vuepress

  • In yuque, the data-lake-indent class has list-style-type: circle; style but it's not in vuepress-plugin-yuque

  • the ul and li elements have diffrent style. In vuepress-plugin-yuque, it's unable to render indentation correctly

如何使用 inline code (`)?

当原md文件中包括了Map<String, String>时,导入至语雀后,再变成VuePress时报错tag has no matching end tag,修改成Map<>后才可以正常使用,想请问一下该如何按照文档中所说的添加inline code (`)来使其可以正常显示,万分感谢!

语雀数据为更新

我第一次yarn dev能跑成功拉取到数据,之后就拉不到语雀修改后的数据,一直只有第一次拉取的数据

Didn't transfer yuque article style correctly

Thanks for your excellent work , it's really a good and convenient tool !

when I tried for this plugin ,follow the documention

yarn dev

but the dev pages didn't show article style correctly
like this:

image

image

even of my new yuque repo (manually type in markdown syntax)
image

throw error since "prettify" doesn't check null

解析一篇无内容文档时报的错误

TypeError: Cannot read property 'replace' of null
    at prune (/node_modules/vuepress-plugin-yuque/lib/html.js:50:6)
    at prettify (/node_modules/vuepress-plugin-yuque/lib/html.js:39:10)
    at ready (/node_modules/vuepress-plugin-yuque/lib/index.js:129:27)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

/lib/index.js:129

        let postContent
        if (status && status === 404) {
          postContent = `# ${title}\n > 此文档尚未创建`
        } else {
          if (useMarkdown || data.format === 'markdown') {
            postContent = data.body
          } else {
            postContent = prettify(data.body_html)  // 这里 data.body_html 可能为 null
          }
        }
function prettify(html) {
  html = prune(html)
  const $ = cheerio.load(html, {
    // ref: https://github.com/cheeriojs/cheerio/issues/565
    decodeEntities: false
  })
  transformHeaders($)
  return $('body').html()
}

function prune(html) {  // 这里 html 可能传入 null
  return html
    .replace(/<p><br\s\/><\/p>/g, '')
    .replace(/<p><span><br\s\/><\/span><\/p>/g, '')
}

build出来的文件未更新

官方文档说只在dev模式下默认开启缓存模式。关联上一个新的知识库后,我先使用dev进行调试,之后在语雀上新建了文档,使用build进行打包,生成出来的与第一次运行时的目录一致,之后重新使用命令也是只生成第一次运行时相同的文档,请问这种情况要怎么解决?

代码块无法渲染

新文章的代码块渲染成了这个样子:

image

老文章没问题。

从缓存的数据看,似乎 yuque 的代码块格式发生了变化:

新的 codeblock

image

老文章的 codeblock

image

Can I use Github Issues as input?

I find there is an issue about yuque that we can't show the images rightly. Also, I noticed that you mentioned that we can use any data source in vuepress in this . Can you give me some hints about this?

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.