Skip to content

Commit 712a4a5

Browse files
committed
docs: docs/i18n/を更新
1 parent 9f2631c commit 712a4a5

File tree

7 files changed

+114
-27
lines changed

7 files changed

+114
-27
lines changed

docs/i18n/category/data-loading-en.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ children:
9696
equivalents, null-values (<code>null</code>, <code>~</code> or empty ``) will be converted into
9797
<code><span class="typ-key">none</span></code>, and numbers will be converted to floats or integers depending on
9898
whether they are whole numbers.</p>
99+
<p>Be aware that integers larger than 2<sup>63</sup>-1 will be converted to
100+
floating point numbers, which may result in an approximative value.</p>
99101
example: null
100102
self: false
101103
params:
@@ -394,12 +396,16 @@ children:
394396
contextual: false
395397
details: |-
396398
<p>Reads structured data from a JSON file.</p>
397-
<p>The file must contain a valid JSON object or array. JSON objects will be
398-
converted into Typst dictionaries, and JSON arrays will be converted into
399-
Typst arrays. Strings and booleans will be converted into the Typst
400-
equivalents, <code>null</code> will be converted into <code><span class="typ-key">none</span></code>, and numbers will be
401-
converted to floats or integers depending on whether they are whole numbers.</p>
402-
<p>The function returns a dictionary or an array, depending on the JSON file.</p>
399+
<p>The file must contain a valid JSON value, such as object or array. JSON
400+
objects will be converted into Typst dictionaries, and JSON arrays will be
401+
converted into Typst arrays. Strings and booleans will be converted into the
402+
Typst equivalents, <code>null</code> will be converted into <code><span class="typ-key">none</span></code>, and numbers will
403+
be converted to floats or integers depending on whether they are whole
404+
numbers.</p>
405+
<p>Be aware that integers larger than 2<sup>63</sup>-1 will be converted to
406+
floating point numbers, which may result in an approximative value.</p>
407+
<p>The function returns a dictionary, an array or, depending on the JSON file,
408+
another JSON data type.</p>
403409
<p>The JSON files in the example contain objects with the keys <code>temperature</code>,
404410
<code>unit</code>, and <code>weather</code>.</p>
405411
<h2 id="example">Example</h2>
@@ -918,6 +924,8 @@ children:
918924
<code><span class="typ-key">none</span></code>, and numbers will be converted to floats or integers depending on
919925
whether they are whole numbers. Custom YAML tags are ignored, though the
920926
loaded value will still be present.</p>
927+
<p>Be aware that integers larger than 2<sup>63</sup>-1 will be converted to
928+
floating point numbers, which may give an approximative value.</p>
921929
<p>The YAML files in the example contain objects with authors as keys,
922930
each with a sequence of their own submapping with the keys
923931
&quot;title&quot; and &quot;published&quot;</p>

docs/i18n/category/foundations-en.yaml

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ body:
3131
route: /docs/reference/foundations/assert/
3232
oneliner: Ensures that a condition is fulfilled.
3333
code: true
34+
- name: auto
35+
route: /docs/reference/foundations/auto/
36+
oneliner: A value that indicates a smart default.
37+
code: true
3438
- name: bool
3539
route: /docs/reference/foundations/bool/
3640
oneliner: A type with two states.
@@ -83,6 +87,10 @@ body:
8387
route: /docs/reference/foundations/module/
8488
oneliner: An evaluated module, either built-in or resulting from a file.
8589
code: true
90+
- name: none
91+
route: /docs/reference/foundations/none/
92+
oneliner: A value that indicates the absence of any other value.
93+
code: true
8694
- name: panic
8795
route: /docs/reference/foundations/panic/
8896
oneliner: Fails with an error.
@@ -1709,6 +1717,31 @@ children:
17091717
returns: []
17101718
scope: []
17111719
children: []
1720+
- route: /docs/reference/foundations/auto/
1721+
title: Auto
1722+
description: Documentation for the Auto type.
1723+
part: null
1724+
outline:
1725+
- id: summary
1726+
name: Summary
1727+
children: []
1728+
body:
1729+
kind: type
1730+
content:
1731+
name: auto
1732+
title: Auto
1733+
keywords: []
1734+
oneliner: A value that indicates a smart default.
1735+
details: |-
1736+
<p>A value that indicates a smart default.</p>
1737+
<p>The auto type has exactly one value: <code><span class="typ-key">auto</span></code>.</p>
1738+
<p>Parameters that support the <code><span class="typ-key">auto</span></code> value have some smart default or
1739+
contextual behaviour. A good example is the <a href="/docs/reference/text/text/#parameters-dir">text direction</a>
1740+
parameter. Setting it to <code><span class="typ-key">auto</span></code> lets Typst automatically determine the
1741+
direction from the <a href="/docs/reference/text/text/#parameters-lang">text language</a>.</p>
1742+
constructor: null
1743+
scope: []
1744+
children: []
17121745
- route: /docs/reference/foundations/bool/
17131746
title: Boolean
17141747
description: Documentation for the Boolean type.
@@ -5851,6 +5884,36 @@ children:
58515884
constructor: null
58525885
scope: []
58535886
children: []
5887+
- route: /docs/reference/foundations/none/
5888+
title: None
5889+
description: Documentation for the None type.
5890+
part: null
5891+
outline:
5892+
- id: summary
5893+
name: Summary
5894+
children: []
5895+
- id: example
5896+
name: Example
5897+
children: []
5898+
body:
5899+
kind: type
5900+
content:
5901+
name: none
5902+
title: None
5903+
keywords: []
5904+
oneliner: A value that indicates the absence of any other value.
5905+
details: |-
5906+
<p>A value that indicates the absence of any other value.</p>
5907+
<p>The none type has exactly one value: <code><span class="typ-key">none</span></code>.</p>
5908+
<p>When inserted into the document, it is not visible. This is also the value
5909+
that is produced by empty code blocks. It can be
5910+
<a href="/docs/reference/scripting/#blocks">joined</a> with any value, yielding the other value.</p>
5911+
<h2 id="example">Example</h2>
5912+
<div class="previewed-code"><pre><code>Not visible: <span class="typ-key">#</span><span class="typ-key">none</span>
5913+
</code></pre><div class="preview"><img src="/assets/docs/6caa7433f3f477e3c7cfb6d6b041af0d.png" alt="Preview" width="480" height="190"/></div></div>
5914+
constructor: null
5915+
scope: []
5916+
children: []
58545917
- route: /docs/reference/foundations/panic/
58555918
title: Panic
58565919
description: Documentation for the `panic` function.
@@ -7300,7 +7363,8 @@ children:
73007363
self: true
73017364
params:
73027365
- name: pattern
7303-
details: <p>The pattern to search for.</p>
7366+
details: <p>The pattern to search for. If <code><span class="typ-key">none</span></code>,
7367+
trims white spaces.</p>
73047368
example: null
73057369
types:
73067370
- none
@@ -7315,8 +7379,8 @@ children:
73157379
settable: false
73167380
- name: at
73177381
details: |-
7318-
<p>Can be <code>start</code> or <code>end</code> to only trim the start or end of the string.
7319-
If omitted, both sides are trimmed.</p>
7382+
<p>Can be <code>start</code> or <code>end</code> to only trim the start or end of the
7383+
string. If omitted, both sides are trimmed.</p>
73207384
example: null
73217385
types:
73227386
- alignment

docs/i18n/category/introspection-en.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ children:
594594
page number, typically you want the logical page number that may, for
595595
instance, have been reset after a preface.</p>
596596
<h2 id="examples">Examples</h2>
597-
<p>Determining the current position in the document in combination with
598-
<a href="/docs/reference/introspection/locate/" title="`locate`"><code>locate</code></a>:</p>
597+
<p>Determining the current position in the document in combination with the
598+
<a href="/docs/reference/introspection/location/#definitions-position"><code>position</code></a> method:</p>
599599
<div class="previewed-code"><pre><code><span class="typ-key">#</span><span class="typ-key">context</span> <span class="typ-punct">[</span>
600600
I am located at
601601
<span class="typ-func">#</span><span class="typ-func">here</span><span class="typ-punct">(</span><span class="typ-punct">)</span><span class="typ-punct">.</span><span class="typ-func">position</span><span class="typ-punct">(</span><span class="typ-punct">)</span>
@@ -848,7 +848,8 @@ children:
848848
details: |-
849849
<p>Exposes a value to the query system without producing visible content.</p>
850850
<p>This element can be retrieved with the <a href="/docs/reference/introspection/query/" title="`query`"><code>query</code></a> function and from the
851-
command line with <a href="/docs/reference/meta/query/#cli-queries"><code>typst query</code></a>. Its
851+
command line with
852+
<a href="/docs/reference/introspection/query/#command-line-queries"><code>typst query</code></a>. Its
852853
purpose is to expose an arbitrary value to the introspection system. To
853854
identify a metadata value among others, you can attach a <a href="/docs/reference/foundations/label/" title="`label`"><code>label</code></a> to it and
854855
query for that label.</p>

docs/i18n/category/layout-en.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3918,8 +3918,10 @@ children:
39183918
- name: alignment
39193919
details: |-
39203920
<p>Relative to which position in the parent container to place the content.</p>
3921-
<p>Cannot be <code><span class="typ-key">auto</span></code> if <code>float</code> is <code><span class="typ-key">false</span></code> and must be either
3922-
<code><span class="typ-key">auto</span></code>, <code>top</code>, or <code>bottom</code> if <code>float</code> is <code><span class="typ-key">true</span></code>.</p>
3921+
<ul>
3922+
<li>If <code>float</code> is <code><span class="typ-key">false</span></code>, then this can be any alignment other than <code><span class="typ-key">auto</span></code>.</li>
3923+
<li>If <code>float</code> is <code><span class="typ-key">true</span></code>, then this must be <code><span class="typ-key">auto</span></code>, <code>top</code>, or <code>bottom</code>.</li>
3924+
</ul>
39233925
<p>When an axis of the page is <code><span class="typ-key">auto</span></code> sized, all alignments relative to
39243926
that axis will be ignored, instead, the item will be placed in the
39253927
origin of the axis.</p>
@@ -3985,6 +3987,9 @@ children:
39853987
<span class="typ-func">place</span><span class="typ-punct">(</span>center<span class="typ-punct">,</span> dx<span class="typ-punct">:</span> amount <span class="typ-op">-</span> <span class="typ-num">32pt</span><span class="typ-punct">,</span> dy<span class="typ-punct">:</span> amount<span class="typ-punct">)</span><span class="typ-punct">[</span>A<span class="typ-punct">]</span>
39863988
<span class="typ-punct">}</span>
39873989
</code></pre><div class="preview"><img src="/assets/docs/2894bae3ce0defe070261a5d5f61fe40.png" alt="Preview" width="480" height="190"/></div></div>
3990+
<p>This does not affect the layout of in-flow content.
3991+
In other words, the placed content is treated as if it
3992+
were wrapped in a <a href="/docs/reference/layout/move/" title="`move`"><code>move</code></a> element.</p>
39883993
types:
39893994
- relative
39903995
strings: []
@@ -3995,7 +4000,11 @@ children:
39954000
variadic: false
39964001
settable: true
39974002
- name: dy
3998-
details: <p>The vertical displacement of the placed content.</p>
4003+
details: |-
4004+
<p>The vertical displacement of the placed content.</p>
4005+
<p>This does not affect the layout of in-flow content.
4006+
In other words, the placed content is treated as if it
4007+
were wrapped in a <a href="/docs/reference/layout/move/" title="`move`"><code>move</code></a> element.</p>
39994008
example: null
40004009
types:
40014010
- relative

docs/i18n/category/model-en.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,17 +1725,16 @@ children:
17251725
<p>An entry in a footnote list.</p>
17261726
<p>This function is not intended to be called directly. Instead, it is used
17271727
in set and show rules to customize footnote listings.</p>
1728-
<p><em>Note:</em> Set and show rules for <code>footnote.entry</code> must be defined at the
1729-
beginning of the document in order to work correctly.
1730-
See <a href="https://github.com/typst/typst/issues/1348#issuecomment-1566316463">here</a>
1731-
for more information.</p>
17321728
example: |-
17331729
<div class="previewed-code"><pre><code><span class="typ-key">#</span><span class="typ-key">show</span> footnote<span class="typ-punct">.</span><span class="typ-func">entry</span><span class="typ-punct">:</span> <span class="typ-key">set</span> <span class="typ-func">text</span><span class="typ-punct">(</span>red<span class="typ-punct">)</span>
17341730
17351731
My footnote listing
17361732
<span class="typ-func">#</span><span class="typ-func">footnote</span><span class="typ-punct">[</span>It&#39;s down here<span class="typ-punct">]</span>
17371733
has red text!
17381734
</code></pre><div class="preview"><img src="/assets/docs/e07bed06d522a25126bd74abd9d30066.png" alt="Preview" width="480" height="190"/></div></div>
1735+
<p><em>Note:</em> Set and show rules for <code>footnote.entry</code> must be defined at the
1736+
beginning of the document in order to work correctly. See <a href="https://github.com/typst/typst/issues/1467#issuecomment-1588799440">here</a> for
1737+
more information.</p>
17391738
self: false
17401739
params:
17411740
- name: note
@@ -2810,7 +2809,7 @@ children:
28102809
<p>The outline's heading will not be numbered by default, but you can
28112810
force it to be with a show-set rule:
28122811
<code><span class="typ-key">show</span> <span class="typ-func">outline</span><span class="typ-punct">:</span> <span class="typ-key">set</span> <span class="typ-func">heading</span><span class="typ-punct">(</span>numbering<span class="typ-punct">:</span> <span class="typ-str">&quot;1.&quot;</span><span class="typ-punct">)</span></code></p>
2813-
example: <pre></pre>
2812+
example: null
28142813
types:
28152814
- none
28162815
- auto

docs/i18n/category/text-en.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,8 @@ children:
719719
<h2 id="syntax">Syntax</h2>
720720
<p>This function also has dedicated syntax. You can enclose text in 1 or 3+
721721
backticks (<code>`</code>) to make it raw. Two backticks produce empty raw text.
722-
When you use three or more backticks, you can additionally specify a
722+
This works both in markup and code.</p>
723+
<p>When you use three or more backticks, you can additionally specify a
723724
language tag for syntax highlighting directly after the opening backticks.
724725
Within raw blocks, everything (except for the language tag, if applicable)
725726
is rendered as is, in particular, there are no escape sequences.</p>
@@ -1738,12 +1739,17 @@ children:
17381739
<p>In the web app, you can see the list of available fonts by clicking on
17391740
the &quot;Ag&quot; button. You can provide additional fonts by uploading <code>.ttf</code>
17401741
or <code>.otf</code> files into your project. They will be discovered
1741-
automatically.</p>
1742+
automatically. The priority is: project fonts &gt; server fonts.</p>
17421743
</li>
17431744
<li>
1744-
<p>Locally, Typst uses your installed system fonts. In addition, you can
1745-
use the <code>--font-path</code> argument or <code>TYPST_FONT_PATHS</code> environment
1746-
variable to add directories that should be scanned for fonts.</p>
1745+
<p>Locally, Typst uses your installed system fonts or embedded fonts in
1746+
the CLI, which are <code>Linux Libertine</code>, <code>New Computer Modern</code>,
1747+
<code>New Computer Modern Math</code>, and <code>DejaVu Sans Mono</code>. In addition, you
1748+
can use the <code>--font-path</code> argument or <code>TYPST_FONT_PATHS</code> environment
1749+
variable to add directories that should be scanned for fonts. The
1750+
priority is: <code>--font-paths</code> &gt; system fonts &gt; embedded fonts. Run
1751+
<code>typst fonts</code> to see the fonts that Typst has discovered on your
1752+
system.</p>
17471753
</li>
17481754
</ul>
17491755
example: |-

docs/i18n/category/visualize-en.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,8 @@ children:
13781378
component is included.</p>
13791379
example: |-
13801380
<div class="previewed-code"><pre><code><span class="typ-comment">// note that the alpha component is included by default</span>
1381-
<span class="typ-punct">#</span><span class="typ-punct">(</span><span class="typ-func">rgb</span><span class="typ-punct">(</span><span class="typ-num">40%</span><span class="typ-punct">,</span> <span class="typ-num">60%</span><span class="typ-punct">,</span> <span class="typ-num">80%</span><span class="typ-punct">)</span><span class="typ-punct">.</span><span class="typ-func">components</span><span class="typ-punct">(</span><span class="typ-punct">)</span> <span class="typ-op">==</span> <span class="typ-punct">(</span><span class="typ-num">40%</span><span class="typ-punct">,</span> <span class="typ-num">60%</span><span class="typ-punct">,</span> <span class="typ-num">80%</span><span class="typ-punct">,</span> <span class="typ-num">100%</span><span class="typ-punct">)</span><span class="typ-punct">)</span>
1382-
</code></pre><div class="preview"><img src="/assets/docs/6256b6a7300a0fc8a2526dd5401230c8.png" alt="Preview" width="480" height="190"/></div></div>
1381+
<span class="typ-func">#</span><span class="typ-func">rgb</span><span class="typ-punct">(</span><span class="typ-num">40%</span><span class="typ-punct">,</span> <span class="typ-num">60%</span><span class="typ-punct">,</span> <span class="typ-num">80%</span><span class="typ-punct">)</span><span class="typ-punct">.</span><span class="typ-func">components</span><span class="typ-punct">(</span><span class="typ-punct">)</span>
1382+
</code></pre><div class="preview"><img src="/assets/docs/43a9b4ace8d343e07ec2b841211eace5.png" alt="Preview" width="480" height="190"/></div></div>
13831383
self: true
13841384
params:
13851385
- name: alpha

0 commit comments

Comments
 (0)