-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path14-9c128e7e1f8e9241073d.js
1 lines (1 loc) · 7.5 KB
/
14-9c128e7e1f8e9241073d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{956:function(n,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return R}));var e=a(840),s=a.n(e),o=a(841),p=a.n(o),c=a(521),r=a.n(c),i=a(842),l=a.n(i),d=a(843),u=a.n(d),h=a(844),m=a.n(h),f=a(845),k=a.n(f),g=a(846),y=a.n(g),v=a(0),b=a.n(v),w=a(210);function D(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(n){return!1}}();return function(){var a,e=m()(n);if(t){var s=m()(this).constructor;a=Reflect.construct(e,arguments,s)}else a=e.apply(this,arguments);return u()(this,a)}}function A(n){return b.a.createElement(n.tag,y()({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function S(n){return b.a.createElement(A,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function C(n){return b.a.createElement(A,{tag:"style",html:n.style})}v.Component;var R=function(n){l()(a,n);var t=D(a);function a(){return s()(this,a),t.apply(this,arguments)}return p()(a,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var t=document.querySelector('a[href="'.concat(n,'"]'));t&&Object(w.a)(document.documentElement,0,function n(t,a){for(;t;)return t.offsetTop&&"static"!==getComputedStyle(t).position&&(a+=t.offsetTop),n(t.parentNode,a);return a}(t,-9))}}},{key:"render",value:function(){return b.a.createElement("div",{className:"zandoc-react-container",key:null},b.a.createElement(C,{style:""}),b.a.createElement(S,{html:'<h2 class="anchor-heading"><a href="#writing-documentation">¶</a><a href="javascript:void(0)" id="writing-documentation" class="anchor-point"></a>Writing Documentation</h2>\n<h4 class="anchor-heading"><a href="#file-format">¶</a><a href="javascript:void(0)" id="file-format" class="anchor-point"></a>File Format</h4>\n<p>It\'s Markdown.</p>\n<p>But in order to support demos and internationalization, there\'re some things you need to know.</p>\n<p>Keep reading.</p>\n<h4 class="anchor-heading"><a href="#title">¶</a><a href="javascript:void(0)" id="title" class="anchor-point"></a>Title</h4>\n<p>Titles begin from <code>h2</code>(e.g. <code>##</code> in Markdown), <code>h3</code> and <code>h4</code> is enough in most cases.</p>\n<p>Don\'t nesting too many levels.</p>\n<h4 class="anchor-heading"><a href="#description">¶</a><a href="javascript:void(0)" id="description" class="anchor-point"></a>Description</h4>\n<p>You can put a component description below the first title. Be concise.</p>\n<h4 class="anchor-heading"><a href="#guides-optional">¶</a><a href="javascript:void(0)" id="guides-optional" class="anchor-point"></a>Guides (Optional)</h4>\n<p>You can have a usage guide following the description, starts with an <code>h3</code>.</p>\n<h4 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h4>\n<p>Demos are written in separate files in <code>demos</code> sub-directory.</p>\n<p>Demos are automatically inserted into the final documentation by our loader.</p>\n<pre><code class="language-text"><span class="token operator">--</span><span class="token operator">-</span>\norder<span class="token operator">:</span> <span class="token number">1</span> <span class="token comment">// `order` defines the order in the final documentation, smaller first</span>\nzh<span class="token operator">-</span><span class="token constant">CN</span><span class="token operator">:</span> <span class="token comment">// Start of Chinese string definitions</span>\n title<span class="token operator">:</span> 基础用法 <span class="token comment">// Required, demo title</span>\n content<span class="token operator">:</span> 公告内容 <span class="token comment">// `content` will be replace as `公告内容` in Chinese documentaion</span>\nen<span class="token operator">-</span><span class="token constant">US</span><span class="token operator">:</span> <span class="token comment">// Start of English string definitions</span>\n title<span class="token operator">:</span> <span class="token maybe-class-name">Basic</span> <span class="token comment">// Required, demo title</span>\n content<span class="token operator">:</span> <span class="token maybe-class-name">Alert</span> content <span class="token comment">// `content` will be replace as `Alert content` in English documentaion</span>\n<span class="token operator">--</span><span class="token operator">-</span>\n\n<span class="token template-string"><span class="token template-punctuation string">`</span><span class="token template-punctuation string">`</span></span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">jsx\nimport { Alert } from \'zent\';\nReactDOM.render( // ReactDOM.render is the entry point\n <Alert>{i18n.content}</Alert> // The component you want to render\n , mountNode // </span><span class="token template-punctuation string">`</span></span>mountNode<span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string"> is predefined\n);\n</span><span class="token template-punctuation string">`</span></span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token template-punctuation string">`</span></span>\n\n<span class="token comment">// It\'s precss</span>\n<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>style</span><span class="token punctuation">></span></span>\n <span class="token punctuation">.</span><span class="token property-access">zent</span><span class="token operator">-</span>badge <span class="token punctuation">{</span>\n <span class="token punctuation">.</span><span class="token property-access">nested</span> <span class="token punctuation">{</span>\n background<span class="token operator">:</span> red<span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">}</span>\n<span class="token tag"><span class="token tag"><span class="token punctuation"><</span>style</span><span class="token punctuation">></span></span></code></pre>\n<p>A demo can have three parts:</p>\n<ul>\n<li>\n<p>YAML configuration</p>\n<ul>\n<li><code>order</code> and <code>title</code> are required</li>\n</ul>\n</li>\n<li>\n<p>JavaScript code</p>\n<ul>\n<li>Use <code>i18n.varName</code> as a placeholder to texts, and define <code>varName</code> in YAML.</li>\n</ul>\n</li>\n<li>\n<p>styles(optional)</p>\n<ul>\n<li>You don\'t need this in most cases</li>\n</ul>\n</li>\n</ul>\n<p>Some rules for writing demos:</p>\n<ul>\n<li>Start from the basics</li>\n<li>Orthogonal: one demo for one senario</li>\n</ul>\n<h4 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h4>\n<p>Use a table for your APIs, the table should have these columns:</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Required</th>\n<th>Default</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>visible</td>\n<td>Show or hide</td>\n<td>bool</td>\n<td>No</td>\n<td><code>false</code></td>\n<td><code>true</code>\n \n|\n \n<code>false</code></td>\n</tr>\n</tbody>\n</table>'}))}}]),a}(v.Component)}}]);