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

@datawhale/wst-render

v0.4.0

Published

convert AST to HTML

Downloads

14

Readme

wst-render

  • directives中的所有组件,必须存在一个子组件作为入口,满足名字与其对应的文件字母保持严格一致。例如,multiple-choice中的MultipleChoice。
  • 为什么不在TreeRender中使用truncate,即directives的渲染权力不交给组件内部?因为每个组件内部可能有内联元素组件,比如Paragraph,这样的话就必须在所有存在内联元素的地方手动写出渲染组件(比如加粗等),以及使用for循环,看上去丑陋。这样的话,就必须暴露directive组件所有的子组件,从而保证所有在TreeRender中的渲染元素都能找到对应的渲染组件。
  • 使用provider和inject时,需要注意组件嵌套的问题,比如一个multipleChoice里面嵌套了另一个multipleChoice,这样的话可能导致处理逻辑的混乱。两个方案:在parser的后处理器中添加检测逻辑,不允许这样的情况发生;重新设计组件方案。
  • 把所有能够写清楚结构节点的Type都写清楚,比如AdmonitionNode中,第一个元素一定是AdmonitionTitleNode节点,第二个元素一定是Paragraph;并把type全部分散到对应组件文件夹下管理。