Giter Site home page Giter Site logo

docsify-count's Introduction

docsify-count


docsify-count

jsdelivr

This is a plugin to add word count for markdown files of docsify.

这是一款为docsify提供文字统计的插件

It only counts Chinese characters and English words excludes special characters like *-、…… in markdown file.

它提供了统计中文汉字和英文单词的功能,并且排除了一些markdown语法的特殊字符例如*-

show count.english

And you can set count.language 'chinese'/'english'

show count.chinese

To use

Add JS

<script src="//unpkg.com/docsify-count/dist/countable.min.js"></script>

or

<script src="https://cdn.jsdelivr.net/npm/docsify-count@latest/dist/countable.min.js"></script>

Add settings

window.$docsify = {
  count:{
    countable: true,
    position: 'top',
    margin: '10px',
    float: 'right',
    fontsize:'0.9em',
    color:'rgb(90,90,90)',
    language:'chinese',
    localization: {
      words: "",
      minute: ""
    },
    isExpected: true
  }
}
属性名Attribute 类型Type 解释Description 可选值Value
countable boolean 设置字符统计展示与否 Set display this plugin or not true(默认值Default) / false
position string 设置展示位置 Set display position 'top'(默认值Default) / 'bottom'
margin string 设置与邻近DOM的距离 Set margin to the near DOM element '10px'
float string 设置元素对齐 Set alignment 'right'(默认值Default) / 'top'
fontsize string 设置字体大小 Set font size '0.9em'
color string 设置颜色 Set color 'rgb(90,90,90)'
language string 设置语言 Set language 'english'(默认值Default) / 'chinese'
localization Object 支持本土化 Support localization words: "", minute: ""
isExpected boolean 是否显示预计阅读时长 Display the reading time or not true(默认值Default) / false

localization的优先级高于language,如果localizationwordsminute属性值不为空,则会取代language的作用。The priority of localization is higher than language's. Thus, if the length of the value of localization's attributes(words, minutes) were not equal with 0, the function of language would be replaced.

docsify-count's People

Contributors

827652549 avatar herberthe avatar

Stargazers

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

Watchers

 avatar  avatar

docsify-count's Issues

关于”两个标题“的显示bug

简单来说,我之前是没有使用你的插件,现在添加了你的插件之后,会出现”两个标题“的问题。
当前效果如下:

XXXX文档(文件名)
xxx字|x分钟
YYYY文档(这个是我取的标题名字)

希望效果如下:
添加一个配置,选择显示文件名或者标题名字。
例如:
XXXX文档(文件名)
xxx字|x分钟
或者
YYYY文档(这个是我取的标题名字)
xxx字|x分钟

docsify md嵌套

我遇到了一个问题:我使用了这样的标签"[16日](./16日.md ':include')",让当前md文件能够嵌套另个md文件并显示,文字统计的是当前md文件的字数,这没有问题,但是我想显示每个md文件的字数
比如:
在1.md中嵌套2.md和3.md,
然后1.md中分开显示2.md的统计字数和3.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.