rcpress-基于React的文档生成器

前言以前开发vue组件时,写文档使用的是vuepress,之后转战react后觉得没有顺手的文档生成工具,就模仿vuepress写了这个rcpress。 特点RcPress 是一个基于 React.js 的静态文档生成器。文档UI是模仿 ant design 官网功能配置模仿Vuepress支持mdx,可以在markdown中使用jsx。支持service worker。生产模式下支持生成静态html页面和打包spa两种模式。开发模式下支持ssr,spa两种模式。技术栈ReactJsAnt Designmdxremarkprismjsservice worker快速上手安装安装命令行工具 @rcpress/cli yarn global add @rcpress/cli# 或者如果你用npmnpm i @rcpress/cli -g用法创建目录以及markdown文件 # 创建 docs 目录(docs是默认的文档目录)mkdir docs#创建markdown文件echo '# Hello RcPress' > docs/README.md运行 # 启动spa模式的服务rcpress dev# 启动服务端渲染的服务rcpress server# 访问`3000`端口即可。打包构建 # 在生产环境下构建sparcpress build# 在生产环境下构建ssr并且声称静态html文件rcpress generate文档获取详细的文档, 推荐访问网站上的向导一节。 首页截图 与vuepress的对比首先说下不同点 rcpress 使用了 react.js 驱动,而 vuepress 是由 vue 驱动的。rcpress 是使用了 Ant Design 作为 UI 框架,而 vuepress 是使用了自定义的样式。说下欠缺的功能 没有plugin(插件)这个概念,当然以后可以考虑加入。说下优势 可以在文档里使用所有ant design的组件,不用自己写。支持在开发模式下运行spa,ssr两种模式。vuepress貌似只能运行spa模式。支持生产spa打包。相关链接GitHub 仓库地址: rcpress文档地址: rcpress

November 5, 2019 · 1 min · jiezi

document与Object的关系

window与Objet1、 window.proto === Window.prototype2、 window.proto.proto === 窗口属性(WindowProperties)3、 window.proto.proto.proto === EventTarget.prototype4、 EventTarget.prototype.proto === Object.prototype5、 Event.prototype.proto === Object.prototypedocument与Objet1、 document.proto === HTMLDocument.prototype2、 HTMLDocument.prototype.proto === Document.prototype3、 Document.prototype.proto === Node.prototype4、 Node.prototype.proto === EventTarget.prototype5、 EventTarget.prototype.proto === Object.prototype元素节点与Objetvar h = getElementById(‘id’);1、 h.proto === HTMLDivElement.prototype2、 HTMLDivElement.prototype.proto === HTMLElement.prototype3、 HTMLElement.prototype.proto === Element.prototype4、 Element.prototype.proto === Node.prototype5、 Node.prototype.proto === EventTarget.prototype6、 EventTarget.prototype.proto === Object.prototype属性节点与Objetvar attr = h. attributes[0];1、 h.attributes.proto === NamedNodeMap.prototype2、 NamedNodeMap.prototype.proto=== Object.prototype1、 h.attributes[0].proto === Attr.prototype2、 Attr.prototype.proto === Node.prototype3、 Node.prototype.proto === EventTarget.prototype 4、 EventTarget.prototype.proto === Object.prototype属性获取与赋值1、 h.id === h.attributes.id.value === h.attributes[n].value2、 h.className === h.attributes.class.value === h.attributes[n].valuedom对象api扩展1、DocumentDocument.prototype.aa = function(){console.log(1)}document.aa(); //1document.getElementById(‘id’).aa(); // Uncaught TypeError: h.aa is not a function2、ElementElement.prototype.bb = function(){console.log(1)}document.bb(); // Uncaught TypeError: document.bb is not a functiondocument.getElementById(‘id’).bb(); // 13、ObjectObject.prototype.cc = function(){console.log(1)}document.cc(); //1document.getElementById(‘id’).cc(); // 1 ...

December 28, 2018 · 1 min · jiezi