npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ray-doc-render

v2.1.2

Published

personal doc render

Downloads

54

Readme

ray-doc-render

author

ilex.h

useage

code beauty

webpack.config.js

webpack 1.x


const codeBeauty = require('ray-doc-render/lib/beauty/codeBeauty');
// const rayDocRender = require('ray-doc-render');

{
  module: {
    ...
    loaders: [
      { test: /\.md$/, loader: 'html!ray-md-loader' }
    ]
  },
  rayMdLoader: {
    highlight: (code, lang) => codeBeauty(code, lang)
  }
}

webpack 2.x +


const mdRender = require('ray-doc-render/lib/customRender');
// const rayDocRender = require('ray-doc-render');

{
  test: /\.md$/,
  use: [{
    loader: 'html-loader'
  }, {
    loader: 'ray-md-loader',
    options: {
      pedantic: true,
      renderer: mdRender
    }
  }]
}

render

  • advancedRender

  • customRender

    • img 图片
    ![](/qr.png)
    ![alt](/qr.png)
    ![alt#200*200](/qr.png)
    ![alt#200px*200px](/qr.png)
    ![alt#20%*20%](/qr.png)
    ![alt#20%*20%](/qr.png "title content")
  • link 超链接
    [菜单1](#menu1)
    [外部](www.baidu.com)
    [额外标题](www.baidu.com "外部链接")
  • catalog 目录 如下,放在 md 文件顶部,采用 ------catalog 和 ------catalogEnd 或者采用 -[toc]start 和 -[toc]end 进行包裹
  ------catalog

    * [1 菜单1](#使用说明)
    * [2 菜单2](#版本说明)
      * [2.1 V1.3.4](#V1.3.4)
      * [2.2 V2.0.0](#V2.0.0)

  ------catalogEnd

prettyMarked

since v1.0.8

同 marked,仅仅只是设置了 highlightrenderer

import prettyMarked from 'ray-doc-render/lib/prettyMarked';

// or import marked from 'ray-doc-render/lib/prettyMarked';

prettyMarked('Hello!');
prettyMarked(
`
# header

## subheader
`
);

highlight

// usePrism
import usePrism from 'ray-doc-render/lib/highlight/usePrism';

usePrism(); // prism.highlightAll();

custom render

  • list ul ol class="ray-doc-list"
  • list item li class="ray-doc-list-item"

changelog

2023-11-3 v2.1.1

2023-11-2 v2.1.0

2023-9-21 v2.0.10

  • fix code rules. add python

2020-8-13 v2.0.5

  • 修改 renderer.heading, 当 head 中出现 html 标签时,minify 解析失败的问题
  • 修改其它bug

2019-2-26 v2.0.0

  • 去掉 highlight.js, why? 由于使用到的依赖 less 版本过低,与其它组件产生冲突。同时自定义的 lang 在 highlight.js 中不支持。
  • 添加 prismjs

2019-2-26 v2.0.1

  • modify entry file bugs

License

MIT