Giter Club home page Giter Club logo

vuepress-plugin-auto-sidebar's Introduction

Hi there 👋

shanyuhai123's GitHub stats

vuepress-plugin-auto-sidebar's People

Contributors

bruceyuj avatar dependabot[bot] avatar realduang avatar shanyuhai123 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

vuepress-plugin-auto-sidebar's Issues

在vuepress2.x中没法使用吗?

在vuepress2.x版本中,安装了插件
执行
vuepress nav docs
没有任何报错,也不会生成文件。
直接就执行结束了。
版本:
"vuepress": "^2.0.0-beta.19",
"vuepress-plugin-auto-sidebar": "^2.3.0"

侧边栏

侧边栏 可以忽略整个文件夹吗?

collapse不会折叠三级标题

plugins: {
    "vuepress-plugin-auto-sidebar": {
      sidebarDepth: 2,
      collapse: {
        open: true
      }
    },
  },

1692684397247
我是一个二级标题然后下面接一个三级标题,这个是只会折叠整个md文件嘛

运行 npm run dev 报错

开发者, 您好

使用您的插件在执行npm run dev时,有以下提示, 且无法看到侧边栏, 主题未使用默认主题, 而是使用 reco .

TypeError: Cannot read property 'split' of undefined
    at getMenuPath (/home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/lib/utils.js:2:46)
    at /home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/index.js:18:19     at Array.map (<anonymous>)
    at ready (/home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/index.js:16:30)
    at AsyncOption.asyncApply (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/plugin-api/abstract/AsyncOption.js:33:21)
    at async PluginAPI.applyAsyncOption (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/plugin-api/index.js:277:5)
    at async App.process (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/App.js:123:5)      at async dev (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/index.js:17:3)

另文件结果如下

docs
├── .vuepress
│   ├── public
│   │   └── *.png
│   ├── config.js
├── netcdf-python
│   ├── netCDF4-python.md
│   └── README.md
└── README.md

感谢

build error: No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"

env:

    "vuepress": "^1.9.7",
    "vuepress-plugin-auto-sidebar": "^2.3.2"

files under dir ./docs/

README.md
│
└─implementation
    │  README.md
    │
    ├─Module.Common
    │  │  README.md
    │  │  words敏感词.md
    │  │
    │  └─CommentAdmin
    │          README.md
    │
    └─Theme.TheAdmin
        │  ArticleService.md
        │  index.md
        │
        └─ArticleAdmin
                edit.md
                index.md
D:\A\Scoop\apps\nodejs\current\node.exe D:\A\Scoop\apps\nodejs\current\node_modules\npm\bin\npm-cli.js run docs:build 

> docs:build
> vuepress build docs


√ Server
  Compiled successfully in 42.93s


√ Client
  Compiled successfully in 51.16s

√ Server
  Compiled successfully in 42.93s

Language does not exist: c#
wait Rendering static HTML...
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"

found in

---> <SidebarLinks>
       <DropdownTransition>
         <SidebarGroup>
           <SidebarLinks>
             <Sidebar>
               <Layout>
                 <GlobalLayout>
                   <Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"

found in

---> <SidebarLinks>
       <DropdownTransition>
         <SidebarGroup>
           <SidebarLinks>
             <Sidebar>
               <Layout>
                 <GlobalLayout>
                   <Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"

found in

---> <SidebarLinks>
       <DropdownTransition>
         <SidebarGroup>
           <SidebarLinks>
             <Sidebar>
               <Layout>
                 <GlobalLayout>
                   <Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"

found in

---> <SidebarLinks>
       <DropdownTransition>
         <SidebarGroup>
           <SidebarLinks>
             <Sidebar>
               <Layout>
                 <GlobalLayout>
                   <Root>
error Error rendering /implementation/Theme.TheAdmin/: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleAdmin/edit.html: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleAdmin/: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleService.html: false
undefined
TypeError: Cannot read properties of undefined (reading 'match')
    at getHash (node_modules/@vuepress/theme-default/util/index.js:13:21)
    at isActive (node_modules/@vuepress/theme-default/util/index.js:47:19)
    at render (node_modules/@vuepress/theme-default/components/SidebarLink.vue:25:0)
    at renderWithStyleInjection (node_modules/vue-loader/lib/runtime/componentNormalizer.js:83:0)
    at createFunctionalComponent (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3071:30)
    at createComponent (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3244:12)
    at _createElement (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3436:15)
    at createElement (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3368:10)
    at vm._c (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3505:42)
    at 1.server-bundle.js:1054:492
    at Proxy.renderList (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:2640:16)
    at Proxy.SidebarLinksvue_type_template_id_1da4684a_render (node_modules/@vuepress/theme-default/components/SidebarLinks.vue?5fd7:1:152)
    at VueComponent.Vue._render (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3559:22)
    at resolve (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8444:27)
    at waitForServerPrefetch (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8316:3)
    at renderComponentInner (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8455:3)




中文目录情况下报错

具体情形是 modetitlecase 情形下出错:

module.exports = {
  plugins: {
    "vuepress-plugin-auto-sidebar": {
      title: {
        // 报错
        mode: "titlecase"
      }
    }
  }
}

侧面栏空分组隐藏

尝试使用 removeEmptyGroup: true,隐藏侧边栏中空的分组,但是没有生效,请问有什么注意点吗?
配置如下:
'vuepress-plugin-auto-sidebar': {
// options
nav: true,
removeEmptyGroup: true,
collapse: {
open: true
},
title: {
mode: "titlecase",
map: {
"/200 /10 语法/": "Hello Vuepress",
"/100 /": "Hello 101",
"/100 /102/": "Hello 102"
}
}
}
无标题

建议:自动合并现有的sidebar配置

  • 希望增加这样的功能
    插件会默认生成全部没有被忽略的文件侧边栏配置,并不会覆盖掉已经自行配置的sidebar对象,生成的侧边栏对象默认合并自行配置的侧边栏对象。

  • 业务场景
    目前我需要指定某一文件夹内的全部页面统一使用自行配置侧边栏,但是其他的页面使用本插件来自动识别。不过目前本插件总是覆盖掉了自行配置的文件。

  • 使用版本
    "vuepress": "^1.9.5"

[Feature request] 自定义排序规则

配置项里能否导出一个函数接口作为传入给sort()的排序规则呢?

like:

{
  ...
  sortRules: function(a,b) {
    return a.split('/')[0].parseInt() - b.split('/')[0].parseInt()
  }
}

使用ASCII方式排序毕竟是对有自动排序需求的人来说有些鸡肋了

关于侧边栏及自动侧边栏问题?

问题1:
老铁能否参考下面这个插件做一个自动侧边栏功能吗?不然每次新建文章,都要去sidebar中添加一下!

问题2:
貌似侧边栏文件及文件夹不识别汉字,只能英文或数字,这就导致文档很多的情况下不是很方便,希望老铁能优化一下,哈哈!

侧边栏只显示一个文件夹层次结构

docs目录结构如下,但是只生成a这个目录结构,b压根不显示,不知何故?
image

最基本的配置:
module.exports = {
plugins: ['vuepress-plugin-auto-sidebar']
}

image

精确排序提示错误

我通过 autoPrevautoNext 进行了精确排序,在进行 yarn dev 时,出现了如下提示。
图片
但实际上 README.mdinstall.mdconfig.md 均存在于同一目录 guide
图片
图片
图片
图片

为什么多了一层目录

目录结构

image

代码

 plugins: {
    "vuepress-plugin-auto-sidebar": {
      nav: true
    }
  },

效果

image

demo吗 最好有demo参考。

title->map配置未生效

使用vuepress v1版本,目录结构:
├─docs
├─.vuepress
│ └─public
│ └─java
│ └─basic
├─common
└─java
├─basic
└─jvm

插件配置:
'vuepress-plugin-auto-sidebar',
{
title: {
mode: "titlecase",
map: {
"/java/basic/": "Java基础",
"/java/jvm/": "JVM"
}
}
}

菜单显示Basic,而不是显示"Java基础",是哪里配置有问题吗?

e88fa743df2f98833b445b52e0ea647

默认分组

一个文件夹内的默认的分组名称如何去除,想全部都自定义分组,不然就得改文件夹名称

左侧菜单栏能否支持通过多级目录生成分组?

---
autoGroup-1: 分组名称
# autoGroup+10: 分组名称
---

通过在文件中添加分组标签虽然也可以达到分组的效果,但是太多文件被放在同一个文件夹下,查找起来很麻烦,能否通过,将文件在不同的文件夹下,通过文件夹的名称作为组名,自动生成分组的效果。
目前的情况是,如果guide下还有文件夹就不能作为左侧菜单显示,例如:

-guide
- +--linux
       +-- linux.md

这样linux就无法被生成左侧的菜单。

新增文件或修改 title 没有进行热更新

在 vuepress(version 1.7.1) 时虽然修复了文件内容更新,但其 update 生命周期更新依然存在问题(更新一次后失效),所以插件也尚未提供该功能。
当前还需要你手动重新运行,还是期待后续的 vitepress 吧 😺 。

能否根据侧边栏路径信息,生成一个可以跳转的md文件

加入文档都在docs目录里面,目录结构如下

docs/
├── README.md
├── T1
│   ├── README.md
│   └── t1.md
└── T2
    ├── README.md
    └── t2.md

想做一个全部的大纲,能否生成一个如下的md文件呢。

- [docs](/)
  - [T1](/docs/)
    - [t1](docs/t1)
  - [T2](/docs/)
    - [t2](/docs/t2)

路径文件夹里面具体的顺序按照 插件 生成侧边栏的顺序。

文档名字为中文的如何解决编码问题

如果我的MD文件是以中文命名的,需要怎么编码,VUE才不会提示
vue-router.esm.js?8c4f:16 [vue-router] Route with path "/docu/portal/Portal操作手册.html" contains unencoded characters, make sure your path is correctly encoded before passing it to the router. Use encodeURI to encode static segments of your path.
image

如何支持二级目录

使用过程如下
安装

yarn add -D vuepress-plugin-auto-sidebar

配置

// 在 .vuepress/config.js 中配置插件
// edit .vuepress/config.js file
module.exports = {
  plugins: [
    ["vuepress-plugin-auto-sidebar", {}]
  ]
}

配置完成后显示如下
image
只显示当前目录下的文件
想要的效果是可以显示出zh目录下的所有的目录和文件
image
我测zh目录结构如下

F:\code\markdown\project\jfinal-doc\docs\zh>go-tree
.
├── 1 快速上手
│   ├── 1.0 快速上手.md
│   ├── 1.1 Maven 基础.md
│   ├── 1.10 JBolt 插件下开发.md
│   ├── 1.11 特别声明.md
│   ├── 1.2 jfinal-undertow 下开发.md
│   ├── 1.3 jfinal-undertow 下部署.md
│   ├── 1.4 jfinal-undertow 高级用法.md
│   ├── 1.5 jfinal-undertow 常见问题.md
│   ├── 1.6 jetty-server 下开发.md
│   ├── 1.7 tomcat 下部署.md
│   ├── 1.8 非 maven 方式开发.md
│   ├── 1.9 IDEA下开发.md
├── 10 Validator
│   ├── 10.1 概述.md
│   ├── 10.2 Validator.md
│   ├── 10.3 Validator配置.md
├── 11 国际化
│   ├── 11.1 概述.md
│   ├── 11.2 I18n与Res.md
│   ├── 11.3 I18nInterceptor.md
├── 12 Json 转换
│   ├── 12.1 概述.md
│   ├── 12.2 Json 配置.md
│   ├── 12.3 Json 的四个实现.md
│   ├── 12.4 Json 转换用法.md
├── 13 JFinal架构及扩展
│   ├── 13.1 概述.md
│   ├── 13.2 架构.md
├── 14 升级JFinal
│   ├── 14.1 极速升级.md
│   ├── 14.2 Ret.md
│   ├── 14.3 configEngine.md
│   ├── 14.4 baseViewPath.md
│   ├── 14.5 RenderFactory.md
│   ├── 14.6 其它.md
├── 2 JFinalConfig
│   ├── 2.1 概述.md
│   ├── 2.2 configConstant.md
│   ├── 2.3 configRoute.md
│   ├── 2.4 configEngine.md
│   ├── 2.5 configPlugin.md
│   ├── 2.6 configInterceptor.md
│   ├── 2.7 configHandler.md
│   ├── 2.8 onStart and onStop 回调配置.md
│   ├── 2.9 PropKit 读取配置.md
├── 3 Controller
│   ├── 3.1 概述.md
│   ├── 3.10 session 操作.md
│   ├── 3.11 getFile 文件上传.md
│   ├── 3.12 keep 系方法.md
│   ├── 3.2 Action.md
│   ├── 3.3 Action 参数注入.md
│   ├── 3.4 get & getPara 系列方法.md
│   ├── 3.5 getBean & getModel 系列.md
│   ├── 3.6 set & setAttr 方法.md
│   ├── 3.7 render 方法.md
│   ├── 3.8 renderFile 文件下载.md
│   ├── 3.9 renderQrCode 二维码生成.md
├── 4 AOP
│   ├── 4.1 概述.md
│   ├── 4.2 Interceptor.md
│   ├── 4.3 Before.md
│   ├── 4.4 Clear.md
│   ├── 4.5 Inject 依赖注入.md
│   ├── 4.6 Aop 工具.md
│   ├── 4.7 Routes 级别拦截器.md
│   ├── 4.8 Proxy 动态代理.md
├── 5 ActiveRecord
│   ├── 5.1 概述.md
│   ├── 5.10 表关联操作.md
│   ├── 5.11 复合主键.md
│   ├── 5.12 Oracle支持.md
│   ├── 5.13 Enjoy SQL 模板.md
│   ├── 5.14 多数据源支持.md
│   ├── 5.15 独立使用 ActiveRecord.md
│   ├── 5.16 调用存储过程.md
│   ├── 5.2 ActiveRecordPlugin.md
│   ├── 5.3 Model.md
│   ├── 5.4 生成器与 JavaBean.md
│   ├── 5.5 独创Db Record模式.md
│   ├── 5.6 paginate 分页.md
│   ├── 5.7 数据库事务处理.md
│   ├── 5.8 Cache 缓存.md
│   ├── 5.9 Dialect多数据库支持.md
├── 6 Enjoy 模板引擎
│   ├── 6.1 概述.md
│   ├── 6.10 Spring boot 整合.md
│   ├── 6.11 独立使用 Enjoy.md
│   ├── 6.2 引擎配置.md
│   ├── 6.3 表达式.md
│   ├── 6.4 指令.md
│   ├── 6.5 注释.md
│   ├── 6.6 原样输出.md
│   ├── 6.7 Shared Method 扩展.md
│   ├── 6.8 Shared Object扩展.md
│   ├── 6.9 Extension Method扩展.md
│   ├── images
├── 7 EhCachePlugin
│   ├── 7.1 概述.md
│   ├── 7.2 EhCachePlugin.md
│   ├── 7.3 CacheInterceptor.md
│   ├── 7.4 EvictInterceptor.md
│   ├── 7.5 CacheKit.md
│   ├── 7.6 ehcache.xml简介.md
├── 8 RedisPlugin
│   ├── 8.1 概述.md
│   ├── 8.2 RedisPlugin.md
│   ├── 8.3 Redis与Cache.md
│   ├── 8.4 非web环境使用RedisPlugin.md
├── 9 Cron4jPlugin
│   ├── 9.1 概述.md
│   ├── 9.2 Cron4jPlugin.md
│   ├── 9.3 使用外部配置文件.md
│   ├── 9.4 高级用法.md

侧边栏多个一级菜单显示无效额?

我想要的效果如下
4HBA0WRX$E I@F4CNV(RM

但是我是通过设置 2级标题 实现的,一级标题加上没有用诶。。。
image

想看你的源码改。。。结果原谅我、、、我没看不懂、、、

按习惯。。应该是一级标题 (一个#号)的才是正常的吧。。。不晓得为啥加不上去哦

有问题的示例:
文档:
image

效果:

image

快来拯救下小老弟我把。。。

Sidebar not being generated

Hey!
First of all, thanks for the plugin.
I seem to have an issue understanding how to use the plugin, because I haven't managed to implement it correctly:
Here is my config:

// 
module.exports = {
  plugins: [
    'vuepress-plugin-auto-sidebar',
    {
      titleMap: {
        'core-concepts': 'Core Concepts',
        presentation: 'Presentation'
      },
    },
  ],
};

here is my project structure:
image

and this is the console log with these error messages:

> vuepress dev docs

warning an anonymous plugin or theme was detected and ignored
warning an anonymous plugin or theme was detected and ignored
info Initializing VuePress and preparing data...

  vite v2.9.14 dev server running at:

This is the what's rendered:
image

Do you have an idea of what might be missing?
Thanks in advance,
Fares

配置插件但是无法生效

docs目录下有个a文件夹
a文件夹下有A.md B.md README.md
启动项目 只能到README.md中 侧边栏没有目录 但是访问可以访问到A.md B.md
我是哪里做错了什么么?

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.