Skip to content

Commit

Permalink
remove {{TemplateLink}} macros from l10n-zh
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored and irvin committed May 25, 2022
1 parent 149f534 commit 6a0c7c9
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h3 id="外部代码">外部代码</h3>

<p>前面的例子在你想嵌入主动学习内容时是可行的。不过,如果你想要处理更加复杂的代码,这个 <code>hidden</code> 的 {{HTMLElement('div')}} 就比较麻烦。</p>

<p>另外种方案是将内容写入 MDN 页面,然后嵌入另一个页面中。为此,我们可以使用 {{TemplateLink("EmbedDistLiveSample")}} 替代{{TemplateLink("EmbedLiveSample")}} </p>
<p>另外种方案是将内容写入 MDN 页面,然后嵌入另一个页面中。为此,我们可以使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/EmbedDistLiveSample.ejs"><code>EmbedDistLiveSample</code></a> 替代 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/EmbedLiveSample.ejs"><code>EmbedLiveSample</code></a></p>

<p>我们学习配置这个模拟远程代码嵌入的实例:</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ <h2 id="消除歧义">消除歧义</h2>
<p>有时,根据上下文,术语有几个含义。 要解决歧义,您必须遵循以下准则:</p>

<ul>
<li>该术语的主页面必须是一个包含了 {{TemplateLink("GlossaryDisambiguation")}} 宏的消歧页面;</li>
<li>该术语的主页面必须是一个包含了 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/GlossaryDisambiguation.ejs"><code>GlossaryDisambiguation</code></a> 宏的消歧页面;</li>
<li>该术语具有定义给定上下文的术语的子页面。</li>
</ul>

<p>我们以一个例子来说明。<em>signature</em> 条目在至少三种不同的语境中具有不同的含义: <em>安全</em><em>函数 </em>和 <em>电子邮件</em></p>
<p>我们以一个例子来说明。<em>signature</em> 条目在至少三种不同的语境中具有不同的含义: <em>安全</em><em>函数 </em>和 <em>电子邮件</em></p>

<ol>
<li><a href="/zh-CN/docs/Glossary/Signature">Glossary/Signature</a> 页面是使用了 {{TemplateLink("GlossaryDisambiguation")}} 宏的消歧页面;</li>
<li><a href="/zh-CN/docs/Glossary/Signature">Glossary/Signature</a> 页面是使用了 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/GlossaryDisambiguation.ejs"><code>GlossaryDisambiguation</code></a> 宏的消歧页面;</li>
<li><a href="/zh-CN/docs/Glossary/Signature/Security">Glossary/Signature/Security</a> 页面是定义安全上下文中签名的条目页面;</li>
<li><a href="/zh-CN/docs/Glossary/Signature/Function">Glossary/Signature/Function</a> 页面是定义函数签名的条目页面;</li>
<li><a href="/zh-CN/docs/Glossary/Signature/Email">Glossary/Signature/Email</a> 页面是定义电子邮件签名的条目页面。</li>
</ol>

<h2 id="如何使用_Glossary_宏">如何使用 \{{Glossary}} 宏</h2>

<p>当人们可以在另一个文档访问到词汇的定义,而无需他们从正在阅读的内容进行跳转阅读词汇定义时,词汇表是最好用的。因此,我们敦促您随时使用 {{TemplateLink("Glossary")}} 宏将词汇链接到词汇表:</p>
<p>当人们可以在另一个文档访问到词汇的定义,而无需他们从正在阅读的内容进行跳转阅读词汇定义时,词汇表是最好用的。因此,我们敦促您随时使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/Glossary.ejs"><code>Glossary</code></a> 宏将词汇链接到词汇表:</p>

<table class="standard-table">
<thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ <h2 id="Structure_of_an_interface_page">Structure of an interface page</h2>
</ul>
</li>
<li><strong>Description</strong>: the first paragraph of the interface page should provide  a  short concise description of the interface's overarching purpose.  You may also want to include a couple more paragraphs if any additional description is required. Note that if the interface defines a mixin, you shouldn't use the term "Interface" to describe it, but mixin instead — it isn't really a standalone interface as such, but a mixin that adds functionality to multiple other interfaces. Similarly, if the interface is actually a dictionary, you should use that term instead of "interface".</li>
<li><strong>Inheritance diagram:</strong> Use the {{TemplateLink("InheritanceDiagram")}} macro to embed an SVG inheritance diagram for the interface. For most interfaces, you won't need any parameters, but if the inheritance chain is long, you may need to use \{{InheritanceDiagram(600, 120)}} to make room vertically for two rows of boxes.</li>
<li><strong>Inheritance diagram:</strong> Use the <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/InheritanceDiagram.ejs"><code>InheritanceDiagram</code></a> macro to embed an SVG inheritance diagram for the interface. For most interfaces, you won't need any parameters, but if the inheritance chain is long, you may need to use \{{InheritanceDiagram(600, 120)}} to make room vertically for two rows of boxes.</li>
<li>
<p><strong>List of properties, List of methods</strong>: These sections should be titled  "Properties" and "Methods", and provide links (using the \{{domxref}} macro) to a reference  page for each property/method of that interface, along with a description of what  each one does. These should be marked up using description/definition  lists, which can be created using the  "Definition List", "Definition  Term", and "Definition Description" buttons on the MDN editor toolbar. Each description should be short and concise — one sentence if possible. See the "Referencing other API features with the \{{domxref}} macro" section for a quicker way to create links to other pages.<br>
<br>
Expand Down
10 changes: 5 additions & 5 deletions files/zh-cn/mdn/guidelines/writing_style_guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h4 id="过短的文章难以被搜索到">过短的文章难以被搜索到</h4

<h3 id="小节、段落和换行">小节、段落和换行</h3>

<p>对于小节的标题,应使用从大到小的方式来定义级别:{{HTMLElement("h2")}}、{{HTMLElement("h3")}}、{{HTMLElement("h4")}} 这样,并且中间不要跳过某一级。因为 H1 已用于文章的标题,因此小节的标题应该从 H2 开始。如果你的文章中小节的层次超过了 3 到 4 级,那么你可能需要考虑将整篇文章拆分成几篇小的文章,然后用一个引导页给出这些文章的链接,并用 {{TemplateLink("Next")}}、{{TemplateLink("Previous")}}、{{TemplateLink("PreviousNext")}} 宏为它们创建导航。</p>
<p>对于小节的标题,应使用从大到小的方式来定义级别:{{HTMLElement("h2")}}、{{HTMLElement("h3")}}、{{HTMLElement("h4")}} 这样,并且中间不要跳过某一级。因为 H1 已用于文章的标题,因此小节的标题应该从 H2 开始。如果你的文章中小节的层次超过了 3 到 4 级,那么你可能需要考虑将整篇文章拆分成几篇小的文章,然后用一个引导页给出这些文章的链接,并用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/Next.ejs"><code>Next</code></a><a href="https://github.com/mdn/yari/blob/main/kumascript/macros/Previous.ejs"><code>Previous</code></a><a href="https://github.com/mdn/yari/blob/main/kumascript/macros/PreviousNext.ejs"><code>PreviousNext</code></a> 宏为它们创建导航。</p>

<p>按下回车键(Enter 或 Return)可以开始一个新的段落。如果只是想换行而不是另起一段,可以按住 Shift 并敲下回车。</p>

Expand Down Expand Up @@ -279,11 +279,11 @@ <h4 id="HTML_元素的样式">HTML 元素的样式</h4>

<dl>
<dt>元素名称</dt>
<dd>使用 {{TemplateLink("HTMLElement")}} 宏会生成一个指向该元素详情页的链接。比如,\{{HTMLElement("title")}} 会生成”{{HTMLElement("title")}}“。如果不想生成链接,就将元素名称用尖括号括起来,然后将其设置为内联代码样式,比如 <code>&lt;title&gt;</code></dd>
<dd>使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/HTMLElement.ejs"><code>HTMLElement</code></a> 宏会生成一个指向该元素详情页的链接。比如,\{{HTMLElement("title")}} 会生成”{{HTMLElement("title")}}“。如果不想生成链接,就将元素名称用尖括号括起来,然后将其设置为内联代码样式,比如 <code>&lt;title&gt;</code></dd>
<dt>属性名称</dt>
<dd>请使用<strong>粗体</strong></dd>
<dt>属性定义</dt>
<dd>对正在定义的术语使用 {{TemplateLink("htmlattrdef")}} 宏(如 \{{htmlattrdef("type")}}),这样其他页面就可以使用 {{TemplateLink("htmlattrxref")}} 宏来链接到该页面了(例如 \{{htmlattrxref("attr","属性")}})。</dd>
<dd>对正在定义的术语使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/htmlattrdef.ejs"><code>htmlattrdef</code></a> 宏(如 \{{htmlattrdef("type")}}),这样其他页面就可以使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/htmlattrxref.ejs"><code>htmlattrxref</code></a> 宏来链接到该页面了(例如 \{{htmlattrxref("attr","属性")}})。</dd>
<dt>属性值</dt>
<dd>请使用内联代码样式,并且注意字符串两边不要加引号,除非是代码的语法要求加引号。举例:当将 <code>&lt;input&gt;</code> 元素的 <strong>type</strong> 属性设置为 <code>email</code><code>tel</code> 时……</dd>
<dt>为属性添加说明标签</dt>
Expand Down Expand Up @@ -586,7 +586,7 @@ <h3 id="术语">术语</h3>

<h4 id="HTML_元素">HTML 元素</h4>

<p>请使用”元素“来表示 HTML 和 XML 元素,不要使用”标记“。另外,请在元素名称两边使用尖括号 ”&lt;&gt;“ 括起来,并使用 {{HTMLElement("code")}} 样式。当文章中第一次出现某个元素的时候,应该用 {{TemplateLink("HTMLElement")}} 宏创建一个指向该元素文档的链接(除非你正在撰写的恰好是该元素的文档页面)。</p>
<p>请使用”元素“来表示 HTML 和 XML 元素,不要使用”标记“。另外,请在元素名称两边使用尖括号 ”&lt;&gt;“ 括起来,并使用 {{HTMLElement("code")}} 样式。当文章中第一次出现某个元素的时候,应该用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/HTMLElement.ejs"><code>HTMLElement</code></a> 宏创建一个指向该元素文档的链接(除非你正在撰写的恰好是该元素的文档页面)。</p>

<dl>
<dd>
Expand Down Expand Up @@ -686,7 +686,7 @@ <h4 id="标记已废弃页面">标记已废弃页面</h4>

<ul>
<li>Junk(需删除):用于因为不小心弄错了而创建的页面、或因为内容太差而准备删除的页面。具有该标签的页面随时会被删除。</li>
<li>Obsolete(已废弃):用于技术已经作废或已被其他技术所取代,但是该技术仍然可用的文章。例如某个在 HTML 4.01 中依然可用但在 HTML5 中已经废弃的元素。你也可以使用 {{TemplateLink("obsolete_header")}} 宏在文章顶部显示一个醒目的提示。</li>
<li>Obsolete(已废弃):用于技术已经作废或已被其他技术所取代,但是该技术仍然可用的文章。例如某个在 HTML 4.01 中依然可用但在 HTML5 中已经废弃的元素。你也可以使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/obsolete_header.ejs"><code>obsolete_header</code></a> 宏在文章顶部显示一个醒目的提示。</li>
<li>Archive(存档):用于技术已经废弃或已被其他技术所取代,并且已无法使用的文章。如果可能,请在文章顶部再添加一条提示,给读者提供新的技术文章的链接。例如,介绍如何使用 Mozilla CVS 仓库的文章中应该添加一条指向介绍使用 Mercurial 仓库的文章链接。(如果新技术的文章的页面还没有创建,可以使用 NeedsUpdate(需要更新)标签,并在 Talk 页面添加一条说明。)添加了”Archive“标签的页面最终都会从主内容区移到 MDN 的<a href="https://developer.mozilla.org/zh-CN/docs/Archive">存档</a>区。</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ original_slug: MDN/Structures/Macros/Custom_macros

### 多页面间的导航栏

[`Previous`](https://github.com/mdn/yari/blob/main/kumascript/macros/Previous.ejs)[`Next`](https://github.com/mdn/yari/blob/main/kumascript/macros/Next.ejs)[`PreviousNext`](https://github.com/mdn/yari/blob/main/kumascript/macros/PreviousNext.ejs) 这几个宏可以在页面中创建导航栏,帮助读者按照文章的先后顺序阅读。其中的参数需要填入目标页面在 MDN 中的位置,你可以在页面的网址中找到所需的信息。对于 {{TemplateLink("PreviousNext")}},需要的两个参数是相应文章的 Wiki 位置。第一个参数用于上一篇文章,第二个参数用于下一篇文章。
[`Previous`](https://github.com/mdn/yari/blob/main/kumascript/macros/Previous.ejs)[`Next`](https://github.com/mdn/yari/blob/main/kumascript/macros/Next.ejs)[`PreviousNext`](https://github.com/mdn/yari/blob/main/kumascript/macros/PreviousNext.ejs) 这几个宏可以在页面中创建导航栏,帮助读者按照文章的先后顺序阅读。其中的参数需要填入目标页面在 MDN 中的位置,你可以在页面的网址中找到所需的信息。对于 [`PreviousNext`](https://github.com/mdn/yari/blob/main/kumascript/macros/PreviousNext.ejs),需要的两个参数是相应文章的 Wiki 位置。第一个参数用于上一篇文章,第二个参数用于下一篇文章。

## 代码示例

Expand Down
6 changes: 3 additions & 3 deletions files/zh-tw/mdn/guidelines/writing_style_guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ <h4 id="Styling_mentions_of_HTML_elements">對提及的 HTML 元素使用不同

<dl>
<dt>元素名稱</dt>
<dd>使用 {{TemplateLink("HTMLElement")}} 巨集,這會建立連向該元素頁面的連結。譬如,撰寫 \{{HTMLElement("title")}} 會產生 "{{HTMLElement("title")}}" 。如果不想要建立連結,<strong>就把元素名稱置於角括號中</strong>並使用「行內程式碼樣式」(舉例, <code>&lt;title&gt;</code> )。</dd>
<dd>使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/HTMLElement.ejs"><code>HTMLElement</code></a> 巨集,這會建立連向該元素頁面的連結。譬如,撰寫 \{{HTMLElement("title")}} 會產生 "{{HTMLElement("title")}}" 。如果不想要建立連結,<strong>就把元素名稱置於角括號中</strong>並使用「行內程式碼樣式」(舉例, <code>&lt;title&gt;</code> )。</dd>
<dt>屬性名稱</dt>
<dd>使用「行內程式碼」樣式讓它以<code>程式碼字型</code>顯示。此外,當屬性在解釋其為何的相關說明或其在文章中首次出現時要把它們加上<strong><em>粗體</em></strong></dd>
<dt>屬性定義</dt>
<dd>對定義的術語使用 {{TemplateLink("htmlattrdef")}} 巨集(舉例, \{{htmlattrdef("type")}} ) ,以便它們可以用 {{TemplateLink("htmlattrxref")}} 巨集(舉例, \{{htmlattrxref("type","element")}} )的方式被其他頁面連結來參照屬性定義。</dd>
<dd>對定義的術語使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/htmlattrdef.ejs"><code>htmlattrdef</code></a> 巨集(舉例, \{{htmlattrdef("type")}} ) ,以便它們可以用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/htmlattrxref.ejs"><code>htmlattrxref</code></a> 巨集(舉例,\{{htmlattrxref("type","element")}} )的方式被其他頁面連結來參照屬性定義。</dd>
<dt>屬性值</dt>
<dd>使用「行內程式碼」樣式來套用 <code>&lt;code&gt;</code> 屬性值,而且不要使用引述標示環繞字串值,除非程式碼範例有此需要。</dd>
<dd><strong>譬如:</strong>「當 <code>&lt;input&gt;</code><code>type</code> 屬性被設定為 <code>email</code><code>tel</code> ……」</dd>
Expand Down Expand Up @@ -570,7 +570,7 @@ <h4 id="HTML_elements">HTML 元素</h4>

<p>使用「元素」( elements )來指稱 HTML 和 XML 元素,而非「標籤」( tags )。此外,還需要把它們用「 &lt;&gt; 」包裹並以 {{HTMLElement("code")}} 樣式呈現。</p>

<p>當第一次在章節中參照了某個元素,應使用 {{TemplateLink("HTMLElement")}} 巨集來建立指向該元素的文件(除非就在撰寫該元素的參考文件)。</p>
<p>當第一次在章節中參照了某個元素,應使用 <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/HTMLElement.ejs"><code>HTMLElement</code></a> 巨集來建立指向該元素的文件(除非就在撰寫該元素的參考文件)。</p>

<ul>
<li><strong>正確</strong>: {{HTMLElement("span")}} 元素</li>
Expand Down
2 changes: 1 addition & 1 deletion files/zh-tw/mdn/tools/kumascript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h3 id="Using_search_keywords_to_open_template_pages">Using search keywords to o

<p><img alt="" src="https://mdn.mozillademos.org/files/14432/Screen%20Shot%202016-11-28%20at%203.08.39%20PM.png" style="height: 289px; width: 500px;"></p>

<p>Then click the "Add" button to save your new search keyword. From then on, typing your keyword, then a space, then the name of a macro will open that macro in your current tab. So if you used "t" as the keyword, typing <kbd>t ListSubpages</kbd> will show you the page at {{TemplateLink("ListSubpages")}}.</p>
<p>Then click the "Add" button to save your new search keyword. From then on, typing your keyword, then a space, then the name of a macro will open that macro in your current tab. So if you used "t" as the keyword, typing <kbd>t ListSubpages</kbd> will show you the page at <a href="https://github.com/mdn/yari/blob/main/kumascript/macros/ListSubpages.ejs"><code>ListSubpages</code></a>.</p>

<h2 id="Cookbook">Cookbook</h2>

Expand Down

0 comments on commit 6a0c7c9

Please sign in to comment.