mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-19 21:51:20 +08:00
doc: update docs/toml.md 60588c52f3
This commit is contained in:
105
docs/toml.html
105
docs/toml.html
@ -35,7 +35,7 @@
|
||||
<p>这是 TOML 格式配置文件语法的快速参考备忘清单。</p>
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#介绍">介绍</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#示例">示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#注释">注释</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#整数">整数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#浮点数">浮点数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#布尔值">布尔值</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#时间日期">时间日期</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#字符串">字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#table">Table</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数组">数组</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#友好数组">友好数组</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-字符串">TOML 字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多行字符串">多行字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#文字字符串">文字字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多行文字字符串">多行文字字符串</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-tables">TOML Tables</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#基本的">基本的</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#嵌套">嵌套</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#类数组">类数组</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#点分隔">点分隔</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json-1">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多嵌套">多嵌套</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json-2">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#忽略空格">忽略空格</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#内联表">内联表</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#介绍">介绍</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#示例">示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#注释">注释</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#整数">整数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#浮点数">浮点数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#布尔值">布尔值</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#时间日期">时间日期</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#字符串">字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#table">Table</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#数组">数组</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#友好数组">友好数组</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-字符串">TOML 字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#基本字符串">基本字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多行基本字符串">多行基本字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多行文字字符串">多行文字字符串</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#字面量字符串">字面量字符串</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-数字">TOML 数字</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#整数-1">整数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#十六进制带有前缀-0x">十六进制带有前缀 0x</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#八进制带有前缀-0o">八进制带有前缀 0o</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#二进制带有前缀-0b">二进制带有前缀 0b</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#both">both</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#分隔符">分隔符</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#小数">小数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#指数">指数</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#无穷">无穷</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#非数">非数</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-日期与时刻">TOML 日期与时刻</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#坐标日期时刻">坐标日期时刻</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#各地日期时刻">各地日期时刻</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#各地日期">各地日期</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#各地时刻">各地时刻</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#toml-tables">TOML Tables</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#基本的">基本的</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#嵌套">嵌套</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#类数组">类数组</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#点分隔">点分隔</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json-1">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多嵌套">多嵌套</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#-等效的-json-2">↓ 等效的 JSON</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#忽略空格">忽略空格</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#内联表">内联表</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#另见">另见</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="介绍"><a aria-hidden="true" tabindex="-1" href="#介绍"><span class="icon icon-link"></span></a>介绍</h3><div class="wrap-body">
|
||||
<p><a href="https://toml.io/en/">TOML</a> 是一种最小的配置文件格式,由于明显的语义而易于阅读。</p>
|
||||
<ul>
|
||||
@ -109,21 +109,26 @@
|
||||
</span><span class="code-line"><span class="token punctuation">]</span>
|
||||
</span></code></pre>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="toml-字符串"><a aria-hidden="true" tabindex="-1" href="#toml-字符串"><span class="icon icon-link"></span></a>TOML 字符串</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="多行字符串"><a aria-hidden="true" tabindex="-1" href="#多行字符串"><span class="icon icon-link"></span></a>多行字符串</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">multiLineString</span> <span class="token punctuation">=</span> <span class="token string">"""
|
||||
</span></span><span class="code-line"><span class="token string">Multi-line basic strings are surrounded
|
||||
</span></span><span class="code-line"><span class="token string">by three quotation marks on each side
|
||||
</span></span><span class="code-line"><span class="token string">and allow newlines.
|
||||
</span></span><span class="code-line"><span class="token string">"""</span>
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="基本字符串"><a aria-hidden="true" tabindex="-1" href="#基本字符串"><span class="icon icon-link"></span></a>基本字符串</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">str1</span> <span class="token punctuation">=</span> <span class="token string">"I'm a string."</span>
|
||||
</span><span class="code-line"><span class="token key property">str2</span> <span class="token punctuation">=</span> <span class="token string">"You can \"quote\" me."</span>
|
||||
</span><span class="code-line"><span class="token key property">str3</span> <span class="token punctuation">=</span> <span class="token string">"Name\tJos\u00E9\nLoc\tSF."</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="文字字符串"><a aria-hidden="true" tabindex="-1" href="#文字字符串"><span class="icon icon-link"></span></a>文字字符串</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">path</span> <span class="token punctuation">=</span> <span class="token string">'C:\Users\nodejs\templates'</span>
|
||||
</span><span class="code-line"><span class="token key property">path2</span> <span class="token punctuation">=</span> <span class="token string">'\\User\admin$\system32'</span>
|
||||
</span><span class="code-line"><span class="token key property">quoted</span> <span class="token punctuation">=</span> <span class="token string">'Tom "Dubs" Preston-Werner'</span>
|
||||
</span><span class="code-line"><span class="token key property">regex</span> <span class="token punctuation">=</span> <span class="token string">'<\i\c*\s*>'</span>
|
||||
</div></div></div><div class="wrap h3body-not-exist row-span-2"><div class="wrap-header h3wrap"><h3 id="多行基本字符串"><a aria-hidden="true" tabindex="-1" href="#多行基本字符串"><span class="icon icon-link"></span></a>多行基本字符串</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">str1</span> <span class="token punctuation">=</span> <span class="token string">"""
|
||||
</span></span><span class="code-line"><span class="token string">Roses are red
|
||||
</span></span><span class="code-line"><span class="token string">Violets are blue"""</span>
|
||||
</span><span class="code-line">
|
||||
</span><span class="code-line"><span class="token key property">str2</span> <span class="token punctuation">=</span> <span class="token string">"""\
|
||||
</span></span><span class="code-line"><span class="token string"> The quick brown \
|
||||
</span></span><span class="code-line"><span class="token string"> fox jumps over \
|
||||
</span></span><span class="code-line"><span class="token string"> the lazy dog.\
|
||||
</span></span><span class="code-line"><span class="token string"> """</span>
|
||||
</span></code></pre>
|
||||
<p>用单引号括起来。不允许转义。</p>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="多行文字字符串"><a aria-hidden="true" tabindex="-1" href="#多行文字字符串"><span class="icon icon-link"></span></a>多行文字字符串</h3><div class="wrap-body">
|
||||
<p>用行末反斜杠自动剔除非空白字符前的任何空白字符</p>
|
||||
</div></div></div><div class="wrap h3body-not-exist row-span-2"><div class="wrap-header h3wrap"><h3 id="多行文字字符串"><a aria-hidden="true" tabindex="-1" href="#多行文字字符串"><span class="icon icon-link"></span></a>多行文字字符串</h3><div class="wrap-body">
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">re</span> <span class="token punctuation">=</span> <span class="token string">'''\d{2} apps is t[wo]o many'''</span>
|
||||
</span><span class="code-line"><span class="token key property">lines</span> <span class="token punctuation">=</span> <span class="token string">'''
|
||||
</span></span><span class="code-line"><span class="token string">The first newline is
|
||||
@ -132,6 +137,78 @@
|
||||
</span></span><span class="code-line"><span class="token string">is preserved.
|
||||
</span></span><span class="code-line"><span class="token string">'''</span>
|
||||
</span></code></pre>
|
||||
<p>由于没有转义,无法在由单引号包裹的字面量字符串中写入单引号</p>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="字面量字符串"><a aria-hidden="true" tabindex="-1" href="#字面量字符串"><span class="icon icon-link"></span></a>字面量字符串</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">path</span> <span class="token punctuation">=</span> <span class="token string">'C:\Users\nodejs\templates'</span>
|
||||
</span><span class="code-line"><span class="token key property">path2</span> <span class="token punctuation">=</span> <span class="token string">'\\User\admin$\system32'</span>
|
||||
</span><span class="code-line"><span class="token key property">quoted</span> <span class="token punctuation">=</span> <span class="token string">'Tom "Dubs" Preston-Werner'</span>
|
||||
</span><span class="code-line"><span class="token key property">regex</span> <span class="token punctuation">=</span> <span class="token string">'<\i\c*\s*>'</span>
|
||||
</span></code></pre>
|
||||
<p>用单引号括起来。不允许转义。</p>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="toml-数字"><a aria-hidden="true" tabindex="-1" href="#toml-数字"><span class="icon icon-link"></span></a>TOML 数字</h2><div class="wrap-body">
|
||||
<p>整数、浮点数、无穷甚至非数都是支持的。你可以用科学计数法甚至千分符</p>
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="整数-1"><a aria-hidden="true" tabindex="-1" href="#整数-1"><span class="icon icon-link"></span></a>整数</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">int1</span> <span class="token punctuation">=</span> <span class="token number">+99</span>
|
||||
</span><span class="code-line"><span class="token key property">int2</span> <span class="token punctuation">=</span> <span class="token number">42</span>
|
||||
</span><span class="code-line"><span class="token key property">int3</span> <span class="token punctuation">=</span> <span class="token number">0</span>
|
||||
</span><span class="code-line"><span class="token key property">int4</span> <span class="token punctuation">=</span> <span class="token number">-17</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="十六进制带有前缀-0x"><a aria-hidden="true" tabindex="-1" href="#十六进制带有前缀-0x"><span class="icon icon-link"></span></a>十六进制带有前缀 <code>0x</code></h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">hex1</span> <span class="token punctuation">=</span> <span class="token number">0xDEADBEEF</span>
|
||||
</span><span class="code-line"><span class="token key property">hex2</span> <span class="token punctuation">=</span> <span class="token number">0xdeadbeef</span>
|
||||
</span><span class="code-line"><span class="token key property">hex3</span> <span class="token punctuation">=</span> <span class="token number">0xdead_beef</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="八进制带有前缀-0o"><a aria-hidden="true" tabindex="-1" href="#八进制带有前缀-0o"><span class="icon icon-link"></span></a>八进制带有前缀 <code>0o</code></h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">oct1</span> <span class="token punctuation">=</span> <span class="token number">0o01234567</span>
|
||||
</span><span class="code-line"><span class="token key property">oct2</span> <span class="token punctuation">=</span> <span class="token number">0o755</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="二进制带有前缀-0b"><a aria-hidden="true" tabindex="-1" href="#二进制带有前缀-0b"><span class="icon icon-link"></span></a>二进制带有前缀 <code>0b</code></h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">bin1</span> <span class="token punctuation">=</span> <span class="token number">0b11010110</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="both"><a aria-hidden="true" tabindex="-1" href="#both"><span class="icon icon-link"></span></a>both</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">float7</span> <span class="token punctuation">=</span> <span class="token number">6.626e-34</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="分隔符"><a aria-hidden="true" tabindex="-1" href="#分隔符"><span class="icon icon-link"></span></a>分隔符</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">float8</span> <span class="token punctuation">=</span> <span class="token number">224_617.445_991_228</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="小数"><a aria-hidden="true" tabindex="-1" href="#小数"><span class="icon icon-link"></span></a>小数</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">float1</span> <span class="token punctuation">=</span> <span class="token number">+1.0</span>
|
||||
</span><span class="code-line"><span class="token key property">float2</span> <span class="token punctuation">=</span> <span class="token number">3.1415</span>
|
||||
</span><span class="code-line"><span class="token key property">float3</span> <span class="token punctuation">=</span> <span class="token number">-0.01</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="指数"><a aria-hidden="true" tabindex="-1" href="#指数"><span class="icon icon-link"></span></a>指数</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">float4</span> <span class="token punctuation">=</span> <span class="token number">5e+22</span>
|
||||
</span><span class="code-line"><span class="token key property">float5</span> <span class="token punctuation">=</span> <span class="token number">1e06</span>
|
||||
</span><span class="code-line"><span class="token key property">float6</span> <span class="token punctuation">=</span> <span class="token number">-2E-2</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="无穷"><a aria-hidden="true" tabindex="-1" href="#无穷"><span class="icon icon-link"></span></a>无穷</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">infinite1</span> <span class="token punctuation">=</span> <span class="token number">inf</span> <span class="token comment"># 正无穷</span>
|
||||
</span><span class="code-line"><span class="token key property">infinite2</span> <span class="token punctuation">=</span> <span class="token number">+inf</span> <span class="token comment"># 正无穷</span>
|
||||
</span><span class="code-line"><span class="token key property">infinite3</span> <span class="token punctuation">=</span> <span class="token number">-inf</span> <span class="token comment"># 负无穷</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="非数"><a aria-hidden="true" tabindex="-1" href="#非数"><span class="icon icon-link"></span></a>非数</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">not1</span> <span class="token punctuation">=</span> <span class="token number">nan</span>
|
||||
</span><span class="code-line"><span class="token key property">not2</span> <span class="token punctuation">=</span> <span class="token number">+nan</span>
|
||||
</span><span class="code-line"><span class="token key property">not3</span> <span class="token punctuation">=</span> <span class="token number">-nan</span>
|
||||
</span></code></pre>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="toml-日期与时刻"><a aria-hidden="true" tabindex="-1" href="#toml-日期与时刻"><span class="icon icon-link"></span></a>TOML 日期与时刻</h2><div class="wrap-body">
|
||||
<p>TOML 支持日期、时刻、日期时刻,带或者不带时区偏移</p>
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="坐标日期时刻"><a aria-hidden="true" tabindex="-1" href="#坐标日期时刻"><span class="icon icon-link"></span></a>坐标日期时刻</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">odt1</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27T07:32:00Z</span>
|
||||
</span><span class="code-line"><span class="token key property">odt2</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27T00:32:00-07:00</span>
|
||||
</span><span class="code-line"><span class="token key property">odt3</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27T00:32:00.999999-07:00</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="各地日期时刻"><a aria-hidden="true" tabindex="-1" href="#各地日期时刻"><span class="icon icon-link"></span></a>各地日期时刻</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">ldt1</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27T07:32:00</span>
|
||||
</span><span class="code-line"><span class="token key property">ldt2</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27T00:32:00.999999</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="各地日期"><a aria-hidden="true" tabindex="-1" href="#各地日期"><span class="icon icon-link"></span></a>各地日期</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">ld1</span> <span class="token punctuation">=</span> <span class="token date number">1979-05-27</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="各地时刻"><a aria-hidden="true" tabindex="-1" href="#各地时刻"><span class="icon icon-link"></span></a>各地时刻</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token key property">lt1</span> <span class="token punctuation">=</span> <span class="token date number">07:32:00</span>
|
||||
</span><span class="code-line"><span class="token key property">lt2</span> <span class="token punctuation">=</span> <span class="token date number">00:32:00.999999</span>
|
||||
</span></code></pre>
|
||||
</div></div></div></div></div><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="toml-tables"><a aria-hidden="true" tabindex="-1" href="#toml-tables"><span class="icon icon-link"></span></a>TOML Tables</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="基本的"><a aria-hidden="true" tabindex="-1" href="#基本的"><span class="icon icon-link"></span></a>基本的</h3><div class="wrap-body">
|
||||
<pre class="language-toml"><code class="language-toml code-highlight"><span class="code-line"><span class="token punctuation">[</span><span class="token table class-name">name</span><span class="token punctuation">]</span>
|
||||
|
Reference in New Issue
Block a user