Code Monkey home page Code Monkey logo

docsify-plugin-toc's Introduction

𝗛𝗲𝗹𝗹𝗼 𝗜'𝗺 Justin Tien (Yi-Ming Tien)

𝑰 ❤️ Full Stack 𝑫𝒆𝒗𝒆𝒍𝒐𝒑𝒎𝒆𝒏𝒕!

✍️ 𝑰 𝒍𝒐𝒗𝒆 𝒔𝒉𝒂𝒓𝒊𝒏𝒈 any 𝒕𝒆𝒄𝒉 𝒔𝒕𝒂𝒄𝒌, 𝒚𝒐𝒖 𝒄𝒂𝒏 𝒄𝒉𝒆𝒄𝒌 𝒎𝒚 https://blog.jiapan.tw/ 𝒄𝒐𝒍𝒍𝒆𝒄𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝒎𝒐𝒓𝒆 𝒅𝒆𝒕𝒂𝒊𝒍𝒔.

𝗦𝘁𝗮𝘁𝘀

justintien's github stats

docsify-plugin-toc's People

Contributors

githoniel avatar justintien 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

Watchers

 avatar  avatar

docsify-plugin-toc's Issues

The head selector needs to be improved

 document.querySelector(`#main ${window.$docsify.toc.target}`)

If config like this:

{
     tocMaxLevel: 6,
     target: 'h1, h2, h3, h4, h5, h6'
}

The selector#main h1, h2, h3, h4, h5, h6 will get h2-h5 of whole document and h1 in #main

Therefore, the following code seems more reasonable

const mainElement = document.querySelector('#main')
headings = mainElement.querySelectorAll(window.$docsify.toc.target)

ignoreHeaders doesn't work

Adding <!-- {docsify-ignore-all} --> to a header doesn't work.
Adding the name of the header to the ignoreHeaders list doesn't work.

Also your links to the files in the readme point to 1.3.1 rather than 1.3.2 (neither version honours ignoreHeaders).

Hopefully I'm just doing it wrong, would be glad to hear how to fix this.

How to modify script CSS?

In my document's <head> I am loading a stylesheet with my custom tweaks to the ToC script's CSS. However, my changes are overridden by the script's own embedded CSS as it is imported using the suggested <script src="https://unpkg.com/docsify-plugin-toc"></script> at the end of my document.

How do I override the CSS provided with the script?

行为样式问题

手机等窄屏界面下,本章目录虽然会折叠,但点击后会直接触发对应位置的条目,而非展开后再次互动

v1.3.1 published

I am sorry to inform you that

Removing css loaded from js in the latest release v1.3.1

If you are loading .js without specifying a version number like this //unpkg.com/docsify-plugin-toc

Please according to the latest version of README to adjust your code.

it will be better to support the custom TOC text color in Configure

  • Thanks for share awesome plugin.

可以考虑开发折叠选项

如下图所示,文档标题过多的时候,层级展开就太长了,如果可以设置默认折叠那就要好很多
image

关于如何解决点击TOC标题无法跳转的问题

问题:
我一开始按照正常步骤添加插件,虽然TOC标题在网页中显示了,但是点击对应的多级标题无法跳转。
解决方法如下:
查看在自己的index.html中是否有以下红框中的代码
123
这一代码是我之前遇到docsify不能正常增加滚动条而添加的
但是这一部分代码与这个TOC插件相冲突,将红框中的代码去掉即可正常跳转,并且还是有进度条的哦~

TOCs not refreshing on new versions of Firefox

When using firefox, the TOCs load properly for the first document that is being browsed, however, if documents are switched the TOCs do not update.

This issue was noticed on FF 84.0.2, however this issue was not seen on older versions of FF (tested with 78.6.1esr)

unable to add H1 headings to the TOC

I want this TOC to contain every heading including the H1.

But if I prefix target: 'h1, h2, h3... H1 headings still do not show.

Without this, the new TOC shows all the h2+ headings, but misses the h1s.

for a page with the layout

# Section A
## subA1
## subA2

# Section B
## subB1
## subB2

The toc shows as

subA1
subA2
subB1
subB2

With no indication that there is a major separator between them

h1 and h2 with same indentation?

image

code:

<script>
    window.$docsify = {
      name: '言念君子温其如玉',
      repo: 'https://github.com/fatpo',  //开启github图标
      loadSidebar: true,
      homepage: 'README.md',
      showLevel: false,
      toc: {
        tocMaxLevel: 6,
        target: 'h1, h2, h3, h4, h5, h6'
      },
      copyCode: {
	    buttonText : 'Copy to clipboard',
	    errorText  : 'Error',
	    successText: 'Copied'
	  },
	  scrollToTop: {
        auto: true,
        text: 'Top',
        right: 15,
        bottom: 15,
        offset: 300
      },
      search: {
        paths: 'auto',
        placeholder: '搜索',
        noData: '找不到结果',
        depth: 3,
      },
      count:{
        countable:true,
        fontsize:'0.9em',
        color:'rgb(90,90,90)',
        language:'chinese'
      }
    }

</script>

<script src="https://unpkg.com/[email protected]/dist/docsify-plugin-toc.min.js"></script><!

image

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.