diff options
Diffstat (limited to 'files/vi/mdn')
-rw-r--r-- | files/vi/mdn/about/index.html | 110 | ||||
-rw-r--r-- | files/vi/mdn/contribute/feedback/index.html | 62 | ||||
-rw-r--r-- | files/vi/mdn/contribute/howto/create_and_edit_pages/index.html | 179 | ||||
-rw-r--r-- | files/vi/mdn/contribute/howto/index.html | 15 | ||||
-rw-r--r-- | files/vi/mdn/contribute/howto/tag/index.html | 376 | ||||
-rw-r--r-- | files/vi/mdn/contribute/index.html | 77 | ||||
-rw-r--r-- | files/vi/mdn/guidelines/index.html | 16 | ||||
-rw-r--r-- | files/vi/mdn/guidelines/writing_style_guide/index.html | 808 | ||||
-rw-r--r-- | files/vi/mdn/index.html | 37 | ||||
-rw-r--r-- | files/vi/mdn/tools/index.html | 16 | ||||
-rw-r--r-- | files/vi/mdn/tools/kumascript/index.html | 472 | ||||
-rw-r--r-- | files/vi/mdn/tools/kumascript/troubleshooting/index.html | 61 |
12 files changed, 0 insertions, 2229 deletions
diff --git a/files/vi/mdn/about/index.html b/files/vi/mdn/about/index.html deleted file mode 100644 index 867da0961b..0000000000 --- a/files/vi/mdn/about/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: Giới Thiệu Về MDN -slug: MDN/About -translation_of: MDN/About ---- -<div>{{MDNSidebar}}</div> - -<p>Mozilla Developer Network(MDN) là nợi tổng hợp kiến thức về công nghệ Web và các phần mềm hỗ trợ web, bao gồm:</p> - -<ul> - <li>Ngôn ngữ web như <a href="/en-US/docs/CSS" title="/en-US/docs/CSS">CSS</a>, <a href="/en-US/docs/HTML" title="/en-US/docs/HTML">HTML</a>, và <a href="/en-US/docs/JavaScript" title="/en-US/docs/JavaScript">JavaScript</a></li> - <li><a href="/en-US/docs/Apps" title="/en-US/docs/Apps">Ứng dụng web</a></li> - <li><a href="/en-US/docs/Add-ons" title="/en-US/docs/Add-ons">Ứng dụng bổ sung cho trình duyệt Firefox</a></li> -</ul> - -<h2 id="Sứ_mệnh">Sứ mệnh</h2> - -<p>Sứ mệnh của MDN là cung cấp tài liệu bổ ích, chính xác và đầy đủ về web. Thông tin trên MDN không giới hạn bởi những phần mềm chỉ được Firefox hỗ trơ. Chúng tôi lưu trữ lại tất cả các công nghệ web mở.</p> - -<p>Thêm vào đó, chúng tôi cung cấp tài liệu hướng dẫn <a href="/en-US/docs/Mozilla">xây dựng và đóng góp vào các dự án Mozilla</a>, cũng như <a href="/en-US/Firefox_OS">Firefox OS</a> và <a href="/en-US/Apps">phát triển ứng dụng Web</a>.</p> - -<p>Nếu bạn không chắc liệu một chủ đề nhất định có nên được trình bày trên Mozilla, hãy đọc: <a href="/en-US/docs/Project:MDN/Contributing/Does_this_belong">Có phải cái này thuộc về MDN?</a></p> - -<h2 id="Làm_sao_để_giúp">Làm sao để giúp</h2> - -<p>Bạn không cần phải biết lập trình — hay lập trình giỏi— để có thể giúp MDN! Chúng tôi có rất nhiều cách mà bạn có thể giúp, từ việc xem lại các bài viết để chắc rằng chúng có ý nghĩa, hay đóng góp bài dịch, cho tới việc thêm vào những code mẫu. Trên thực tế, có quá nhiều cách giúp đỡ mà chúng tôi tạo ra trang <a href="/en-US/docs/MDN/Quick_start">Bắt đầu</a> nhằm giúp bạn chọn nhiệm vụ dựa trên sở thích cá nhân và lượng thời gian rảnh bạn có!</p> - -<h2 id="Cộng_đồng_MDN">Cộng đồng MDN</h2> - -<p>Chúng tôi là một cộng đồng toàn cầu! Chúng tôi có những thành viên đóng góp tuyệt vời từ khắp nơi trên thế giới với một vài ngôn ngữ. Nếu bạn muốn biết thêm về chúng tôi, hay bạn cần bất kỳ sự giúp đỡ nào từ MDN, đừng ngại ngần tham gia diễn đàn thảo luận của chúng tôi hoặc kênh IRC!</p> - -<h2 id="Bản_Quyền_và_Giấy_phép">Bản Quyền và Giấy phép</h2> - -<p>Những tài liệu trên trang MDN được soạn thảo bởi sự đóng góp của nhiều tác giả, bao gồm trong và ngoài tổ chức Mozilla. Trừ khi có sự đồng ý, tất cả nội dung tồn tại dưới các điều kiện của <a class="external text" href="http://creativecommons.org/licenses/by-sa/2.5/" rel="nofollow" title="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike license</a> (CC-BY-SA), v2.5 hay bất cứ phiên bản hiện hành nào. Làm ơn hãy ghi "Mozilla Contributors" cùng với nguồn dẫn tài liệu (hyperlink) (bản online) hoặc đường dẫn URL (bản in) tới trang web mà nội dung được trích dẫn. Ví dụ, để đóng góp cho bài này, bạn có thể ghi:</p> - -<blockquote><a href="https://developer.mozilla.org/en-US/docs/MDN/About">About MDN</a> by <a href="https://developer.mozilla.org/en-US/docs/MDN/About$history">Mozilla Contributors</a> is licensed under <a href="http://creativecommons.org/licenses/by-sa/2.5/">CC-BY-SA 2.5</a>.</blockquote> - -<p>Lưu ý rằng trong ví dụ trên, "Mozilla Contributors" kết nối trực tiếp với lịch sử của trang được trích dẫn. Hãy xem <a href="http://wiki.creativecommons.org/Marking/Users">Các phương pháp tốt nhất cho ghi công tác phẩm</a> để có sự giải thích chi tiết hơn.</p> - -<div class="note"> -<p><strong>Note:</strong> See <a href="/en-US/docs/MDN_content_on_WebPlatform.org" title="/en-US/docs/MDN_content_on_WebPlatform.org">MDN content on WebPlatform.org</a> for information about how to reuse and attribute MDN content on that site.</p> -</div> - -<p>Code samples added to this wiki before August 20, 2010 are available under the <a class="external" href="http://www.opensource.org/licenses/mit-license.php" title="http://www.opensource.org/licenses/mit-license.php">MIT license</a>; you should insert the following attribution information into the MIT template: "© <date of last wiki page revision> <name of person who put it in the wiki>".</p> - -<p>Code samples added on or after August 20, 2010 are in the <a class="external" href="http://creativecommons.org/publicdomain/zero/1.0/" title="http://wiki.creativecommons.org/Public_domain">public domain</a>. No licensing notice is necessary, but if you need one, you can use: "Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/".</p> - -<p>If you wish to contribute to this wiki, you must make your documentation available under the Attribution-ShareAlike license (or occasionally an alternative license already specified by the page you are editing), and your code samples available under <a href="http://creativecommons.org/publicdomain/zero/1.0/" title="http://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC-0</a> (a Public Domain dedication). Adding to this wiki means you agree that your contributions will be made available under those licenses.</p> - -<p>Some older content was made available under a license other than the licenses noted above; these are indicated at the bottom of each page by way of an <a class="internal" href="/Project:en/Examples/Alternate_License_Block" title="Project:En/Examples/Alternate License Block">Alternate License Block</a>.</p> - -<div class="warning"> -<p><strong>Important:</strong> No new pages may be created using alternate licenses.</p> -</div> - -<p>Copyright for contributed materials remains with the author unless the author assigns it to someone else.</p> - -<p>If you have any questions or concerns about anything discussed here, please contact <a class="external" href="mailto:eshepherd@mozilla.com" rel="nofollow" title="mailto:eshepherd@mozilla.com">Eric Shepherd</a>.</p> - -<hr> -<p>The rights in the trademarks, logos, service marks of the Mozilla Foundation, as well as the look and feel of this web site, are not licensed under the Creative Commons license, and to the extent they are works of authorship (like logos and graphic design), they are not included in the work that is licensed under those terms. If you use the text of documents, and wish to also use any of these rights, or if you have any other questions about complying with our licensing terms for this collection, you should contact the Mozilla Foundation here: <a class="external text" href="mailto:licensing@mozilla.org" rel="nofollow" title="mailto:licensing@mozilla.org">licensing@mozilla.org</a>.</p> - -<h2 id="Download_content">Download content</h2> - -<p>You can retrieve the content of a single page on MDN by adding <a href="/en-US/docs/Project:MDN/Kuma/API#Document_parameters">document parameters</a> to the URL to specify what format you want.</p> - -<p>If you want to download a complete, anonymized SQL dump of the MDN database -- that is, a copy of the database with all private user information scrubbed out, we provide that as well. This dump is updated on the first day of each month.</p> - -<p>There are three archives that comprise the anonymized monthly dump of MDN:</p> - -<dl> - <dt><code><date>.sanitized.devmo_sanitize.sql.gz</code></dt> - <dd>The sanitized MySQL database dump of all of MDN's content, data records, and so forth. This is all article content, history records, and so forth. All personal user information has been stripped out (such as email addresses).</dd> - <dt><code>attachments-<date>.tar.gz</code></dt> - <dd>This archive contains all the file attachments that have been uploaded to the wiki.</dd> - <dt><code>uploads-<date>.tar.gz</code></dt> - <dd>This (very large!) archive contains the files uploaded to the Demo Studio. If your interest is only in wiki content, you don't need to download this.</dd> -</dl> - -<p><a href="https://developer.allizom.org/landfill/">Visit the MDN landfill</a> to download these files.</p> - -<h3 id="Third-party_tools">Third-party tools</h3> - -<p>You can also view MDN content via third-party tools like <a href="http://kapeli.com/dash">Dash</a> (for Mac OS) and <a href="http://zealdocs.org/">Zeal</a> (for Linux and Windows).</p> - -<h2 id="Reporting_problems_with_MDN">Reporting problems with MDN</h2> - -<p>Now and then, you may run into problems while using MDN. Whether it's a problem with site infrastructure or an error in documentation content, you can either try to fix it yourself or report the problem. While the former is preferred, the latter is sometimes the best you can manage, and that's okay too.</p> - -<h3 id="Documentation_errors">Documentation errors</h3> - -<p>Obviously, since MDN is a wiki, the best thing you can possibly do is fix problems you spot yourself. But maybe you don't know the answer or are in the middle of rushing to the hospital or something, and need to jot down the problem so someone can look at it later.</p> - -<p>As is the case with all things Mozilla, you report a documentation problem by filing a bug. That's when filing a <a href="https://bugzilla.mozilla.org/form.doc">documentation request bug</a> comes in. Our handy documentation request form will gather the information needed to get us started on fixing the issue.</p> - -<p>Of course, our writing community is busy, so sometimes the quickest way to see a documentation problem resolved is to fix it yourself. See <a href="/en-US/docs/MDN/Contribute/Creating_and_editing_pages" title="/en-US/docs/Project:MDN/Contributing/Creating_and_editing_pages">Creating and editing pages</a> for details.</p> - -<h3 id="Site_bugs_or_feature_requests">Site bugs or feature requests</h3> - -<p><a href="/en-US/docs/Project:MDN/Kuma" title="/en-US/docs/Project:MDN/Kuma">Kuma</a>, the Mozilla-developed platform used for the MDN web site, is in a state of continuous development. Our developers—as well as a number of volunteer contributors—are constantly making improvements. If you see a bug, or have a problem with the site, or even have a suggestion for something that could make the software more awesome, you can use the <a href="https://bugzilla.mozilla.org/form.mdn" title="https://bugzilla.mozilla.org/form.mdn">Kuma bug form</a> to file a report.</p> - -<h2 id="History_orf_MDN">History orf MDN</h2> - -<p>The Mozilla Developer Network (a.k.a. Mozilla Developer Center (MDC), a.k.a. <em>Devmo</em>) project started in early 2005, when the <a class="external" href="http://www.mozillafoundation.org">Mozilla Foundation</a> obtained a license from AOL to use the original <a href="/Project:en/DevEdge" title="Project:en/DevEdge">DevEdge</a> content. The DevEdge content was mined for still-useful material, which was then migrated by volunteers into this wiki so it would be easier to update and maintain.</p> - -<p>Since then, the project has continued growing and now forms a central nexus for all developer documentation related to the Mozilla Project and open web technologies. In 2010, the name was changed to Mozilla Developer Network; 2011 saw the addition of <a class="external" href="http://developer.mozilla.org/en-US/demos" title="https://developer.mozilla.org/en-US/demos/">Demo Studio</a> for web developers to share and show off their code, and <a class="external" href="http://developer.mozilla.org/en-US/learn" title="https://developer.mozilla.org/en-US/learn">Learning</a> pages to provide links to tutorials. (The name MDC lives on as "MDN Doc Center" for the documentation section.) In time, it is hoped that the Mozilla Developer Network will become a resource that web designers, application developers, and extension and theme writers visit on a regular basis.</p> - -<h2 id="About_Mozilla">About Mozilla</h2> - -<p>Whether you want to learn more about who we are, how to be a part of Mozilla or just where to find us, you've come to the right place. To find out what drives us and makes us different, please visit our <a href="http://www.mozilla.org/en-US/mission/">mission</a> page.</p> diff --git a/files/vi/mdn/contribute/feedback/index.html b/files/vi/mdn/contribute/feedback/index.html deleted file mode 100644 index 688130e9c2..0000000000 --- a/files/vi/mdn/contribute/feedback/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Gửi phản hồi về MDN -slug: MDN/Contribute/Feedback -translation_of: MDN/Contribute/Feedback ---- -<div>{{MDNSidebar}}</div> - -<div>{{IncludeSubnav ("/en-US/docs/MDN")}}</div> - -<p>Chào mừng bạn đến với MDN! <span class="seoSummary">Nếu bạn có gợi ý, hoặc đang gặp vấn đề sử dụng MDN, đây là nơi thích hợp để được. Thực tế rằng bạn đang quan tâm trong việc cung cấp thông tin phản hồi làm cho bạn nhiều hơn một phần của cộng đồng Mozilla, và chúng tôi cảm ơn trước sự quan tâm của bạn.</span></p> - -<p><span class="seoSummary">Bạn có nhiều lựa chọn để cung cấp góc nhìn sâu sắc của bạn; bài viết này sẽ giúp bạn làm như vậy.</span></p> - -<h2 id="Cập_nhật_các_tài_liệu_hướng_dẫn">Cập nhật các tài liệu hướng dẫn</h2> - -<p>Trước hết, nếu bạn đã nhìn thấy một vấn đề với các tài liệu, bạn nên luôn luôn cảm thấy miễn phí để sửa chữa nó cho mình.</p> - -<ol> - <li><a href="/en-US/docs/MDN/Contribute/Howto/Create_an_MDN_account">Đăng nhập</a> bằng <a href="https://github.com/">Github</a>.</li> - <li>Nhấp vào nút<a href="https://github.com/"> </a><strong>Chỉnh sửa</strong> màu xanh để mở <a href="/en-US/docs/MDN/Contribute/Editor">trình biên tập</a>.</li> - <li>Nhấn vào nút <strong>Xuất bản</strong> sau khi hoàn thiện chỉnh sửa.</li> -</ol> - -<p>Các tài liệu ở đây như là ở trong một trang wiki, và được giám tuyển bởi một nhóm các tình nguyện viên và nhân viên được trả tiền, do đó, đừng ngần ngại - ngữ pháp của bạn không phải là hoàn hảo. Chúng tôi sẽ làm sạch nó nếu bạn phạm phải một sai lầm; không gây hại chút nào!</p> - -<p>Để biết thêm thông tin về đóng góp cho tài liệu MDN, xem:</p> - -<ul> - <li><a href="/en-US/docs/Project:Getting_started">Bắt đầu</a></li> - <li><a href="/en-US/docs/MDN/Contribute">Đóng góp cho MDN</a></li> - <li><a href="/en-US/docs/MDN/Contribute/Editor">Giao diện chỉnh sửa MDN</a></li> -</ul> - -<h2 id="Tham_gia_vào_cuộc_trò_chuyện">Tham gia vào cuộc trò chuyện</h2> - -<p>Nói với chúng tôi! Có một vài cách để liên lạc với những người khác, những người làm việc về nội dung MDN.</p> - -<h3 id="Đồng_bộ_hoá_Chat">(Đồng bộ hoá) Chat</h3> - -<p> - </p><h3 id="Bất_đồng_bộ_Thảo_luận"><span class="short_text" id="result_box" lang="vi"><span>(Bất đồng bộ) Thảo luận</span></span></h3> - - -<p><span id="result_box" lang="vi"><span>Các cuộc thảo luận dài hạn diễn ra trên <a href="https://discourse.mozilla-community.org/c/mdn">diễn đàn thảo luận MDN</a> của chúng tôi.</span> <span>Bạn có thể đăng lên diễn đàn qua email tới <a href="mailto://mdn@mozilla-community.org">mdn@mozilla-community.org</a>.</span> <span>Nếu bạn tham gia diễn đàn, bạn cũng có thể chọn để có thông báo về các cuộc thảo luận gửi tới bạn qua email.</span></span></p> - -<h2 id="Báo_cáo_một_vấn_đề">Báo cáo một vấn đề</h2> - -<h3 id="Vấn_đề_tài_liệu">Vấn đề tài liệu</h3> - -<p>Nếu bạn nhìn thấy một vấn đề trong các tài liệu hướng dẫn và không thể sửa chữa nó do có bất cứ lý do nào, bạn có thể <a href="https://github.com/mdn/sprints/issues/new?template=issue-template.md&projects=mdn/sprints/2&labels=user-report">báo cáo vấn đề</a>! Bạn có thể sử dụng mẫu này cho bất kỳ vấn đề liên quan đến tài liệu nào, chẳng hạn:</p> - -<ul> - <li>một sự điều chỉnh đơn giản</li> - <li>một yêu cầu cho một mảng nội dung hoàn toàn mới</li> - <li>báo cáo nội dung không phù hợp (bao gồm cả spam và dịch thuật sai chỗ)</li> -</ul> - -<p>Như đã đề cập trước đó, chúng tôi mời các bạn đóng góp những thay đổi của chính mình, nhưng tùy chọn này cũng có sẵn cho bạn luôn.</p> - -<h3 id="Vấn_đề_trang_web">Vấn đề trang web</h3> - -<p>Nếu bạn gặp vấn đề với các trang web MDN, hay có những ý tưởng cho các tính năng mới cho trang web, bạn có thể <a href="https://bugzilla.mozilla.org/form.mdn">gửi một phiếu cho nhóm phát triển MDN</a>.</p> diff --git a/files/vi/mdn/contribute/howto/create_and_edit_pages/index.html b/files/vi/mdn/contribute/howto/create_and_edit_pages/index.html deleted file mode 100644 index b0dc76e311..0000000000 --- a/files/vi/mdn/contribute/howto/create_and_edit_pages/index.html +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: Cách tạo và chỉnh sửa trang -slug: MDN/Contribute/Howto/Create_and_edit_pages -translation_of: MDN/Contribute/Howto/Create_and_edit_pages ---- -<div>{{MDNSidebar}}</div> - -<p><span class="seoSummary">Bài viết này giới thiệu những người đóng góp mới vào quá trình chỉnh sửa các trang hiện có và tạo những trang mới.</span></p> - -<h2 id="Chỉnh_sửa_một_trang_hiện_có">Chỉnh sửa một trang hiện có</h2> - -<p>Để chỉnh sửa một trang:</p> - -<ol> - <li>Nếu bạn đang sử dụng phiên bản read-only của MDN Web Docs (https://developer.mozilla.org), click <strong>Edit in wiki</strong> trong tiêu đề bài viết. Điều này đưa bạn đến phần có thể chỉnh sửa, phiên bản wiki của trang (https://wiki.developer.mozilla.org), nhưng không thực sự mở giao diện chỉnh sửa.</li> - <li>Bấm vào nút <strong>Chỉnh sửa</strong> trong tiêu đề bài viết của trang wiki.</li> - <li>The page then reloads, with an editing interface where you can add or delete information directly.</li> - <li>Add paragraphs, delete text, insert headings, and perform more of the basic functions involved in writing and editing.</li> -</ol> - -<p>See the guide to <a href="/en-US/docs/MDN/Contribute/Editor/Basics">Editor UI elements</a> in the <a href="/en-US/docs/MDN/Contribute/Editor">MDN Editor guide</a> for more information on using <strong>MDN</strong>'s built-in editor.</p> - -<h3 id="Preview_changes">Preview changes</h3> - -<p>To see what your changes look like:</p> - -<ul> - <li>Click the <strong>Preview</strong> button, within the editing function at the top or bottom of the page.</li> - <li>This opens the preview page, showing your revisions in a new window, or tab.</li> - <li>Each time you click this button, it refreshes your preview page with the latest changes.</li> -</ul> - -<p>Be careful! Previewing a page <strong>does not</strong> save your progress. Don't close the editing tab until you've saved your work.</p> - -<h3 id="Revision_comment">Revision comment</h3> - -<p>After previewing your changes, you will want to <em>save your revision</em>. Before you <strong>save</strong>, look for the revision comment box, below the editing box, leaving a comment to inform other contributors why you made changes. For example, you might have added a new section, changed some words to make the terminology more consistent, rewritten a paragraph to clarify the language, or removed information because it was redundant.</p> - -<h3 id="Table_of_Contents">Table of Contents</h3> - -<p>The 'On this Page' section of an article, is an auto-generated list of links to the headings on the page. The wording of these can be edited via the headings. It's also possible to remove a table of contents or decrease its number of links, by selecting 'Edit Page Title and Properties', changing the value of the "TOC" drop down.</p> - -<h3 id="Tags">Tags</h3> - -<p>You can add or remove tags, which describe the page content and purpose, below the editing section. See <a href="/en-US/docs/MDN/Contribute/Tagging">How to properly tag pages</a>, for information on which tags to apply.</p> - -<h3 id="Review_needed">Review needed?</h3> - -<p>If an expert or experienced contributor should review your edits, please request a technical review (for code, API's, or technologies), and/or an editorial review (for prose, grammar, and content), making sure the appropriate box is checked before you save.</p> - -<h3 id="Attach_files">Attach files</h3> - -<p>Attaching files requires a special user privilege. See <a href="/en-US/docs/MDN/Contribute/Editor/Basics/Attachments">Attachments in the MDN editor</a> for details, including how to request the upload privilege.</p> - -<h3 id="Publish_Discard_or_Keep_editing">Publish, Discard, or Keep editing</h3> - -<p>When you finish editing and are happy with your preview, publish your work and comments by clicking the <em>green</em> <strong>Publish</strong> button, to the <strong>right of the page title</strong>, or towards the <strong>bottom of the page</strong>. If you wish to continue working, click <strong>Publish and keep editing</strong>, which publishes your changes and keeps the edit interface open.</p> - -<p>If you change your mind, you can discard edits, by clicking the <em>red</em> <strong>Discard</strong> button. Note that discarding changes <em>permanently</em> discards them.</p> - -<p>Pressing <strong>Enter</strong> in the Revision Comment field is equivalent to clicking <strong>Publish and Keep Editing</strong>.</p> - -<div class="note"> -<p>Note: If attempting to save, but changes are rejected as invalid, and you feel the content is appropriate for MDN, <a href="mailto:mdn-admins@mozilla.com?subject=MDN%3A%20Content%20Rejection%20Appeal&body=%3CDescribe%20the%20content%20you%20were%20trying%20to%20save%20and%20where%20you%20were%20trying%20to%20place%20it.%3E">email the MDN admin team</a> for assistance.</p> -</div> - -<h2 id="Getting_page-creation_permissions">Getting page-creation permissions</h2> - -<p>For security reasons, newly-created accounts don't have the ability to create new pages. If you try to do so, you'll see a page instructing you how to get the page created. There are two options:</p> - -<ul> - <li><strong>Ask for the page to be created for you.</strong> To do this, <a href="https://github.com/mdn/sprints/issues/new?template=issue-template.md&projects=mdn/sprints/2&labels=user-report">file a documentation request issue</a>, with the title "Create page: <page title>". Fill out the URL field of the template with the location on MDN where you'd like the page to go if you know where to place it. In the comment text, include information on why this page needs creating.</li> - <li><strong>Request page creation privileges.</strong> If you request page creation privileges, and they're granted to you, you'll be able to add new pages by following the instructions here. To request these privileges, <a href="mailto:mdn-admins@mozilla.org">email the MDN admin</a> team with your request. Include your username, why you would like to have the ability to create new pages. For instance, you're documenting a new API which involves many new pages, or you'd like to add new terms to the glossary. You should also have made useful contributions to this site's content, and been a contributor for some time. This length of time, and the other factors are collectively considered.</li> -</ul> - -<h2 id="Creating_a_new_page">Creating a new page</h2> - -<p>Once you have page-creation permission, you can begin creating pages.</p> - -<p>If you do not know where to place a new article, <strong>do not worry.</strong> Put it anywhere, we will find it, move to where it belongs, or merge it into existing content. Whatever makes the most sense. Do not worry about making it perfect. We have happy helper gnomes who help to make your content clean and rather luscious.</p> - -<p>There are a few ways to create a new page:</p> - -<ul> - <li><a href="#Missing_page_link">'Missing page' link.</a></li> - <li><a href="#New_page_without_link">New page without a link.</a></li> - <li><a href="#Subpage_of_an_existing_page">A subpage of an existing page.</a></li> - <li><a href="#Clone_of_an_existing_page">Clone of an existing page.</a></li> - <li><a href="#Link_from_an_existing_page">Link from an existing page.</a></li> -</ul> - -<h3 id="Missing_page_link">'Missing page' link</h3> - -<p>As with most wikis, it is possible to create a link to a page that is yet to exist. For example, an author might create a list of all the members of an API, before creating the pages for those members. On MDN, links to non-existent pages are typically displayed in red.</p> - -<p>To create a page from a 'missing page' link:</p> - -<ol> - <li>Log into MDN, and have page-creation permission. If not logged in, clicking a 'missing page' link results in a 404 (page not found) error.</li> - <li>Click the 'missing page' link. If you have page creation permission, the <a href="/en-US/docs/MDN/Contribute/Editor">MDN Editor UI</a> opens, ready for you to create the missing page.</li> - <li>Write the content of the page, and save it.</li> -</ol> - -<h3 id="New_page_without_link">New page without link</h3> - -<p><em>To create a new page without linking from another page</em>, enter a unique page name in the URL field of your browser. For example, if you enter:</p> - -<pre class="language-html notranslate">https://wiki.developer.mozilla.org/en-US/docs/FooBar</pre> - -<p>MDN Creates a new page, with the title "FooBar", opening the editor for you to add new content. Refer to the <a href="#Editing_an_existing_page">Editing an existing page</a> section of this article, for information on how to use the editor mode.</p> - -<p><em>To create a new page without linking from another page</em>:</p> - -<ol> - <li>Log in, and have page-creation permission.</li> - <li>Enter the following in the URL field of your browser:</li> -</ol> - -<pre class="language-html notranslate">https://wiki.developer.mozilla.org/en-US/docs/new</pre> - -<p>MDN Creates a new page, with a place for a title, opening the editor to add new content to this page. Refer to <a href="#Editing_an_existing_page">Editing an existing page</a>, for information on using editor mode.</p> - -<h3 id="Subpage_of_an_existing_page">Subpage of an existing page</h3> - -<p>To create a page you want to be below an existing page, in the page hierarchy:</p> - -<ol> - <li>If needed, navigate to the wiki site by clicking <strong>Edit in wiki</strong> in the article header.</li> - <li>On the 'parent' page, click the <strong>Advanced</strong> menu (the gear icon in the toolbar), then click <strong>New sub-page</strong>.</li> - <li>An editor view opens for creating a new document.</li> - <li>Add a title for this document, in the <strong>Title</strong> field.</li> - <li>Change the <strong>Slug</strong> field, if needed. For example, if the title is long, and a shorter URL seems appropriate. This field is automatically filled by the editor, substituting underscores for spaces found in the title, changing only the last part of the URL.</li> - <li>In the <strong>TOC</strong> field, select heading levels you want to be displayed in the table of contents for the page. Or select 'No table of contents', if one is not needed.</li> - <li>Write content of the page in the editor pane, saving your changes. Refer to <a href="#Editing_an_existing_page">Editing an existing page</a>, for further information on using editor mode.</li> -</ol> - -<h3 id="Clone_of_an_existing_page">Clone of an existing page</h3> - -<p>If there is an existing page, whose format you wish to use as a base for your new page, you can 'clone' that page, and then change its content.</p> - -<ol> - <li>If needed, navigate to the wiki site by clicking <strong>Edit in wiki</strong> in the article header.</li> - <li>On the original page, click the <strong>Advanced</strong> menu (the gear icon in the toolbar), and click <strong>Clone this page</strong>. An editor view opens, for creating a new document.</li> - <li>Change the <strong>Title</strong> of the page, as appropriate for the new content. The <strong>Slug</strong> field is updated automatically as you change the <strong>Title</strong> field.</li> - <li>Change the path portion of the <strong>Slug</strong> field, as needed, to put the new document in a different location in the document hierarchy. In most cases, this is not needed. A cloned page often has similar content to its original, and need to be in a similar location.</li> - <li>In the <strong>TOC</strong> field, select the heading levels you want to be automatically displayed in the table of contents for this page. Or select 'No table of contents', if one is not needed.</li> - <li>Write your content in the editor pane, saving your changes. Refer to <a href="#Editing_an_existing_page">Editing an existing page</a>, for more information on using editor mode.</li> -</ol> - -<h3 id="Link_from_an_existing_page">Link from an existing page</h3> - -<p>This is a bit of a hybrid. You can create a link on another page, then click the link you just inserted, to create the new page:</p> - -<ol> - <li>Enter the name of your new page, anywhere that makes sense in the text of an existing page.</li> - <li>Highlight this new name, and <strong>click the Link icon (<img alt="" src="https://developer.mozilla.org/files/3810/link-icon.png" style="height: 28px; width: 29px;">) </strong>in the editor's toolbar. The <strong>'Update Link'</strong> dialog opens, with the highlighted text in the <strong>'Link To'</strong> field.</li> - <li><strong>"/en-US/docs/"</strong> is inserted by default, to the beginning of the URL field.<em> Enter the name </em>of the page after "/en-US/docs/". The page name does not have to be the same as the link text.</li> - <li>Click <strong>OK</strong>, to create and insert the link.</li> -</ol> - -<p>If the page does not yet exist, the link is displayed in red. If the page <em>does</em> exist, the link is displayed blue. If you want to create a new page, but the page title you desire is already taken, check if it makes sense helping edit and improve the page already there. Otherwise, think of a unique title for your new page, and create a link for it. Refer to <a href="https://developer.mozilla.org/Project:en/Page_Naming_Guide" title="Project:en/Page_Naming_Guide">page naming guide</a> for guidelines.</p> - -<p>To add content to your new page, click on the red link you just created, after saving and closing the editor. The new page opens in editor mode, enabling you to start writing. Refer to <a href="#Editing_an_existing_page">Editing an existing page</a>, for further information on using editor mode.</p> - -<h2 id="Refreshing_page_content">Refreshing page content</h2> - -<p>MDN support of KumaScript macros, and integration of content from other pages can sometimes be hampered by the need for caching of pages, for performance reasons. Pages are built from their source, and this output is cached for future requests. From that moment on, any macros (templates), or integrations (using the macro<span class="templateLink"><code><a href="https://developer.mozilla.org/en-US/docs/Template:Page">Page</a></code></span>), will not reflect later changes made to the macro, its output, or the contents of the integrated material.</p> - -<ul> - <li>To manually update a page, force-refresh your Web browser. MDN detects this, triggering a page rebuild, pulling in updated macro output, and integrating page content.</li> - <li>You can also configure pages to periodically rebuild, automatically. This should not be done unless you expect the page to update frequently. See <a href="/en-US/docs/MDN/Contribute/Tools/Page_regeneration">Page regeneration</a>, for detailed information.</li> -</ul> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="/en-US/docs/MDN/Contribute/Editor">MDN editor guide</a></li> - <li><a href="/en-US/docs/MDN/Contribute/Content/Style_guide">MDN style guide</a></li> -</ul> diff --git a/files/vi/mdn/contribute/howto/index.html b/files/vi/mdn/contribute/howto/index.html deleted file mode 100644 index 08734f5092..0000000000 --- a/files/vi/mdn/contribute/howto/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: How-to guides -slug: MDN/Contribute/Howto -tags: - - Landing - - MDN Meta - - NeedsTranslation - - TopicStub -translation_of: MDN/Contribute/Howto ---- -<div>{{MDNSidebar}}</div><div>{{IncludeSubnav("/en-US/docs/MDN")}}</div> - -<p>These articles provide step-by-step guides to accomplishing specific goals when contributing to MDN.</p> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/vi/mdn/contribute/howto/tag/index.html b/files/vi/mdn/contribute/howto/tag/index.html deleted file mode 100644 index a766f40b5c..0000000000 --- a/files/vi/mdn/contribute/howto/tag/index.html +++ /dev/null @@ -1,376 +0,0 @@ ---- -title: How to properly tag pages -slug: MDN/Contribute/Howto/Tag -translation_of: MDN/Contribute/Howto/Tag ---- -<div>{{MDNSidebar}}</div> - -<p class="summary"><strong>Article tags</strong> are an important way to put visitors in touch with helpful content. Each page should normally have several tags to help keep content organized. <span class="seoSummary">This page explains the best way to tag pages so that our readers can find information and we can keep ourselves organized.</span></p> - -<p>For a help with the user interface for editing tags, see the <a href="/en-US/docs/MDN/Contribute/Editor/Basics#The_tags_box">tagging section</a> in our editor guide.</p> - -<p>Please use tags properly as explained below. If you don't, our automated tools will not correctly generate lists of content, landing pages, and cross-linking of articles.</p> - -<h2 id="How_MDN_uses_tags">How MDN uses tags</h2> - -<p>Tags get used on MDN several ways:</p> - -<dl> - <dt>{{anch("Document category", "Document categorization")}}</dt> - <dd>What type of document is it? Is it a reference? A tutorial? A landing page? Our visitors can use these tags to filter searches, so they're really important!</dd> - <dt>{{anch("Topic", "Topic identification")}}</dt> - <dd>What is the article about? Is it about an API? The DOM? Graphics? Again, these tags are important because they can filter searches.</dd> - <dt>{{anch("API identification")}}</dt> - <dd>Reference pages about an API need to identify the specific component of the API being documented (that is, what interface it's a part of, and what property or method the page covers, if applicable).</dd> - <dt>{{anch("Technology status")}}</dt> - <dd>What's the status of the technology? Is it non-standard? Obsolete or deprecated? Experimental?</dd> - <dt>{{anch("Skill level")}}</dt> - <dd>For tutorials and guides, how advanced is the material covered by the article?</dd> - <dt>{{anch("Document metadata")}}</dt> - <dd>The writing community uses tags to keep track of which pages need what kind of work.</dd> -</dl> - -<h2 id="Tag_type_guide">Tag type guide</h2> - -<p>Here's a quick guide to the types of tags and possible values for them.</p> - -<h3 id="Document_category">Document category</h3> - -<p>When you tag an article with one of these categories, you help the automated tools more accurately generate landing pages, tables of contents, and so on. Our new search system will also use these terms so that our visitors can locate reference or guide information at will.</p> - -<p>We use the following category names as standard tagging terms:</p> - -<dl> - <dt><code>{{Tag("Intro")}}</code></dt> - <dd>The article provides introductory material about a topic. Ideally each technology area should have only one "Intro"</dd> - <dt><code>{{Tag("Reference")}}</code></dt> - <dd>The article contains reference material about an API, element, attribute, property, or the like.</dd> - <dt><code>{{Tag("Landing")}}</code></dt> - <dd>The page is a landing page.</dd> - <dt><code>{{Tag("Guide")}}</code></dt> - <dd>The article is a how-to or guide page.</dd> - <dt><code>{{Tag("Example")}}</code></dt> - <dd>The article is a code sample page, or has code samples (that is, actual snippets of useful code, not one-line "syntax examples").</dd> -</dl> - -<h3 id="Topic">Topic</h3> - -<p>By identifying the article's topic area, you are helping generate better search results (and landing pages and navigation as well).</p> - -<p>While there's some room for flexibility here as we identify new topic areas, we try to limit ourselves to the names of APIs or technologies. Some useful examples:</p> - -<ul> - <li><code>{{Tag("HTML")}}</code></li> - <li><code>{{Tag("CSS")}}</code></li> - <li><code>{{Tag("JavaScript")}}</code> (notice the capital "S"!)</li> - <li><code>{{Tag("Document")}}</code></li> - <li><code>{{Tag("DOM")}}</code></li> - <li><code>{{Tag("API")}}</code> for each API's overview, interface, method, and property.</li> - <li><code>{{Tag("Method")}}</code> for each method of an API</li> - <li><code>{{Tag("Property")}}</code> for each property of an API</li> - <li><code>{{Tag("Graphics")}}</code></li> - <li><code>{{Tag("SVG")}}</code></li> - <li><code>{{Tag("WebGL")}}</code></li> - <li><code>{{Tag("Tools")}}</code></li> - <li><code>{{Tag("Web")}}</code></li> - <li><code>{{Tag("Element")}}</code></li> - <li><code>{{Tag("Extensions")}}</code> and <code>{{Tag("WebExtensions")}}</code> for WebExtension documentation.</li> -</ul> - -<p>In general, your topic identification tag should be the name of an interface with a number of related pages (like <a href="/en-US/docs/Web/API/Node">Node</a>, which has many pages for its various properties and methods), or the name of an overall technology type. You might tag a page about WebGL with <code>Graphics</code> and <code>WebGL</code>, for example, but a page about {{HTMLElement("canvas")}} with <code>HTML</code>, <code>Element</code>, <code>Canvas</code>, and <code>Graphics</code>.</p> - -<h4 id="Mozilla-specific_content">Mozilla-specific content</h4> - -<p>These tags are used in Mozilla-specific content only:</p> - -<ul> - <li><code>{{Tag("Mozilla")}}</code></li> - <li><code>{{Tag("Firefox")}}</code></li> - <li><code>{{Tag("Firefox OS")}}</code></li> - <li><code>{{Tag("Gecko")}}</code></li> - <li><code>{{Tag("XUL")}}</code></li> - <li><code>{{Tag("XPCOM")}}</code></li> -</ul> - -<h3 id="API_identification">API identification</h3> - -<p>Within the API reference, each article should identify which part of the API it covers:</p> - -<dl> - <dt><code>{{tag("Interface")}}</code></dt> - <dd>The main article for an interface should have this tag. For example, {{DOMxRef("RTCPeerConnection")}}.</dd> - <dt><code>{{tag("Constructor")}}</code></dt> - <dd>Each interface may have up to one page tagged "Constructor"; this is the interface's constructor. The page should have the same name as the interface, like {{DOMxRef("RTCPeerConnection.RTCPeerConnection()", "RTCPeerConnection()")}}.</dd> - <dt><code>{{tag("Property")}}</code></dt> - <dd>Every article describing a particular property within an interface needs this tag. See {{DOMxRef("RTCPeerConnection.connectionState")}}, for example.</dd> - <dt><code>{{tag("Method")}}</code></dt> - <dd>Each article documenting an interface method needs this tag. See {{DOMxRef("RTCPeerConnection.createOffer()")}} for example.</dd> -</dl> - -<p>In addition, the reference pages need to include interface, property, and method names among their tags. Some examples:</p> - -<dl> - <dt>The interface {{DOMxRef("RTCPeerConnection")}}</dt> - <dd>Include the tag <code>{{Tag("RTCPeerConnection")}}</code> along with the other relevant tags (<code>{{Tag("Interface")}}</code>, <code>{{Tag("WebRTC")}}</code>, <code>{{Tag("WebRTC API")}}</code>, <code>{{Tag("API")}}</code>, <code>{{Tag("Reference")}}</code>, and so forth).</dd> - <dt>The method {{DOMxRef("RTCPeerConnection.createOffer()")}}</dt> - <dd>Include the tags <code>{{Tag("RTCPeerConnection")}}</code> and <code>{{Tag("createOffer")}}</code> (note <em>no</em> parentheses in tag names!) along with the other relevant tags, including <code>{{Tag("Method")}}</code>, <code>{{Tag("WebRTC")}}</code>, <code>{{Tag("WebRTC API")}}</code>, <code>{{Tag("API")}}</code>, <code>{{Tag("Reference")}}</code>, and so forth. Consider including things like <code>{{Tag("Offer")}}</code> and <code>{{Tag("SDP")}}</code>, which are also relevant here.</dd> - <dt>The property {{DOMxRef("RTCPeerConnection.iceConnectionState")}}</dt> - <dd>Include the tags <code>{{Tag("RTCPeerConnection")}}</code> and <code>{{Tag("iceConnectionState")}}</code> along with the other relevant tags, including <code>{{Tag("Property")}}</code>, <code>{{Tag("WebRTC")}}</code>, <code>{{Tag("WebRTC API")}}</code>, <code>{{Tag("API")}}</code> and <code>{{Tag("Reference")}}</code>. Also consider including <code>{{Tag("ICE")}}</code>.</dd> -</dl> - -<h3 id="Technology_status">Technology status</h3> - -<p>To help the reader understand how viable a technology is, we use tags to label pages as to the status of the technology's specification. This isn't as detailed as actually explaining what the spec is and how far the technology has come in the specification process (that's what the Specifications table is for), but it helps the reader judge, at a glance, whether it's a good idea to use the technology described in the article.</p> - -<p>Here are possible values for these tags:</p> - -<dl> - <dt><code>{{Tag("Read-only")}}</code></dt> - <dd>Apply this tag to reference pages which describe a property or attribute which is read-only.</dd> - <dt><code>{{Tag("Non-standard")}}</code></dt> - <dd>Indicates that the technology or API described on the page is not part of a standard, whether it's stable or not in any browsers which implement it (if it's not stable, it should also be {{Tag("Experimental")}}). If you don't use this tag, your readers will assume the technology is standard. The compatibility table on the page should clarify which browser(s) support this technology or API.</dd> - <dt><code>{{Tag("Deprecated")}}</code></dt> - <dd>The technology or API covered on the page is marked as deprecated in the specification, and is likely to eventually be removed, but is generally still available in current versions of browsers.</dd> - <dt><code>{{Tag("Obsolete")}}</code></dt> - <dd>The technology or API has been deemed obsolete and has been removed (or is actively being removed) from all or most current browsers.</dd> - <dt><code>{{Tag("Experimental")}}</code></dt> - <dd>The technology is not standardized, and is an experimental technology or API that may or may not ever become part of a standard. It is also subject to change in the browser engine (typically only one) that implements it. If the technology isn't part of any specification (even in draft form), it should also have the {{tag("Non-standard")}} tag.</dd> - <dt><code>{{Tag("Needs Privileges")}}</code></dt> - <dd>The API requires privileged access to the device on which the code is running.</dd> - <dt><code>{{Tag("Certified Only")}}</code></dt> - <dd>The API only works in certified code.</dd> -</dl> - -<p>These tags are no excuse to leave out the <a href="/en-US/docs/Project:Compatibility_tables">compatibility table</a> in your article! That should always be present.</p> - -<h3 id="Skill_level">Skill level</h3> - -<p>Use the skill-level tag type only for guides and tutorials (that is, pages tagged <code>Guide</code>) to help users choose tutorials based on how familiar they are with a technology. There are three values for this:</p> - -<dl> - <dt><code>{{Tag("Beginner")}}</code></dt> - <dd>Articles designed to introduce the reader to a technology they've never used or have only a passing familiarity with.</dd> - <dt><code>{{Tag("Intermediate")}}</code></dt> - <dd>Articles for users who have gotten started with the technology but aren't experts.</dd> - <dt><code>{{Tag("Advanced")}}</code></dt> - <dd>Articles about stretching the capabilities of a technology and of the reader.</dd> -</dl> - -<h3 id="Document_metadata">Document metadata</h3> - -<p>The writing community uses tags to label articles as requiring specific types of work. Here's a list of the ones we use most:</p> - -<dl> - <dt><code>{{Tag("Draft")}}</code></dt> - <dd>The article is not complete, and is at least in theory still actively being updated (although it's also possible it's been forgotten about). Try to check with the most recent contributors before making changes, in order to avoid potential content collisions.</dd> - <dt><code>{{Tag("NeedsCompatTable")}}</code></dt> - <dd>The article needs a table to specify compatibility of a feature across browsers. <a href="/en-US/docs/MDN/Contribute/Structures/Compatibility_tables">See here</a> for a guide on contributing to browser compatibility.</dd> - <dt><code>{{Tag("NeedsContent")}}</code></dt> - <dd>The article is a stub, or is otherwise lacking information. This tag means that someone should review the content and add more details and/or finish writing the article.</dd> - <dt><code>{{Tag("NeedsExample")}}</code></dt> - <dd>The article needs one or more examples created to help illustrate the article's point. These examples should use the <a href="/en-US/docs/Project:MDN/Contributing/How_to_help/Code_samples">live sample system</a>.</dd> - <dt><code>{{Tag("NeedsLiveSamples")}}</code></dt> - <dd>The article has one or more examples that need to be updated to use the <a href="/en-US/docs/Project:MDN/Contributing/How_to_help/Code_samples">live sample system</a>.</dd> - <dt><code>{{Tag("NeedsMarkupWork")}}</code></dt> - <dd>The article needs improvement to the page markup (usually because the page content consists mostly or entirely of {{HTMLElement("p")}} tags).</dd> - <dt><code>{{Tag("NeedsSpecTable")}}</code></dt> - <dd>The article needs a table to indicate on which specification document(s) the feature was defined.</dd> - <dt><code>{{Tag("NeedsUpdate")}}</code></dt> - <dd>The content is out of date and needs to be updated.</dd> - <dt><code>{{Tag("l10n:exclude")}}</code></dt> - <dd>The content is not really worth localizing and will not appear on localization status pages.</dd> - <dt><code>{{Tag("l10n:priority")}}</code></dt> - <dd>The content is important and should be marked as a priority for MDN translators. Shows up in an extra priority table on localization status pages.</dd> -</dl> - -<h2 id="Putting_it_all_together">Putting it all together</h2> - -<p>So to each page you assign tags from several tag types, for example</p> - -<dl> - <dt>A tutorial about WebGL for beginners</dt> - <dd>{{Tag("WebGL")}}, {{Tag("Graphics")}}, {{Tag("Guide")}}, {{Tag("Beginner")}}</dd> - <dt>Reference page for {{HTMLElement("canvas")}}</dt> - <dd>{{Tag("Canvas")}}, {{Tag("HTML")}}, {{Tag("Element")}}, {{Tag("Graphics")}}, {{Tag("Reference")}}</dd> - <dt>A landing page for Firefox OS developer tools</dt> - <dd>{{Tag("Tools")}}, {{Tag("Firefox OS")}}, {{Tag("Landing")}}</dd> -</dl> - -<h2 id="Tagging_and_search_filters">Tagging and search filters</h2> - -<p>Search filters won't work properly unless we tag MDN pages properly. Here's a table of search filters and which tags they look for.</p> - -<div class="blockIndicator note"> -<p><strong>Note:</strong> If multiple tags are listed under "Tag name," that means any one or more of these tags must be present for the article to match.</p> -</div> - -<div class="blockIndicator todo"> -<p><strong>FIXME:</strong> Filter topics have been changed since this was last updated.</p> -</div> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">Filter group</th> - <th scope="col">Search filter name</th> - <th scope="col">Tag name</th> - </tr> - </thead> - <tbody> - <tr> - <th rowspan="23" scope="row" style="vertical-align: baseline;">Topic</th> - <td>APIs and DOM</td> - <td>{{Tag("API")}} || {{Tag("DOM")}} {{Deprecated_Inline}}</td> - </tr> - <tr> - <td>Add-ons & Extensions {{Deprecated_Inline}}</td> - <td>{{Tag("Add-ons")}} || {{Tag("Extensions")}} || {{Tag("Plugins")}} || {{Tag("Themes")}} || {{Tag("WebExtensions")}}</td> - </tr> - <tr> - <td>CSS</td> - <td>{{Tag("CSS")}}</td> - </tr> - <tr> - <td>Canvas</td> - <td>{{Tag("Canvas")}}</td> - </tr> - <tr> - <td>Firefox</td> - <td>{{Tag("Firefox")}}</td> - </tr> - <tr> - <td>Firefox for Android {{Obsolete_Inline}}</td> - <td>{{Tag("Firefox Mobile")}}</td> - </tr> - <tr> - <td>Firefox for Desktop {{Obsolete_Inline}}</td> - <td>{{Tag("Firefox Desktop")}}</td> - </tr> - <tr> - <td>Firefox OS</td> - <td>{{Tag("Firefox OS")}}</td> - </tr> - <tr> - <td>Games</td> - <td>{{Tag("Games")}}</td> - </tr> - <tr> - <td>HTML</td> - <td>{{Tag("HTML")}}</td> - </tr> - <tr> - <td>HTTP</td> - <td>{{Tag("HTTP")}}</td> - </tr> - <tr> - <td>JavaScript</td> - <td>{{Tag("JavaScript")}}</td> - </tr> - <tr> - <td>Marketplace {{Non-standard_Inline}}</td> - <td>{{Tag("Marketplace")}}</td> - </tr> - <tr> - <td>MathML</td> - <td>{{Tag("MathML")}}</td> - </tr> - <tr> - <td>Mobile</td> - <td>{{Tag("Mobile")}}</td> - </tr> - <tr> - <td>Open Web Apps {{Non-standard_Inline}}</td> - <td>{{Tag("Apps")}}</td> - </tr> - <tr> - <td>SVG</td> - <td>{{Tag("SVG")}}</td> - </tr> - <tr> - <td>Web Development</td> - <td>{{Tag("Web Development")}}</td> - </tr> - <tr> - <td>Web Standards</td> - <td>{{Tag("Web")}}</td> - </tr> - <tr> - <td>WebExtensions</td> - <td>{{Tag("WebExtensions")}}</td> - </tr> - <tr> - <td>WebGL</td> - <td>{{Tag("WebGL")}}</td> - </tr> - <tr> - <td>XPCOM {{Non-standard_Inline}}</td> - <td>{{Tag("XPCOM")}}</td> - </tr> - <tr> - <td>XUL {{Non-standard_Inline}}</td> - <td>{{Tag("XUL")}}</td> - </tr> - <tr> - <th rowspan="3" scope="row" style="vertical-align: baseline; white-space: nowrap;">{{anch("Skill level")}}</th> - <td>I'm an Expert</td> - <td>{{Tag("Advanced")}}</td> - </tr> - <tr> - <td>Intermediate</td> - <td>{{Tag("Intermediate")}}</td> - </tr> - <tr> - <td>I'm Learning</td> - <td>{{Tag("Beginner")}}</td> - </tr> - <tr> - <th rowspan="7" scope="row" style="vertical-align: baseline; white-space: nowrap;">Document type</th> - <td>Docs</td> - <td><em>This restricts the search to docs content, leaving out Hacks and other MDN content.</em></td> - </tr> - <tr> - <td>Demos</td> - <td><em>This includes Demo Studio content in the search results.</em></td> - </tr> - <tr> - <td>Tools</td> - <td>{{Tag("Tools")}}</td> - </tr> - <tr> - <td>Code Samples</td> - <td>{{Tag("Example")}}</td> - </tr> - <tr> - <td>How-To & Tutorial</td> - <td>{{Tag("Guide")}}</td> - </tr> - <tr> - <td>Developer Profiles</td> - <td><em>This includes developer profiles from the MDN site in the search results.</em></td> - </tr> - <tr> - <td>External Resources</td> - <td><em>The dev team is still figuring this out...</em></td> - </tr> - </tbody> -</table> - -<h2 id="Tagging_problems_you_can_fix">Tagging problems you can fix</h2> - -<p>There are several kinds of tag problems you can help fix:</p> - -<dl> - <dt>No tags</dt> - <dd>Generally articles should have at <em>least</em> a "{{anch("Document category", "category")}}" tag and a "{{anch("Topic", "topic")}}" tag. Usually other tags are appropriate as well, but if you can help us ensure that the minimum tags are present, you'll be a documentation hero!</dd> - <dt>Tags that don't follow our tagging standards</dt> - <dd>Please fix any documents whose tags don't follow the standards on this page.<br> - Note that you may occasionally see some localized tags (such as <code>Référence</code>) showing up on some English pages. This was due to a <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776048">bug in Kuma</a>, which caused the tags to reappear even if they were deleted. That bug has <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=776048#c37">since been fixed</a>, so any remaining localized tags can be cleaned up if they're spotted.</dd> - <dt>Incorrect tags</dt> - <dd>If you're looking at an article about HTML and it's tagged "JavaScript", that's probably wrong! Likewise, if an article discusses Mozilla internals but has a "Web" tag, that's probably wrong too. Remove these tags and add the right tags if they aren't already there. Please also correct misspelled tags (e.g., "Javascript" will still match, since tags are case-insensitive, but let's not be sloppy!).</dd> - <dt>Missing tags</dt> - <dd>If an article has some but not all of the tags it needs, feel free to add more. For example, if a page in JavaScript reference is (correctly) tagged "JavaScript" but nothing else, you're invited to tag the page "Reference" or {{anch("Document category", "another category tag")}} as well!</dd> - <dt>Tag spam</dt> - <dd>This insidious beast is the most revolting tag problem of all: some Web vermin has deposited its droppings in the page tags (like "Free warez!" or "Hey I was browsing your site and wanted to ask you if you could help me solve this problem I'm having with Flash crashing all the time"). We've got to delete these right away! They're ugly, they're hard to manage if they're allowed to linger too long, and they're terrible for {{Glossary("SEO")}}.</dd> -</dl> - -<p>If you see one (or more) of these problems, please <a href="/en-US/docs/Project:MDN/Contributing/Getting_started#Logging_into_MDN">log into MDN</a> and click EDIT at the top right of the MDN window. Once the editor loads up, scroll down to the bottom of the page, where you'll see the tag box. For more details on the tagging interface, see "<a href="/en-US/docs/Project:MDN/Contributing/Editor_guide#The_tags_box">The tags box</a>" in the <a href="/en-US/docs/Project:MDN/Contributing/Editor_guide">MDN editor guide</a>.</p> diff --git a/files/vi/mdn/contribute/index.html b/files/vi/mdn/contribute/index.html deleted file mode 100644 index d0f126c32e..0000000000 --- a/files/vi/mdn/contribute/index.html +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Contributing to MDN -slug: MDN/Contribute -tags: - - Documentation - - Guide - - Landing - - MDN - - NeedsTranslation - - TopicStub -translation_of: MDN/Contribute ---- -<div>{{MDNSidebar}}</div> - -<p><font><font>Chào mừng bạn! </font><font>Bằng cách truy cập vào trang này, bạn đã thực hiện bước đầu tiên để trở thành người đóng góp cho MDN. </font></font></p> - -<p><span class="seoSummary"><font><font>Hướng dẫn được liệt kê ở đây bao gồm tất cả các khía cạnh đóng góp cho MDN, bao gồm hướng dẫn về phong cách, hướng dẫn sử dụng trình biên tập và công cụ của chúng tôi và hơn thế nữa. </font><font>Vui lòng đảm bảo bạn đã đọc (và tuân thủ) </font></font><a href="https://www.mozilla.org/en-US/about/legal/terms/mozilla/"><font><font>Điều khoản của Mozilla</font></font></a><font><font> trước khi chỉnh sửa hoặc tạo bất kỳ trang nào. </font></font></span></p> - -<p>Nếu bạn chưa từng đóng góp cho MDN trước đây, bài viết <a href="/vi/docs/MDN/Getting_started">Bắt Đầu</a> sẽ hướng dẫn bạn chọn một nhiệm vụ để có thể bắt đầu đóng góp ngay.</p> - -<div class="row topicpage-table"> -<div class="section"> -<h2 id="Hướng_dẫn_của_cộng_tác_viên"><font><font>Hướng dẫn của cộng tác viên</font></font></h2> - -<dl> - <dt><a href="/en-US/docs/MDN/Getting_started"><font><font>Bắt đầu</font></font></a></dt> - <dd><font><font>Hướng dẫn bắt đầu nhanh để thiết lập và đóng góp đầu tiên của bạn.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Style_guide"><font><font>Hướng dẫn về nội dung và phong cách</font></font></a></dt> - <dd><font><font>Hướng dẫn về nội dung và hướng dẫn phong cách MDN cung cấp chi tiết về cách viết phong cách, bố cục trang và kiểu nội dung để nội dung bạn viết phù hợp với phần nội dung còn lại của MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Editor"><font><font>Hướng dẫn biên tập</font></font></a></dt> - <dd><font><font>Hướng dẫn đầy đủ để sử dụng trình soạn thảo của MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Reviewing_articles"><font><font>Bài đánh giá</font></font></a></dt> - <dd><font><font>Hướng dẫn thực hiện các bài đánh giá kỹ thuật và biên tập nội dung bài viết, để giúp chúng tôi đảm bảo rằng tất cả nội dung trên MDN là hữu ích và dễ đọc nhất có thể!</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Conventions"><font><font>Thuật ngữ và công ước</font></font></a></dt> - <dd><font><font>Thuật ngữ của chúng tôi và hướng dẫn công ước cung cấp thông tin bạn có thể sử dụng để đảm bảo rằng bạn sử dụng thuật ngữ chính xác để mô tả mọi thứ.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Community"><font><font>Làm việc với cộng đồng MDN</font></font></a></dt> - <dd><font><font>Hướng dẫn làm việc với cộng đồng của chúng tôi, tìm kiếm sự trợ giúp, và kết nối với những người có câu trả lời cho những câu hỏi phát sinh trong khi bạn đóng góp cho MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/FAQ"><font><font>Các câu hỏi thường gặp</font></font></a></dt> - <dd><font><font>Các mẹo và câu trả lời cho những câu hỏi phổ biến nhất về đóng góp cho MDN.</font></font></dd> -</dl> - -<dl> - <dt><a href="/en-US/docs/MDN/Kuma/Contributing"><font><font>Đóng góp cho Kuma</font></font></a></dt> - <dd><font><font>Hướng dẫn đóng góp cho dự án Kuma. </font><font>Kuma là nền tảng hỗ trợ trang web MDN.</font></font></dd> -</dl> -</div> - -<div class="section"> -<h2 id="Làm_thế_nào_để..."><font><font>Làm thế nào để...</font></font></h2> - -<p><font><font>Chúng tôi </font></font><a href="/en-US/docs/MDN/Contribute/Howto"><font><font>làm thế nào để hướng dẫn</font></font></a><font><font> cung cấp từng bước hướng dẫn để giúp bạn hoàn thành nhiệm vụ cụ thể khi góp phần MDN.</font></font></p> - -<dl> - <dt><a href="/en-US/docs/MDN/Contribute/Howto/Document_a_CSS_property"><font><font>Làm thế nào để tài liệu một tài sản CSS</font></font></a></dt> - <dd><font><font>Hướng dẫn viết tài liệu về thuộc tính CSS. </font><font>Tất cả tài liệu thuộc tính CSS phải khớp với kiểu và bố cục được mô tả trong bài viết này.</font></font></dd> - <dt><font><font>Làm thế nào để tài liệu một phần tử HTML</font></font></dt> - <dd><font><font>Hướng dẫn này để ghi lại các phần tử HTML sẽ đảm bảo rằng các tài liệu mà bạn viết khớp với những người khác trên MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Howto/Tag"><font><font>Cách gắn thẻ trang đúng cách</font></font></a></dt> - <dd><font><font>Hướng dẫn để gắn thẻ trang cung cấp thông tin về các tiêu chuẩn của chúng tôi về gắn thẻ, bao gồm các danh sách các thẻ có ý nghĩa chuẩn trên MDN. </font><font>Theo hướng dẫn này sẽ đảm bảo rằng nội dung của bạn được phân loại đúng, tìm kiếm dễ dàng hơn và cơ chế lọc tìm kiếm hoạt động đúng với các bài viết của bạn.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Howto/Interpret_specifications"><font><font>Làm thế nào để giải thích chi tiết kỹ thuật</font></font></a></dt> - <dd><font><font>Hướng dẫn này sẽ giúp bạn giải thích đúng các tiêu chuẩn Web chuẩn; </font><font>có thể đọc được những điều này có thể là một hình thức nghệ thuật, và biết làm thế nào để làm điều đó sẽ giúp bạn tạo ra các tài liệu tốt hơn.</font></font></dd> -</dl> - -<h2 id="Nội_địa_hoá"><font><font>Nội địa hoá</font></font></h2> - -<dl> - <dt><a href="/en-US/docs/MDN/Contribute/Localize/Tour"><font><font>Tour hướng dẫn bằng tiếng địa phương</font></font></a></dt> - <dd><font><font>Hướng dẫn này sẽ hướng dẫn bạn cách định vị nội dung trên MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Localize/Guide"><font><font>Hướng dẫn bản địa hoá</font></font></a></dt> - <dd><font><font>Hướng dẫn này cung cấp chi tiết về quy trình nội địa hóa cho nội dung MDN.</font></font></dd> - <dt><a href="/en-US/docs/MDN/Contribute/Localize/Localization_projects"><font><font>Dự án bản địa hoá</font></font></a></dt> - <dd><font><font>Tìm dự án bản địa hoá cho ngôn ngữ của bạn - hoặc, nếu không có, hãy tìm hiểu cách bắt đầu một ngôn ngữ mới!</font></font></dd> -</dl> -</div> -</div> - -<p> </p> diff --git a/files/vi/mdn/guidelines/index.html b/files/vi/mdn/guidelines/index.html deleted file mode 100644 index 8f14102c44..0000000000 --- a/files/vi/mdn/guidelines/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Guidelines -slug: MDN/Guidelines -tags: - - Guidelines - - Landing - - MDN Meta - - NeedsTranslation - - TopicStub -translation_of: MDN/Guidelines ---- -<div>{{MDNSidebar}}</div><div>{{IncludeSubnav("/en-US/docs/MDN")}}</div> - -<p><span class="seoSummary">These guides provide details on how MDN documentation should be written and formatted, as well as how our code samples and other content should be presented.</span> By following these guides, you can ensure that the material you produce is clean and easy to use.</p> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/vi/mdn/guidelines/writing_style_guide/index.html b/files/vi/mdn/guidelines/writing_style_guide/index.html deleted file mode 100644 index 5d422d1b94..0000000000 --- a/files/vi/mdn/guidelines/writing_style_guide/index.html +++ /dev/null @@ -1,808 +0,0 @@ ---- -title: Writing style guide -slug: MDN/Guidelines/Writing_style_guide -tags: - - Hướng dẫn - - Hướng dẫn kiểu MDN - - Hướng dẫn mẫu - - MDN - - MDN Meta - - Tài liệu - - Tài liệu web MDN -translation_of: MDN/Guidelines/Writing_style_guide ---- -<div>{{MDNSidebar}}</div> - -<div>{{IncludeSubnav("/en-US/docs/MDN")}}</div> - -<p><span class="seoSummary">To present documentation in an organized, standardized, and easy-to-read manner, the MDN Web Docs style guide describes how text should be organized, spelled, formatted, and so on. These are guidelines rather than strict rules.</span> We are more interested in content than formatting, so don't feel obligated to learn the style guide before contributing. Do not be upset or surprised, however, if an industrious volunteer later edits your work to conform to this guide.</p> - -<p>The language aspects of this guide apply primarily to English-language documentation. Other languages may have (and are welcome to create) style guides. These should be published as subpages of the localization team's page.</p> - -<p>For style standards that apply to content written for sites other than MDN, refer to the <a href="https://www.mozilla.org/en-US/styleguide/" title="https://www.mozilla.org/en-US/styleguide/">One Mozilla style guide</a>.</p> - -<h2 id="Basics">Basics</h2> - -<p>The best place to start in any extensive publishing style guide is with some very basic text standards to help keep documentation consistent. The following sections outline some of these basics to help you.</p> - -<h3 id="Page_titles">Page titles</h3> - -<p>Page titles are used in search results and also used to structure the page hierarchy in the breadcrumb list at the top of the page. The page title (which is displayed at the top of the page and in the search results) can be different from the page "slug", which is the portion of the page's URL following "<em><locale>/docs/</em>".</p> - -<h4 id="Title_and_heading_capitalization">Title and heading capitalization</h4> - -<p>Page titles and section headings should use sentence-style capitalization (only capitalize the first word and proper nouns) rather than headline-style capitalization:</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: "A new method for creating JavaScript rollovers"</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: "A New Method for Creating JavaScript Rollovers"</li> -</ul> - -<p>We have many older pages that were written before this style rule was established. Feel free to update them as needed if you like. We're gradually getting to them.</p> - -<h4 id="Choosing_titles_and_slugs">Choosing titles and slugs</h4> - -<p>Page slugs should be kept short; when creating a new level of hierarchy, the new level's component in the slug should just be a word or two.</p> - -<p>Page titles, on the other hand, may be as long as you like, within reason, and they should be descriptive.</p> - -<h4 id="Creating_new_subtrees">Creating new subtrees</h4> - -<p>When you need to add some articles about a topic or subject area, you will typically do so by creating a landing page, then adding subpages for each of the individual articles. The landing page should open with a paragraph or two describing the topic or technology, then provide a list of the subpages with descriptions of each page. You can automate the insertion of pages into the list using some macros we've created.</p> - -<p>For example, consider the <a href="/en-US/docs/Web/JavaScript">JavaScript</a> guide, which is structured as follows:</p> - -<ul> - <li><a href="/en-US/docs/Web/JavaScript/Guide" title="JavaScript/Guide">JavaScript/Guide</a> – Main table-of-contents page</li> - <li><a href="/en-US/docs/Web/JavaScript/Guide/JavaScript_Overview" title="JavaScript/Guide/JavaScript_Overview">JavaScript/Guide/JavaScript Overview</a></li> - <li><a href="/en-US/docs/JavaScript/Guide/Functions" title="JavaScript/Guide/Functions">JavaScript/Guide/Functions</a></li> - <li><a href="/en-US/docs/JavaScript/Guide/Details_of_the_Object_Model" title="JavaScript/Guide/Details_of_the_Object_Model">JavaScript/Guide/Details of the Object Model</a></li> -</ul> - -<p>Try to avoid putting your article at the top of the hierarchy, which slows the site down and makes search and site navigation less effective.</p> - -<div class="blockIndicator note"> -<p>Note: Adding articles requires <a href="https://wiki.developer.mozilla.org/en-US/docs/MDN/Contribute/Howto/Create_and_edit_pages#Getting_page-creation_permissions">page creation privileges</a>.</p> -</div> - -<h3 id="General_article_content_guidelines">General article content guidelines</h3> - -<p>When writing any document, it's important to know how much to say. If you ramble on too long, or provide excessive detail, the article becomes tedious to read and nobody will use it. Getting the amount of coverage right is important for several reasons. Among those reasons: to ensure that the reader finds the information they truly need, and to provide enough quality material for search engines to adequately analyze and rank the article.</p> - -<p>We'll discuss the former (providing the information the reader may need) here. To learn a little about ensuring that pages are properly classified and ranked by search engines, see the article <a href="/en-US/docs/MDN/Contribute/Howto/Write_for_SEO">How to write for SEO on MDN</a>.</p> - -<p>The goal is to write pages that include all the information that readers may need without going on too long about it all. We have a few recommendations in this area.</p> - -<h4 id="Consider_your_audience">Consider your audience</h4> - -<p>Keep in mind that these are guidelines. Some of these tips may not apply in every case. Certainly keep your article's audience in mind. An article on advanced network techniques likely doesn't need to go into as much detail about basic networking concepts as the typical article on networking code, for instance.</p> - -<h4 id="Provide_a_useful_summary">Provide a useful summary</h4> - -<p>Make sure the article's summary—that is, the opening paragraph or paragraphs before the first heading—provides enough information for the reader to understand if the article is likely to be covering what they're interested in reading about.</p> - -<p>In guide or tutorial content, the summary should let the reader know what topics will be covered and what they're already expected to know, if anything. It should mention the technology, technologies, and/or APIs that are being documented or discussed, with links to those, and it should offer hints as to the situations in which the article's contents might be useful.</p> - -<h5 id="Example_Too_short!">Example: Too short!</h5> - -<p>This example of a summary is far too short. It leaves out too much information, such as what it means exactly to "stroke" text, where the text is drawn, and so forth.</p> - -<div class="example-bad"> -<p><strong><code>CanvasRenderingContext2D.strokeText()</code></strong> draws a string.</p> -</div> - -<h5 id="Example_Too_long!">Example: Too long!</h5> - -<p>Here, we've updated the summary, but now it's far too long. Too much detail is included, and the text gets far too much into other methods and properties.</p> - -<p>Instead, the summary should focus on the <code>strokeText()</code> method, and should refer to the appropriate guide where the other details are offered.</p> - -<div class="example-bad"> -<p>When called, the Canvas 2D API method <strong><code>CanvasRenderingContext2D.strokeText()</code></strong> strokes the characters in the specified string beginning at the coordinates specified, using the current pen color. In the terminology of computer graphics, "stroking" text means to draw the outlines of the glyphs in the string without filling in the contents of each character with color.</p> - -<p>The text is drawn using the context's current font as specified in the context's {{domxref("CanvasRenderingContext2D.font", "font")}} property.</p> - -<p>The placement of the text relative to the specified coordinates are determined by the context's <code>textAlign</code>, <code>textBaseline</code>, and <code>direction</code> properties. <code>textAlign</code> controls the placement of the string relative to the X coordinate specified; if the value is <code>"center"</code>, then the string is drawn starting at <code>x - (stringWidth / 2)</code>, placing the specified X-coordinate in the middle of the string. If the value is <code>"left"</code>, the string is drawn starting at the specified value of <code>x</code>. And if <code>textAlign</code> is <code>"right"</code>, the text is drawn such that it ends at the specified X-coordinate.</p> - -<p>(etc etc etc...)</p> - -<p>You can, optionally, provide a fourth parameter that lets you specify a maximum width for the string, in pixels. If you provide this parameter, the text is compressed horizontally or scaled (or otherwise adjusted) to fit inside a space that wide when being drawn.</p> - -<p>You can call the <strong><code>fillText()</code></strong> method to draw a string's characters as filled with color instead of only drawing the outlines of the characters.</p> -</div> - -<h5 id="Example_Much_better!">Example: Much better!</h5> - -<p>Here we see a much better overview for the <code>strokeText()</code> method.</p> - -<div class="example-good"> -<p>The {{domxref("CanvasRenderingContext2D")}} method <code><strong>strokeText()</strong></code>, part of the <a href="/en-US/docs/Web/API/Canvas_API">Canvas 2D API</a>, strokes—that is, draws the outlines of—the characters of a specified string, anchored at the position indicated by the given X and Y coordinates. The text is drawn using the context's current {{domxref("CanvasRenderingContext2D.font", "font")}}, and is justified and aligned according to the {{domxref("CanvasRenderingContext2D.textAlign", "textAlign")}}, {{domxref("CanvasRenderingContext2D.textBaseline", "textBaseline")}}, and {{domxref("CanvasRenderingContext2D.direction", "direction")}} properties.</p> - -<p>For more details and further examples, see {{SectionOnPage("/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Drawing_graphics", "Text")}} in the Learning Area as well as our main article on the subject, <a href="/en-US/docs/Web/API/Canvas_API/Tutorial/Drawing_text">Drawing text</a>.</p> -</div> - -<h4 id="Include_all_relevant_examples">Include all relevant examples</h4> - -<p>More pages should have examples than not. The majority of pages probably deserve multiple examples, in fact.</p> - -<p>It's important to ensure that you use examples to clarify what every parameter is used for, and to clarify any edge cases that may exist. You should also use examples to demonstrate solutions for common tasks, and you should use examples to demonstrate solutions to problems that may arise.</p> - -<p>Each example should be preceded by text explaining what the example does and anything the reader should know before beginning to read or try out the example.</p> - -<h5 id="Code_Examples">Code Examples</h5> - -<p>Each piece of code should include an explanation of how it works. Keep in mind that it may make sense to break up a large piece of code into smaller portions so they can be described individually.</p> - -<p>The text following each piece of code should explain anything relevant, using an appropriate level of detail.</p> - -<ul> - <li>If the code is very simple and doesn't really feature anything directly related to the API being documented, you may only give a quick summary of what it is and why it's there.</li> - <li>If the code is intricate, uses the API being documented, or is technically creative, you should provide a more detailed explanation.</li> -</ul> - -<p>When using the live sample system, it's helpful to be aware that all of the {{HTMLElement("pre")}} blocks in the area that contains the sample are concatenated together before running the example, which lets you break any or all of the HTML, CSS, and JavaScript into multiple segments, each optionally with its own descriptions, headings, and so forth. This makes documenting code incredibly powerful and flexible.</p> - -<h4 id="Overly-short_articles_are_hard_to_find">Overly-short articles are hard to find</h4> - -<p>If an article is "thin"—that is, too short—it may not be indexed properly (or at all) by search engines. As a rule of thumb, the article's body text should be at least 250–300 words. Don't artificially inflate a page, but treat this guideline as a minimum target length when possible.</p> - -<h3 id="Sections_paragraphs_and_newlines">Sections, paragraphs, and newlines</h3> - -<p>Use heading levels in decreasing order: {{HTMLElement("h2")}} then {{HTMLElement("h3")}} then {{HTMLElement("h4")}}, without skipping levels.</p> - -<p>H2 is the highest level allowed because H1 is reserved for the page title. If you need more than three or four levels of headers, consider breaking up the article into several smaller articles with a landing page, and linking them together using the following macros: {{TemplateLink("Next")}}, {{TemplateLink("Previous")}}, and {{TemplateLink("PreviousNext")}}.</p> - -<h4 id="Heading_dos_and_donts">Heading dos and donts</h4> - -<ul> - <li>Don't create single subsections. Don't subdivide a topic into a single subtopic. It's either two subheadings or more, or none at all.</li> - <li>Don't use styles and classes within headings. This includes the {{HTMLElement("code")}} element for code terms. So don't make a heading "Using the <code>SuperAmazingThing</code> interface". It should instead just be "Using the SuperAmazingThing interface".</li> - <li>Avoid using macros within headings (except for certain macros that are specifically designed to be used in headings).</li> - <li>Don't create "bumping heads." These are headings followed immediately by a subheading, with no content text in between. This doesn't look good, and leaves readers without any explanatory text at the beginning of the outer section.</li> -</ul> - -<p>The <kbd>Enter</kbd> (or <kbd>Return</kbd>) key on your keyboard starts a new paragraph. To insert a newline, rather than a new paragraph (that is, to create a {{HTMLElement("br")}} instead of a {{HTMLElement("p")}}), hold down the <kbd>Shift</kbd> key while pressing <kbd>Enter</kbd>.</p> - -<h3 id="Lists">Lists</h3> - -<p>Lists should be formatted and structured uniformly across all contributions. Individual list items should be written with suitable punctuation, regardless of the list format. However, depending on the type of list you are creating, you will want to adjust your writing as described in the sections below.</p> - -<h4 id="Bulleted_lists">Bulleted lists</h4> - -<p>Bulleted lists should be used to group related pieces of concise information. Each item in the list should follow a similar sentence structure. Phrases and sentences in bulleted lists should include standard punctuation. Periods must appear at the end of each sentence in a bulleted list, including the item's final sentence, just as would be expected in a paragraph.</p> - -<p>An example of a correctly structured bulleted list:</p> - -<div class="example-good"> -<p>In this example we should include:</p> - -<ul> - <li>A condition, with a brief explanation.</li> - <li>A similar condition, with a brief explanation.</li> - <li>Yet another condition, with some further explanation.</li> -</ul> -</div> - -<p>Note how the same sentence structure repeats from bullet to bullet. In this example, each bullet point states a condition followed by a comma and a brief explanation, and each item in the list ends with a period.</p> - -<h4 id="Numbered_lists">Numbered lists</h4> - -<p>Numbered lists are used primarily to enumerate steps in a set of instructions. Because instructions can be complex, clarity is a priority, especially if the text in each list item is lengthy. As with bulleted lists, follow standard punctuation usage.</p> - -<p>An example of a correctly structured numbered list:</p> - -<div class="example-good"> -<p>In order to correctly structure a numbered list, you should:</p> - -<ol> - <li>Open with a heading or brief paragraph to introduce the instructions. It's important to provide the user with context before beginning the instructions.</li> - <li>Start creating your instructions, and keep each step in its own numbered item. Your instructions may be quite extensive, so it is important to write clearly and use correct punctuation.</li> - <li>After you have finished your instructions, close off the numbered list with a brief summary or explanation of the expected outcome upon completion.</li> -</ol> - -<p>This is an example of writing a closing explanation. We have created a short numbered list that provides instructive steps to produce a numbered list with the correct formatting.</p> -</div> - -<p>Note how the items in numbered lists read like short paragraphs. Because numbered lists are routinely used for instructional purposes, or to walk someone through an orderly procedure, be sure to keep each item focused: one item per number or step.</p> - -<h3 id="Text_formatting_and_styles">Text formatting and styles</h3> - -<p>Use the <strong>"Formatting Styles"</strong> drop-down list to apply predefined styles to selected content.</p> - -<div class="note">The <strong>"Note Box"</strong> style is used to call out important notes, like this one.</div> - -<div class="warning">Similarly, the <strong>"Warning Box"</strong> style creates warning boxes like this.</div> - -<p>Unless specifically instructed to do so, <em>do not</em> use the HTML <code>style</code> attribute to manually style content. If you can't do it using a predefined class, ask for help in the <a href="https://discourse.mozilla.org/c/mdn">MDN discussion forum</a>.</p> - -<h3 id="Code_sample_style_and_formatting">Code sample style and formatting</h3> - -<div class="note"> -<p><strong>Note</strong>: This section deals with the styling/formatting of code as it appears on an MDN article. If you want guidelines on actually writing code examples, see our <a href="/en-US/docs/MDN/Contribute/Guidelines/Code_samples">Code sample guidelines</a>.</p> -</div> - -<h4 id="Tabs_and_line_breaks">Tabs and line breaks</h4> - -<p>Use two spaces per tab in all code examples. Indent the code cleanly, with open-brace ("<code>{</code>") characters on the same line as the statement that opens the block. For example:</p> - -<pre class="brush: js notranslate">if (condition) { - /* handle the condition */ -} else { - /* handle the "else" case */ -} -</pre> - -<p>Long lines shouldn't be allowed to stretch off horizontally to the extent that they require horizontal scrolling to read. Instead, break at natural breaking points. Some examples follow:</p> - -<pre class="brush: js notranslate">if (class.CONDITION || class.OTHER_CONDITION || class.SOME_OTHER_CONDITION - || class.YET_ANOTHER_CONDITION ) { - /* something */ -} - -var toolkitProfileService = Components.classes["@mozilla.org/toolkit/profile-service;1"] - .createInstance(Components.interfaces.nsIToolkitProfileService); -</pre> - -<h4 id="Inline_code_formatting">Inline code formatting</h4> - -<p>Use the "Code" button (labeled with two angle brackets "<>") to apply inline code-style formatting to function names, variable names, and method names. (This uses the {{HTMLElement("code")}} element). For example: "the <code class="js plain">frenchText()</code> function".</p> - -<p>Method names should be followed by a pair of parentheses: <code>doSomethingUseful()</code>. The parentheses help differentiate methods from other code terms.</p> - -<h4 id="Syntax_highlighting">Syntax highlighting</h4> - -<p><img alt="Screenshot of the 'Syntax Highlighter' menu." src="https://mdn.mozillademos.org/files/12682/Language%20list.png" style="border-style: solid; border-width: 1px; float: right; margin: 2px 4px;">Entire lines (or multiple lines) of code should be formatted using syntax highlighting rather than the {{HTMLElement("code")}} element. Select the appropriate language from the language list button (the one with the two code blocks), as seen in the screenshot to the right. This will insert a preformatted code box with line numbers and syntax highlighting for the chosen language.</p> - -<div class="note"> -<p><strong>Note:</strong> <em>Do not</em> use the {{HTMLElement("code")}} element inside the {{HTMLElement("pre")}} block!</p> - -<p>While this structure is used on some sites, we do not do so on MDN; nesting these elements will break certain aspects of our styling.</p> -</div> - -<p>The following example shows text with JavaScript formatting:</p> - -<div class="line number2 index1 alt1"> -<pre class="brush: js notranslate">for (let i = 0, j = 9; i <= 9; i++, j--) - document.writeln("a[" + i + "][" + j + "]= " + a[i][j]);</pre> -</div> - -<p>If no appropriate language is available, use ("No Highlight" in the language menu). This will result in code without syntax highlighting:</p> - -<pre class="brush: plain notranslate">x = 42;</pre> - -<h4 id="Syntax_definitions">Syntax definitions</h4> - -<p>When writing the syntax description section of a reference page, use the <em>"Syntax Box"</em> option in the <strong>"Styles"</strong> drop-down menu in the editor toolbar. This creates a specially-formatted box used specifically for syntax definitions, distinguishing them from other code blocks.</p> - -<h4 id="Blocks_not_referring_to_code">Blocks not referring to code</h4> - -<p>There are a few use cases where a <code><pre></code> block does not refer to code and doesn't have syntax highlighting nor line numbers. In such cases you should add a <code><pre></code> without a <code>class</code> attribute. Those cases include things like tree structures:</p> - -<pre class="notranslate">root/ - - folder1/ - file1 - - folder2/ - file2 - file3 -</pre> - -<p>To create preformatted content without syntax highlighting and line numbers click the "pre" button in the toolbar. Then start to type the text.</p> - -<h4 id="Styling_mentions_of_HTML_elements">Styling mentions of HTML elements</h4> - -<p>There are specific rules to follow when writing about HTML elements. These rules produce consistent descriptions of elements and their components. They also ensure correct linking to detailed documentation.</p> - -<dl> - <dt>Element names</dt> - <dd>Use the {{TemplateLink("HTMLElement")}} macro, which creates a link to the page for that element. For example, writing \{{HTMLElement("title")}} produces "{{HTMLElement("title")}}". If you don't want to create a link, <strong>enclose the name in angle brackets</strong> and use the "Inline Code" style (e.g., <code><title></code>).</dd> - <dt>Attribute names</dt> - <dd>Use "Inline Code" style to put attribute names in <code>code font</code>. Additionally, put them in <strong><code>bold face</code></strong> when the attribute is mentioned in association with an explanation of what it does, or the first time it's used in the article.</dd> - <dt>Attribute definitions</dt> - <dd>Use the {{TemplateLink("htmlattrdef")}} macro (e.g., <span class="nowiki">\{{htmlattrdef("type")}}</span>) for the definition term, so that it can be linked to from other pages easily by simply using the {{TemplateLink("htmlattrxref")}} macro (e.g., <span class="nowiki">\{{htmlattrxref("attr","element")}}</span>) to reference attribute definitions.</dd> - <dt>Attribute values</dt> - <dd>Use the "Inline Code" style to apply <code><code></code> to attribute values, and don't use quotation marks around string values, unless needed by the syntax of a code sample.</dd> - <dd>For example: "When the <code>type</code> attribute of an <code><input></code> element is set to <code>email</code> or <code>tel</code> ..."</dd> -</dl> - -<h3 id="Latin_abbreviations">Latin abbreviations</h3> - -<h4 id="In_notes_and_parentheses">In notes and parentheses</h4> - -<ul> - <li>Common Latin abbreviations (etc., i.e., e.g.) may be used in parenthetical expressions and notes. Use periods in these abbreviations, followed by a comma or other appropriate punctuation. - <ul> - <li><span class="correct"><strong>Correct</strong></span>: Web browsers (e.g., Firefox) can be used ...</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Web browsers e.g. Firefox can be used ...</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Web browsers, e.g. Firefox, can be used ...</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Web browsers, (eg: Firefox) can be used ...</li> - </ul> - </li> -</ul> - -<h4 id="In_running_text">In running text</h4> - -<ul> - <li>In regular text (i.e., text outside of notes or parentheses), use the English equivalent of the abbreviation. - <ul> - <li><span class="correct"><strong>Correct</strong></span>: ... web browsers, and so on.</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: ... web browsers, etc.</li> - <li><span class="correct"><strong>Correct</strong></span>: Web browsers such as Firefox can be used ...</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Web browsers e.g. Firefox can be used ...</li> - </ul> - </li> -</ul> - -<h4 id="Meanings_and_English_equivalents_of_Latin_abbreviations">Meanings and English equivalents of Latin abbreviations</h4> - -<table class="fullwidth-table"> - <thead> - <tr> - <th scope="col">Abbrev</th> - <th scope="col">Latin</th> - <th scope="col">English</th> - </tr> - </thead> - <tbody> - <tr> - <td>cf.</td> - <td><em>confer</em></td> - <td>compare</td> - </tr> - <tr> - <td>e.g.</td> - <td><em>exempli gratia</em></td> - <td>for example</td> - </tr> - <tr> - <td>et al.</td> - <td><em>et alii</em></td> - <td>and others</td> - </tr> - <tr> - <td>etc.</td> - <td><em>et cetera</em></td> - <td>and so forth, and so on</td> - </tr> - <tr> - <td>i.e.</td> - <td><em>id est</em></td> - <td>that is, in other words</td> - </tr> - <tr> - <td>N.B.</td> - <td><em>nota bene</em></td> - <td>note well</td> - </tr> - <tr> - <td>P.S.</td> - <td><em>post scriptum</em></td> - <td>postscript</td> - </tr> - </tbody> -</table> - -<div class="note"> -<p>Always consider whether it's truly beneficial to use a Latin abbreviation. Some of these are used so rarely that many readers won't understand the meaning, and others are often confused with one another.</p> - -<p>Also, be sure that <em>you</em> use them correctly, if you choose to do so. For example, be careful not to confuse "e.g." with "i.e.", which is a common error.</p> -</div> - -<h3 id="Acronyms_and_abbreviations">Acronyms and abbreviations</h3> - -<h4 id="Capitalization_and_periods">Capitalization and periods</h4> - -<p>Use full capitals and delete periods in all acronyms and abbreviations, including organizations such as "US" and "UN".</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: XUL</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: X.U.L.; Xul</li> -</ul> - -<h4 id="Expansion">Expansion</h4> - -<p>On the first mention of a term on a page, expand acronyms likely to be unfamiliar to users. When in doubt, expand it, or, better, link it to the article or <a href="/en-US/docs/Glossary">glossary</a> entry describing the technology.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: "XUL (XML User Interface Language) is Mozilla's XML-based language..."</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: "XUL is Mozilla's XML-based language..."</li> -</ul> - -<h4 id="Plurals_of_acronyms_and_abbreviations">Plurals of acronyms and abbreviations</h4> - -<p>For plurals of acronyms or abbreviations, add <em>s</em>. Don't use an apostrophe. Ever. Please.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: CD-ROMs</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: CD-ROM's</li> -</ul> - -<h4 id="Versus_vs._and_v.">"Versus", "vs.", and "v."</h4> - -<p>The contraction "vs." is preferred.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: this vs. that</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: this v. that</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: this versus that</li> -</ul> - -<h3 id="Capitalization">Capitalization</h3> - -<p>Use standard English capitalization rules in body text, and capitalize "World Wide Web." It is acceptable to use lower case for "web" (used alone or as a modifier) and "internet;" this guideline is a change from a previous version of this guide, so you may find many instances of "Web" and "Internet" on MDN. Feel free to change these as you are making other changes, but editing an article just to change capitalization is not necessary.</p> - -<p>Keyboard keys should use sentence-style capitalization, not all-caps capitalization. For example, "Enter" not "ENTER." The only exception is that if you wish to abbreviate the name of the "Escape" key, you may use "ESC".</p> - -<p>Certain words should always be capitalized (such as trademarks which include capital letters), or words derived from the name of a person (unless it's being used within code, and the rules of the language in which the code is written mandate lower-casing). Some examples:</p> - -<ul> - <li>Boolean (named for English mathematician and logician {{interwiki("wikipedia", "George Boole")}})</li> - <li>JavaScript (a trademark of Oracle Corporation, it should always be written as trademarked)</li> - <li>Python, TypeScript, Django, and other programming languages and framework names</li> -</ul> - -<h3 id="Contractions">Contractions</h3> - -<p>Our writing style tends to be casual, so you should feel free to use contractions (e.g., "don't", "can't", "shouldn't"), if you prefer.</p> - -<h3 id="Pluralization">Pluralization</h3> - -<p>Use English-style plurals, not the Latin- or Greek-influenced forms.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: syllabuses, octopuses</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: syllabi, octopi</li> -</ul> - -<h3 id="Hyphenation">Hyphenation</h3> - -<p>Hyphenate compounds when the last letter of the prefix is a vowel and is the same as the first letter of the root.</p> - -<ul> - <li><font color="green"><strong>Correct</strong></font>: email, re-elect, co-op</li> - <li><font color="red"><strong>Incorrect</strong></font>: e-mail, reelect, coop</li> -</ul> - -<h3 id="Gender-neutral_language">Gender-neutral language</h3> - -<p>It is a good idea to use gender-neutral language in any writing where gender is irrelevant to the subject matter, to make the text as inclusive as possible. So, for example, if you are talking about the actions of a specific man, usage of "he"/"his" is fine; but if the subject is a person of either gender, "he"/"his" isn't appropriate.<br> - <br> - Let's take the following example:</p> - -<blockquote> -<p>A confirmation dialog appears, asking the user if he allows the Web page to make use of his Web cam.</p> -</blockquote> - -<blockquote> -<p>A confirmation dialog appears, asking the user if she allows the Web page to make use of her Web cam.</p> -</blockquote> - -<p>Both versions are gender-specific. To fix this, use gender-neutral pronouns:</p> - -<blockquote> -<p>A confirmation dialog appears, asking the user if they allow the Web page to make use of their Web cam.</p> -</blockquote> - -<div class="note"> -<p>MDN allows the use of this very common syntax (which is controversial among usage authorities) to make up for the lack of a neutral gender in English.</p> - -<p>The use of the third-person plural as a gender neutral pronoun (that is, using "they," "them", "their," and "theirs") is an accepted practice, commonly known as "<a href="https://en.wikipedia.org/wiki/Singular_they">singular 'they.'</a>"</p> -</div> - -<p>You can use both genders:</p> - -<blockquote> -<p>A confirmation dialog appears, asking the user if he or she allows the web page to make use of his/her web cam.</p> -</blockquote> - -<p>Making the users plural:</p> - -<blockquote> -<p>A confirmation dialog appears, asking the users if they allow the web page to make use of their web cams.</p> -</blockquote> - -<p>The best solution, of course, is to rewrite and eliminate the pronouns:</p> - -<blockquote> -<p>A confirmation dialog appears, requesting the user's permission for web cam access.</p> -</blockquote> - -<blockquote> -<p>A confirmation dialog box appears, which asks the user for permission to use the web cam.</p> -</blockquote> - -<p>The last way of dealing with the problem is arguably better. It is not only grammatically more correct, but removes some of the complexity associated with dealing with genders across different languages that may have wildly different gender rules. This solution can make translation easier for both readers and localizers.</p> - -<h3 id="Numbers_and_numerals">Numbers and numerals</h3> - -<h4 id="Dates">Dates</h4> - -<p>For dates (not including dates in code samples) use the format "January 1, 1990".</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: February 24, 2006</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: February 24th, 2006; 24 February, 2006; 24/02/2006</li> -</ul> - -<p>Alternately, you can use the YYYY/MM/DD format.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: 2006/02/24</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: 02/24/2006; 24/02/2006; 02/24/06</li> -</ul> - -<h4 id="Decades">Decades</h4> - -<p>For decades, use the format "1990s". Don't use an apostrophe.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: 1990s</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: 1990's</li> -</ul> - -<h4 id="Plurals_of_numerals">Plurals of numerals</h4> - -<p>For plurals of numerals add "s". Don't use an apostrophe.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: 486s</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: 486's</li> -</ul> - -<h4 id="Commas">Commas</h4> - -<p>In running text, use commas only in five-digit and larger numbers.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: 4000; 54,000</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: 4,000; 54000</li> -</ul> - -<h3 id="Punctuation">Punctuation</h3> - -<h4 id="Serial_comma">Serial comma</h4> - -<p><strong>Use the serial comma</strong>. The serial (also known as "Oxford") comma is the comma that appears before the conjunction in a series of three or more items.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: I will travel on trains, planes, and automobiles.</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: I will travel on trains, planes and automobiles.</li> -</ul> - -<div class="note"> -<p>This is in contrast to the <a href="https://www.mozilla.org/en-US/styleguide/" title="https://www.mozilla.org/en-US/styleguide/">One Mozilla style guide</a>, which specifies that the serial comma is not to be used. MDN is an exception to this rule.</p> -</div> - -<h4 id="Apostrophes_and_quotation_marks">Apostrophes and quotation marks</h4> - -<p><strong>Do not use "curly" quotes and quotation marks.</strong> On MDN, we only use straight quotes and apostrophes.</p> - -<p>There are a couple of reasons for this.</p> - -<ol> - <li>We need to choose one or the other for consistency.</li> - <li>If curly quotes or apostrophes make their way into code snippets—even inline ones—readers may copy and paste them, expecting them to function (which they will not).</li> -</ol> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: Please don't use "curly quotes."</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Please don’t use “curly quotes.”</li> -</ul> - -<h3 id="Spelling">Spelling</h3> - -<p>For words with variant spellings, always use their American English spelling.</p> - -<p>In general, use the first entry at <a href="http://www.dictionary.com/">Dictionary.com</a>, unless that entry is listed as a variant spelling or as being primarily used in a non-American form of English. For example, if you <a href="http://www.dictionary.com/browse/behaviour">look up "behaviour"</a>, you find the phrase "Chiefly British" followed by a link to the American standard form, "<a href="http://dictionary.reference.com/browse/behavior">behavior</a>". Do not use variant spellings.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: localize, behavior</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: localise, behaviour</li> -</ul> - -<h3 id="Terminology">Terminology</h3> - -<h4 id="HTML_elements">HTML elements</h4> - -<p>Use "elements" to refer to HTML and XML elements, rather than "tags". In addition, they should almost always be wrapped in "<>", and should be in the {{HTMLElement("code")}} style.</p> - -<p>When you reference a given element for the first time in a section, you should use the {{TemplateLink("HTMLElement")}} macro to create a link to the documentation for the element (unless you're writing within that element's reference document page).</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: the {{HTMLElement("span")}} element</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: the span tag</li> -</ul> - -<h4 id="Parameters_vs._arguments">Parameters vs. arguments</h4> - -<p>The preferred term on MDN is <strong>parameters</strong>. Please avoid the term "arguments" for consistency whenever possible.</p> - -<h4 id="User_interface_actions">User interface actions</h4> - -<p>In task sequences, describe user interface actions using the imperative mood. Identify the user interface element by its label and type.</p> - -<ul> - <li><span class="correct"><strong>Correct</strong></span>: Click the Edit button.</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: Click Edit.</li> -</ul> - -<h3 id="Voice">Voice</h3> - -<p>While the active voice is preferred, the passive voice is also acceptable, given the informal feel of our content. Try to be consistent, though.</p> - -<h2 id="Wiki_markup_and_usage">Wiki markup and usage</h2> - -<h3 id="Links">Links</h3> - -<p>Links are a large part of what makes a wiki a powerful learning and teaching tool. Below you'll find some basic information, but you can find a complete guide to <a href="/en-US/docs/MDN/Contribute/Editor/Links">creating and editing links on MDN</a> in our editor guide.</p> - -<p>We encourage you to create appropriate links among articles; they help improve navigation and discoverability of content, and they provide important context to search engines like Google to help them provide better results. Every page should have a good set of links from words or phrases to other pages that expand upon the relevant ideas. This can be used both to define terms and to provide more in-depth or detailed documentation about a topic, or to connect to a related page that offers examples or information that may be of further interest.</p> - -<p>You can easily create links not only among pages on MDN (internal links) but also to pages outside MDN (external links).</p> - -<p>There are two ways to create links: you explicitly create a link using the Link button in the editor's toolbar—or by pressing <kbd>Ctrl</kbd>+<kbd>K</kbd> (<kbd>Cmd</kbd>-<kbd>K</kbd> on the Mac)—or you can use MDN's powerful macro system to generate links automatically or based on an input value.</p> - -<p>When deciding what text to use as a link, there are a few guidelines you can follow:</p> - -<ul> - <li>Whenever a macro exists which will create the link you need, and you are able to do so, please do. <a href="/en-US/docs/MDN/Contribute/Editor/Links#Using_link_macros">Using macros to create links</a> will not only help you get it right, but will allow future improvements to MDN to automatically be applied to your link.</li> - <li>For an API name, use the entire string of the API term as written in your content. The easiest way to do this is to <a href="/en-US/docs/MDN/Contribute/Editor/Links#Linking_to_documentation_for_APIs">use the appropriate macro</a> to construct a properly-formatted link for you.</li> - <li>For a term for which you're linking to a page defining or discussing that term, use the name of the term and no additional text as the link's text. For example: - <ul> - <li><span class="correct"><strong>Correct</strong></span>: You can use <a href="/en-US/docs/Web/JavaScript">JavaScript</a> code to create dynamic applications on the Web.</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: You can use <a href="/en-US/docs/Web/JavaScript">JavaScript code</a> to create dynamic applications on the Web.</li> - </ul> - </li> - <li>Otherwise, when adding a useful link to prose, try to choose an action and object phrase, such as: - <ul> - <li><span class="correct"><strong>Correct</strong></span>: If you'd like to <a href="/en-US/docs/Mozilla/Developer_guide">contribute to the Firefox project</a>, your first step is to <a href="/en-US/docs/Mozilla/Developer_guide/Build_Instructions">download and build Firefox</a>.</li> - <li><span class="incorrect"><strong>Incorrect</strong></span>: <a href="/en-US/docs/Mozilla/Developer_guide">If you'd like to contribute to the Firefox project</a>, your first step is to <a href="/en-US/docs/Mozilla/Developer_guide/Build_Instructions">download and build</a> Firefox.</li> - </ul> - </li> -</ul> - -<h4 id="URL_schemes">URL schemes</h4> - -<p>For security reasons, you should only create links that use the following schemes:</p> - -<ul> - <li><code>http://</code></li> - <li><code>https://</code></li> - <li><code>ftp://</code></li> - <li><code>mailto:</code></li> -</ul> - -<p>Others may or may not work, but are not supported and will probably be removed by editorial staff.</p> - -<div class="note"> -<p>In particular, avoid the <code>about:</code> or <code>chrome://</code> schemes, as they will not work. Similarly, the <code>javascript:</code> scheme is blocked by most modern browsers, as is <code>jar:</code>.</p> -</div> - -<h3 id="Page_tags">Page tags</h3> - -<p>Tags provide meta information about a page and/or indicate that a page has specific improvements needed to its content. Every page in the wiki should have tags.</p> - -<p>You can find details on tagging in our <a href="/en-US/docs/MDN/Contribute/Howto/Tag">How to properly tag pages</a> guide.</p> - -<p>The tagging interface lives at the bottom of a page while you're in edit mode, and looks something like this:</p> - -<p><img alt="Screenshot of the UX for adding and removing tags on MDN" src="https://mdn.mozillademos.org/files/7859/tag-interface.png" style="border-style: solid; border-width: 1px; height: 167px; width: 863px;"></p> - -<p>To add a tag, click in the edit box at the end of the tag list and type the tag name you wish to add. Tags will autocomplete as you type. Press enter (or return) to submit the new tag. Each article may have as many tags as needed. For example, an article about using JavaScript in AJAX programming might have both "JavaScript" and "AJAX" as tags.</p> - -<p>To remove a tag, just click the little "X" icon in the tag.</p> - -<h4 id="Tagging_pages_that_need_work">Tagging pages that need work</h4> - -<p>In addition to using tags to track information about the documentation's quality and content, we also use them to mark articles as needing specific types of work.</p> - -<h4 id="Tagging_obsolete_pages">Tagging obsolete pages</h4> - -<p>Use the following tags for pages that are not current:</p> - -<dl> - <dt>Junk</dt> - <dd>Use for spam, pages created by mistake, or content that is so bad that it should be deleted. Pages with this tag are deleted from time to time.</dd> - <dt>Obsolete</dt> - <dd>Use for content that is technically superseded, but still valid in context. For example an HTML element that is obsolete in HTML5 is still valid in HTML 4.01. You can also use the <span class="nowiki">{{TemplateLink("obsolete_header")}}</span> macro to put a prominent banner on the topic.</dd> - <dt>Archive</dt> - <dd>Use for content that is technically superseded and no longer useful. If possible, add a note to the topic referring readers to a more current topic. For example, a page that describes how to use the Mozilla CVS repository should refer readers to a current topic on using Mercurial repos. (If no corresponding current topic exists, use the <em>NeedsUpdate</em> tag, and add an explanation on the Talk page.) Pages with the Archive tag are eventually moved from the main content of MDN to the <a href="/en-US/docs/Archive">Archive</a> section.</dd> -</dl> - -<h3 id="SEO_summary">SEO summary</h3> - -<p>The SEO summary provides a short description of a page. It will be reported as a summary of the article to robots crawling the site, and will then appear in search results for the page. It is also used by macros that automate the construction of landing pages inside MDN itself. (In other words, it's not just for SEO.)</p> - -<p>By default, the first paragraph of the page is used as the SEO summary. However, you can override this behavior by marking a section with the <a href="/en-US/docs/Project:MDN/Contributing/Editor_guide/Editing#Formatting_styles">"SEO summary" style in the WYSIWYG editor</a>.</p> - -<h3 id="Landing_pages">Landing pages</h3> - -<p><strong>Landing pages</strong> are pages at the root of a topic area of the site, such as the main <a href="/en-US/docs/CSS" title="CSS">CSS</a> or <a href="/en-US/docs/HTML" title="HTML">HTML</a> pages. They have a standard format that consists of three areas:</p> - -<ol> - <li>A brief (typically one paragraph) overview of what the technology is and how it's used. See {{anch("Writing a landing page overview")}} for tips.</li> - <li>A two-column list of links with appropriate headings. See {{anch("Creating a page link list")}} for guidelines.</li> - <li>An <strong>optional</strong> "Browser compatibility" section at the bottom of the page.</li> -</ol> - -<h4 id="Creating_a_page_link_list">Creating a page link list</h4> - -<p>The link list section of an MDN landing page consists of two columns. These are created using the following HTML:</p> - -<pre class="brush: html notranslate"><div class="row topicpage-table"> - <div class="section"> - ... left column contents ... - </div> - <div class="section"> - ... right column contents ... - </div> -</div></pre> - -<p>The left column should be a list of articles, with an <code><h2></code> header at the top of the left column explaining that it's a list of articles about the topic (e.g., "Documentation and tutorials about foo"); this header should use the CSS class "Documentation". Below that is a <code><dl></code> list of articles with each article's link in a <code><dt></code> block and a brief one-or-two sentence summary of the article in the corresponding <code><dd></code> block.</p> - -<p>The right column should contain one or more of the following sections, in order:</p> - -<dl> - <dt>Getting help from the community</dt> - <dd>This should provide information on Matrix chat rooms and mailing lists available on the topic. The heading should use the class "Community".</dd> - <dt>Tools</dt> - <dd>A list of tools the user can look at to help with the use of the technology described in this section of MDN. The heading should use the class "Tools".</dd> - <dt>Related topics</dt> - <dd>A list of links to landing pages for other, related, technologies of relevance. The heading should use the class "Related_Topics".</dd> -</dl> - -<p><strong>{{TODO("Finish this once we finalize the landing page standards")}}</strong></p> - -<h2 id="Using_and_inserting_images">Using and inserting images</h2> - -<p>It's sometimes helpful to provide an image in an article you create or modify, especially if the article is very technical. To include an image:</p> - -<ol> - <li>Before uploading your image, please ensure that it's as small as possible by using an image optiization tool. - <ol> - <li>For bitmap images (JPG or PNG), consider a tool such as <a href="https://imageoptim.com/mac">ImageOptim</a> (macOS), <a href="https://tinypng.com/">TinyPNG</a> (web service), or <a href="https://trimage.org/">Trimage</a> (Linux).</li> - <li>For SVG images, use the <code><a href="https://github.com/svg/svgo">svgo</a></code> tool to optimize the SVG file before sending it. The default configuration is fine.</li> - </ol> - </li> - <li>Attach the desired image file to the article (at the bottom of every article in edit mode). If your artwork is a diagram in SVG format (which is ideal if there is text that may need to be localized), you can't upload it directly, but you can ask an MDN admin to do it for you.</li> - <li>Click the "insert image" button in the MDN documentation WYSIWYG editor.</li> - <li>In the WYSIWYG editor, in the drop-down list of attachments, select the newly created attachment that is your image.</li> - <li>Press OK.</li> -</ol> - -<div class="warning"> -<p><strong>Important:</strong> Remember to save any changes you've made before uploading an attachment to your article! The editor is closed during the upload process, and currently <em>does not verify</em> whether or not you wish to save your work when it does so.</p> -</div> - -<h2 id="Other_references">Other references</h2> - -<h3 id="Preferred_style_guides">Preferred style guides</h3> - -<p>If you have questions about usage and style not covered here, we recommend referring to the <a href="https://docs.microsoft.com/en-us/style-guide/welcome/">Microsoft Writing Style Guide</a> or, failing that, the <a href="https://www.amazon.com/Chicago-Manual-Style-16th/dp/0226104206">Chicago Manual of Style</a>. An <a href="https://faculty.cascadia.edu/cma/HIST148/cmscrib.pdf">unofficial crib sheet for the Chicago Manual of Style</a> is available online.</p> - -<h3 id="Preferred_dictionary">Preferred dictionary</h3> - -<p>For questions of spelling, please refer to <a href="http://www.dictionary.com/">Dictionary.com</a>. The spelling checker for this site uses American English. Please do not use variant spellings (e.g., use <em>color</em> rather than <em>colour</em>).</p> - -<p>We will be expanding the guide over time, so if you have specific questions that aren't covered in this document, please post them on the <a href="https://discourse.mozilla.org/c/mdn">MDN discussion forum</a>, so we know what should be added.</p> - -<h3 id="MDN-specific">MDN-specific</h3> - -<ul> - <li><a href="/en-US/docs/MDN/Contribute/Structures/Macros/Commonly-used_macros" title="Project:en/Custom_Templates">Commonly-used macros</a> on MDN, with explanations</li> -</ul> - -<h3 id="Language_grammar_spelling">Language, grammar, spelling</h3> - -<p>If you're interested in improving your writing and editing skills, you may find the following resources to be helpful.</p> - -<ul> - <li><a href="http://www.amazon.com/Writing-Well-30th-Anniversary-Nonfiction/dp/0060891548">On Writing Well</a>, by William Zinsser (Amazon link)</li> - <li><a href="http://www.amazon.com/Style-Basics-Clarity-Grace-4th/dp/0205830765/" title="http://www.amazon.com/Style-Lessons-Clarity-Grace-Edition/dp/0321898680">Style: The Basics of Clarity and Grace</a>, by Joseph Williams and Gregory Colomb (Amazon link)</li> - <li><a href="https://brians.wsu.edu/common-errors-in-english-usage/">Common Errors in English</a></li> - <li><a href="http://www-personal.umich.edu/~jlawler/aue.html">English Grammar FAQ</a> (alt.usage.english)</li> - <li><a href="http://www.angryflower.com/bobsqu.gif">Bob's quick guide to the apostrophe, you idiots</a> (funny)</li> - <li><a href="http://www.amazon.com/Merriam-Websters-Concise-Dictionary-English-Usage/dp/B004L2KNI2" title="http://www.amazon.com/Merriam-Websters-Concise-Dictionary-English-Usage/dp/B004L2KNI2">Merriam-Webster's Concise Dictionary of English Usage</a> (Amazon link): Scholarly but user-friendly, evidence-based advice; very good for non-native speakers, especially for preposition usage.</li> - <li><a href="http://english.stackexchange.com/">English Language and Usage StackExchange</a>: Question and answer site for English language usage.</li> -</ul> diff --git a/files/vi/mdn/index.html b/files/vi/mdn/index.html deleted file mode 100644 index 3b21e1d77b..0000000000 --- a/files/vi/mdn/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: The MDN project -slug: MDN -tags: - - Landing - - MDN Meta -translation_of: MDN ---- -<div>{{MDNSidebar}}</div> - -<p><strong>MDN Web Docs</strong> is a wiki on which we document the open Web, Mozilla technologies, and other developer topics. Anyone is welcome to add and edit content. You don't need to be a programmer or know a lot about technology; there are many different tasks that need to be performed, from the simple (proof-reading and correcting typos) to the complex (writing API documentation).</p> - -<div class="summary"> -<p>The mission of MDN Web Docs is to provide <em>developers</em> with the <em>information</em> they need to <em>easily</em> build projects on the <em>web platform</em>. We invite you to help!</p> -</div> - -<p>We need your help! It's easy. Don't worry about asking for permission or about making mistakes. On the other hand, please get to know the <a href="/en-US/docs/MDN/Community" title="/en-US/docs/MDN/Community">MDN community</a>; we're here to help you! The documentation below should get you started, but don't hesitate to join the discussion in the <a href="https://chat.mozilla.org/#/room/#mdn:mozilla.org">MDN Web Docs chat room</a>.</p> - -<ul class="card-grid"> - <li><span><a href="/en-US/docs/MDN/Getting_started">Newcomer quick start</a></span> - - <p>Are you new to MDN and want to learn how to help make it better? Start here!</p> - </li> - <li><span><a href="/en-US/docs/MDN/Contribute">I'm an advanced user</a></span> - <p>Access our full, in-depth guide for MDN contributors to learn more once you've gotten comfortable.</p> - </li> - <li><span><a href="/en-US/docs/MDN/Promote">Spread the word</a></span> - <p>If you love MDN, help get the word out! Find art, tools, and guides for promoting MDN.</p> - </li> -</ul> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="/en-US/docs/MDN/Community">Join the MDN Community</a></li> - <li><a href="https://app.zenhub.com/workspace/o/mdn/sprints/boards?repos=121649843,55001853,70901646,134759439,90252175,1352520,3311772,82040629,121278372,33677290,132630865">Scrum board</a></li> -</ul> diff --git a/files/vi/mdn/tools/index.html b/files/vi/mdn/tools/index.html deleted file mode 100644 index 912a00f053..0000000000 --- a/files/vi/mdn/tools/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: MDN tools -slug: MDN/Tools -tags: - - Landing - - MDN Meta - - NeedsTranslation - - Tools - - TopicStub -translation_of: MDN/Tools ---- -<div>{{MDNSidebar}}{{IncludeSubnav("/en-US/docs/MDN")}}</div> - -<p>MDN offers a number of features that make it easier to track progress, manage content, and keep up with the latest changes to the site.</p> - -<p>{{LandingPageListSubpages}}</p> diff --git a/files/vi/mdn/tools/kumascript/index.html b/files/vi/mdn/tools/kumascript/index.html deleted file mode 100644 index 329f2b3762..0000000000 --- a/files/vi/mdn/tools/kumascript/index.html +++ /dev/null @@ -1,472 +0,0 @@ ---- -title: KumaScript -slug: MDN/Tools/KumaScript -tags: - - Guide - - Kuma - - KumaScript - - MDN Meta - - NeedsContent - - NeedsTranslation - - Site-wide - - TopicStub -translation_of: MDN/Tools/KumaScript ---- -<div>{{MDNSidebar}}</div> - -<p><span class="seoSummary">On the <a href="/en-US/docs/MDN/Kuma">Kuma</a> platform that powers MDN, the template system for automating aspects of content on the wiki is called <a class="link-https" href="https://github.com/mdn/kumascript">KumaScript</a>. KumaScript is powered by server-side JavaScript, implemented using <a class="external" href="https://nodejs.org/en/">Node.js</a>.</span> This article provides basic information on how to use KumaScript.</p> - -<p>For a detailed overview and Q&A of KumaScript, watch the MDN dev team's <a href="https://vreplay.mozilla.com/replay/showRecordDetails.html?sortBy=date&viewCount=1&currentPage=1&groupBy=combo&roomFilter=&usernameFilter=&searchFilter=&usernameFullFilter=&myManager=-1&adminManager=0&webCast=0&command=&recId=1082&auxMessage=&auxMessage1=&lang=en&langChanged=&tenantFilter=&securityTab=">KumaScript Fireside Chat</a> (the meeting starts at 10 minutes into the video). KumaScript replaced DekiScript, which was the template language for MindTouch, the previous platform used by MDN.</p> - -<h3 id="What_is_KumaScript">What is KumaScript?</h3> - -<ul> - <li>A way to reuse and localize content that appears repeatedly between documents (e.g., compatibility labels, section navigation, warning banners).</li> - <li>A way to build documents out of content pulled from other documents.</li> - <li>A way to fetch and include content from other web sites and services (e.g., Bugzilla).</li> -</ul> - -<h3 id="What_KumaScript_is_not">What KumaScript is not</h3> - -<ul> - <li>KumaScript does not support interactive scripting of the kind that can accept form submissions.</li> - <li>KumaScript does not have access to a database, files, or any other way to store information persistently.</li> - <li>KumaScript does not support site personalization based on the user currently logged in.</li> - <li>KumaScript does not have access to user information, only to the content and metadata of a wiki page being viewed.</li> -</ul> - -<h2 id="Basics">Basics</h2> - -<p>KumaScript is used on MDN in <a href="https://github.com/mde/ejs">embedded JavaScript templates</a>. These templates can be invoked in document content by any MDN author, through the use of macros.</p> - -<p>A script in KumaScript is a <em>template</em>, and each template is a file in <a href="https://github.com/mdn/kumascript/tree/master/macros">the macros directory of the KumaScript repository</a> on Github. A template looks like this:</p> - -<pre class="brush: js no-line-numbers notranslate"><% for (var i = 0; i < $0; i++) { %> - Hello #<%= i %> -<% } %></pre> - -<p>Invoking a template is done with a <em>macro</em>, which can be used anywhere in any wiki content. A macro looks like this:</p> - -<pre class="brush: none no-line-numbers notranslate">\{{hello(3)}}</pre> - -<p>The output of the macro looks like this:</p> - -<pre class="brush: html no-line-numbers notranslate">Hello #0 -Hello #1 -Hello #2</pre> - -<h3 id="Macro_syntax">Macro syntax</h3> - -<p>KumaScript templates are invoked in document content with macros, like this:</p> - -<pre class="brush: none no-line-numbers notranslate">\{{templateName("arg0", "arg1", ..., "argN")}}</pre> - -<p>Macro syntax consists of these rules:</p> - -<ul> - <li>Macros start and end with <code>\{{</code> and <code>\}}</code> characters.</li> - <li>The first part of the macro is the name of a template. The lowercase value of this name should match the lowercase value of one of the filenames under <a href="https://github.com/mdn/kumascript/tree/master/macros">the macros directory of KumaScript</a>.</li> - <li>A template can accept parameters, and this parameter list starts and ends with parentheses.</li> - <li>All non-numeric parameters must be in quotes. Numbers can be left unquoted.</li> -</ul> - -<h4 id="Using_JSON_as_a_macro_parameter">Using JSON as a macro parameter</h4> - -<p>As a semi-experimental feature (not guaranteed to work), you can supply a JSON object for the first and only parameter, like so:</p> - -<pre class="brush: none no-line-numbers notranslate">\{{templateName(<code class="language-json">{ "Alpha": "one", "Beta": ["a", "b", "c"], "Foo": "https:\/\/mozilla.org\/" }</code>)}}</pre> - -<p>The data from this macro is available in template code as an object in the <code class="language-javascript">$0</code> argument (e.g., <code>$0.Alpha</code>, <code>$0.Beta</code>, <code>$0.Foo</code>). This also allows you to express complex data structures in macro parameters that are hard or impossible to do with a simple list of parameters.</p> - -<p>Note that this parameter style is very picky — it must adhere to <a href="https://json.org/">JSON syntax</a> exactly, which has some requirements about escaping characters that are easy to miss (e.g., all forward slashes are escaped). When in doubt, <a href="https://jsonlint.com/">try running your JSON through a validator</a>.</p> - -<h4 id="How_to_write_in_text">How to write "\{{" in text</h4> - -<p>Since the character sequence "<code>\{{</code>" is used to indicate the start of a macro, this can be troublesome if you actually just want to use "<code>\{{</code>" and "<code>}}</code>" in a page. It will probably produce <code>DocumentParsingError</code> messages.</p> - -<p>In this case, you can escape the first brace with a backslash, like so: <code>\\{{</code></p> - -<h3 id="Template_syntax">Template syntax</h3> - -<p>Each KumaScript template is a file under <a href="https://github.com/mdn/kumascript/tree/master/macros">the macros directory of KumaScript</a>. You create and edit these files as you would the files of any open-source project on GitHub (see <a href="https://github.com/mdn/kumascript">the KumaScript README</a> for more information).</p> - -<p>KumaScript templates are processed by an <a href="https://ejs.co">embedded JavaScript template engine</a> with a few simple rules:</p> - -<ul> - <li>Within a template, the parameters passed in from the macro are available as the variables <code>$0</code>, <code>$1</code>, <code>$2</code>, and so on. The entire list of parameters is also available in a template as the variable <code>arguments</code>.</li> - <li>Most text is treated as output and included in the output stream.</li> - <li>JavaScript variables and expressions can be inserted into the output stream with these blocks: - <ul> - <li><code class="language-ejs"><%= expr %></code> — the value of a JavaScript expression is escaped for HTML before being included in output (e.g., characters like <code><</code> and <code>></code> are turned into <code>&lt;</code> and <code>&gt;</code>).</li> - <li><code class="language-ejs"><%- expr %></code> — the value of a JavaScript expression is included in output without any escaping. (Use this if you want to dynamically build markup or use the results of another template that may include markup.)</li> - <li>It is an error to include semicolons inside these blocks.</li> - </ul> - </li> - <li>Anything inside a <code class="language-ejs"><% %></code> block is interpreted as JavaScript. This can include loops, conditionals, etc.</li> - <li>Nothing inside a <code class="language-ejs"><% %></code> block can ever contribute to the output stream. But, you can transition from JS mode to output mode using <code><% %></code>—for example: - <pre class="brush: js notranslate"><% for (var i = 0; i < $0; i++) { %> - Hello #<%= i %> -<% } %></pre> - - <p>Note how the JavaScript code is contained in <code class="language-ejs"><% ... %></code>, and output happens in the space between <code class="language-ejs">%> ... <%</code>. The <code>for</code> loop in JS can begin with one <code class="language-ejs"><% %></code> block, transition to output mode, and finish up in a second <code class="language-ejs"><% %></code> JS block.</p> - </li> - <li>For more details on EJS syntax, <a href="https://ejs.co">check out the upstream module documentation</a>.</li> -</ul> - -<h3 id="Tips">Tips</h3> - -<p>You can see a list of macros and how they are used on MDN on the <a href="/en-US/dashboards/macros">macros dashboard</a>.</p> - -<h2 id="Advanced_Features">Advanced Features</h2> - -<p>Beyond the basics, the KumaScript system offers some advanced features.</p> - -<h3 id="Environment_variables">Environment variables</h3> - -<p>When the wiki makes a call to the KumaScript service, it passes along some context on the current document that KumaScript makes available to templates as variables:</p> - -<dl> - <dt><code>env.path</code></dt> - <dd>The path to the current wiki document</dd> - <dt><code>env.url</code></dt> - <dd>The full URL to the current wiki document</dd> - <dt><code>env.id</code></dt> - <dd>A short, unique ID for the current wiki document</dd> - <dt><code>env.files</code></dt> - <dd>An array of the files attached to the current wiki document; each object in the array is as described under {{ anch("File objects") }} below</dd> - <dt><code>env.review_tags</code></dt> - <dd>An array of the review tags on the article ("technical", "editorial", etc.)</dd> - <dt><code>env.locale</code></dt> - <dd>The locale of the current wiki document</dd> - <dt><code>env.title</code></dt> - <dd>The title of the current wiki document</dd> - <dt><code>env.slug</code></dt> - <dd>The URL slug of the current wiki document</dd> - <dt><code>env.tags</code></dt> - <dd>An array list of tag names for the current wiki document</dd> - <dt><code>env.modified</code></dt> - <dd>Last modified timestamp for the current wiki document</dd> - <dt><code>env.cache_control</code></dt> - <dd><code>Cache-Control</code> header sent in the request for the current wiki document, useful in deciding whether to invalidate caches</dd> -</dl> - -<h4 id="File_objects">File objects</h4> - -<p>Each file object has the following fields:</p> - -<dl> - <dt><code>title</code></dt> - <dd>The attachment's title</dd> - <dt><code>description</code></dt> - <dd>A textual description of the current revision of the file</dd> - <dt><code>filename</code></dt> - <dd>The file's name</dd> - <dt><code>size</code></dt> - <dd>The size of the file in bytes</dd> - <dt><code>author</code></dt> - <dd>The username of the person who uploaded the file</dd> - <dt><code>mime</code></dt> - <dd>The MIME type of the file</dd> - <dt><code>url</code></dt> - <dd>The URL at which the file can be found</dd> -</dl> - -<h4 id="Working_with_tag_lists">Working with tag lists</h4> - -<p>The <code>env.tags</code> and <code>env.review_tags</code> variables return arrays of tags. You can work with these in many ways, of course, but here are a couple of suggestions.</p> - -<h5 id="Looking_to_see_if_a_specific_tag_is_set">Looking to see if a specific tag is set</h5> - -<p>You can look to see if a specific tag exists on a page like this:</p> - -<pre class="brush: js notranslate">if (env.tags.indexOf("tag") != −1) { - // The page has the tag "tag" -} -</pre> - -<h5 id="Iterating_over_all_the_tags_on_a_page">Iterating over all the tags on a page</h5> - -<p>You can also iterate over all the tags on a page, like this:</p> - -<pre class="brush: js notranslate">env.tag.forEach(function(tag) { - // do whatever you need to do, such as: - if (tag.indexOf("a") == 0) { - // this tag starts with "a" - woohoo! - } -});</pre> - -<h3 id="APIs_and_Modules">APIs and Modules</h3> - -<p>KumaScript offers some built-in methods and APIs for KumaScript macros. Macros can also use <code>module.exports</code> to export new API methods.</p> - -<p>API changes require updating the KumaScript engine or macros via a pull request to the <a href="https://github.com/mdn/kumascript">KumaScript repository</a>.</p> - -<h4 id="Built-in_methods">Built-in methods</h4> - -<p>This manually-maintained documentation is likely to fall out of date with the code. With that in mind, <a class="link-https" href="https://github.com/mdn/kumascript/blob/master/lib/kumascript/api.js#L175" title="https://github.com/mdn/kumascript/blob/master/lib/kumascript/api.js#L208">you can always check out the latest state of built-in APIs in the KumaScript source</a>. But here is a selection of useful methods exposed to templates:</p> - -<dl> - <dt><code class="language-javascript">md5(string)</code></dt> - <dd>Returns an MD5 hex digest of the given string.</dd> - <dt><code class="language-javascript">template("name", ["arg0", "arg1", ..., "argN"])</code></dt> - <dd> - <p>Executes and returns the result of the named template with the given list of parameters.</p> - - <p>Example: <code class="language-javascript"><%- template("warning", ["foo", "bar", "baz"]) %></code>.</p> - - <p>Example using the <code>DOMxRef</code> macro: <code class="language-javascript"><%- template("DOMxRef", ["Event.bubbles", "bubbles"]) %></code>.</p> - - <p>This is a JavaScript function. So, if one of the parameters is an arg variable like $2, do not put it in quotes. Like this: <code class="language-javascript"><%- template("warning", [$1, $2, "baz"]) %></code>. If you need to call another template from within a block of code, do not use <code><%</code> ... <code>%></code>. Example: <code class="language-javascript">myvar = "<li>" + template("LXRSearch", ["ident", "i", $1]) + "</li>";</code></p> - </dd> - <dt><code class="language-javascript">require(name)</code></dt> - <dd>Loads another template as a module; any output is ignored. Anything assigned to <code class="language-javascript">module.exports</code> in the template is returned.</dd> - <dd>Used in templates like so: <code class="language-javascript"><% const my_module = require('MyModule'); %></code>.</dd> - <dt><code class="language-javascript">cacheFn(key, timeout, function_to_cache)</code></dt> - <dd>Using the given key and cache entry lifetime, cache the results of the given function. Honors the value of <code>env.cache_control</code> to invalidate cache on <code>no-cache</code>, which can be sent by a logged-in user hitting shift-refresh.</dd> - <dt><code class="language-javascript">request</code></dt> - <dd>Access to <a class="link-https" href="https://github.com/mikeal/request" title="https://github.com/mikeal/request"><code>mikeal/request</code></a>, a library for making HTTP requests. Using this module in KumaScript templates is not yet very friendly, so you may want to wrap usage in module APIs that simplify things.</dd> - <dt><code class="language-javascript">log.debug(string)</code></dt> - <dd>Outputs a debug message into the script log on the page (i.e. the big red box that usually displays errors).</dd> -</dl> - -<h4 id="Built-in_API_modules">Built-in API modules</h4> - -<p>There are a set of built in API that are automatically loaded and made available to every template by the environment script.</p> - -<p>For the most part, these attempt to provide stand-ins for legacy DekiScript features to ease template migration. But, going forward, these can be used to share common variables and methods between templates:</p> - -<ul> - <li><code>kuma.*</code> - <a href="https://github.com/mdn/kumascript/blob/master/src/api/kuma.js">Kuma</a></li> - <li><code>MDN.*</code> - <a href="https://github.com/mdn/kumascript/blob/master/src/api/mdn.js">MDN:Common</a></li> - <li><code>page.*</code> - <a href="https://github.com/mdn/kumascript/blob/master/src/api/page.js">DekiScript:Page</a></li> - <li><code>string.*</code> - <a href="https://github.com/mdn/kumascript/blob/master/src/api/string.js">DekiScript:String</a></li> - <li><code>uri.*</code> - <a class="link-https" href="https://github.com/mdn/kumascript/blob/master/src/api/uri.js">DekiScript:Uri</a></li> - <li><code>web.*</code> - <a class="link-https" href="https://github.com/mdn/kumascript/blob/master/src/api/web.js">DekiScript:Web</a></li> - <li><code>wiki.*</code> - <a class="link-https" href="https://github.com/mdn/kumascript/blob/master/src/api/wiki.js">DekiScript:Wiki</a></li> -</ul> - -<p>You can see the most up to date list of methods under <code>kuma</code> from <a href="https://github.com/mdn/kumascript/blob/master/src/api/kuma.js">the KumaScript source code</a>, but here are a few:</p> - -<dl> - <dt><code class="language-javascript">kuma.inspect(object)</code></dt> - <dd>Renders any JS object as a string, handy for use with <code>log.debug()</code>. See also: <a href="https://nodejs.org/api/util.html#util_util_inspect_object_options">node.js <code class="language-javascript">util.inspect()</code></a>.</dd> - <dt><code class="language-javascript">kuma.htmlEscape(string)</code></dt> - <dd>Escapes the characters <code>&, <, >, "</code> to <code>&amp, &lt;, &gt;, &quot;</code>, respectively.</dd> - <dt><code class="language-javascript">kuma.url</code></dt> - <dd>See also: <a href="http://nodejs.org/api/url.html">node.js <code>url</code> module</a>.</dd> - <dt><code class="language-javascript">kuma.fetchFeed(url)</code></dt> - <dd>Fetch an RSS feed and parse it into a JS object. See also: <a href="https://github.com/mdn/kumascript/blob/master/macros/InsertFeedLinkList.ejs"><code>InsertFeedLinkList</code></a></dd> -</dl> - -<h4 id="Creating_modules">Creating modules</h4> - -<p>Using the built-in <code>require()</code> method, you can load a template as a module to share common variables and methods between templates. A module can be defined in a template like this:</p> - -<pre class="brush: js notranslate"><% -module.exports = { - add: function (a, b) { - return a + b; - } -} -%></pre> - -<p>Assuming this template is saved under <a href="https://github.com/mdn/kumascript/tree/master/macros">https://github.com/mdn/kumascript/tree/master/macros</a> as <code>MathLib.ejs</code>, you can use it in another template like so:</p> - -<pre class="brush: js notranslate"><% -var math_lib = require("MathLib"); -%> -The result of 2 + 2 = <%= math_lib.add(2, 2) %></pre> - -<p>And, the output of this template will be:</p> - -<pre class="brush: html no-line-numbers notranslate">The result of 2 + 2 = 4</pre> - -<h2 id="Tips_and_caveats">Tips and caveats</h2> - -<h3 id="Debugging">Debugging</h3> - -<p>A useful tip when debugging. You can use the <code>log.debug()</code> method to output text to the scripting messages area at the top of the page that's running your template. Note that you need to be really sure to remove these when you're done debugging, as they're visible to all users! To use it, just do something like this:</p> - -<pre class="brush: js no-line-numbers notranslate"><%- log.debug("Some text goes here"); %></pre> - -<p>You can, of course, create more complex output using script code if it's helpful.</p> - -<h3 id="Caching">Caching</h3> - -<p>KumaScript templates are heavily cached to improve performance. For the most part, this works great to serve up content that doesn't change very often. But, as a logged-in user, you have two options to force a page to be regenerated, in case you notice issues with scripting:</p> - -<ul> - <li>Hit Refresh in your browser. This causes KumaScript to invalidate its cache for the content on the current page by issuing a request with a <code>Cache-Control: max-age=0</code> header.</li> - <li>Hit Shift-Refresh in your browser. This causes KumaScript to invalidate cache for the current page, as well as for any templates or content used by the current page by issuing a request with a <code>Cache-Control: no-cache</code> header.</li> -</ul> - -<h3 id="Using_search_keywords_to_open_template_pages">Using search keywords to open template pages</h3> - -<p>When using templates, it's common to open the template's code in a browser window to review the comments at the top, which are used to document the template, its parameters, and how to use it properly. To quickly access templates, you can create a Firefox <a href="http://kb.mozillazine.org/Using_keyword_searches">search keyword</a>, which gives you a shortcut you can type in the URL box to get to a template more easily.</p> - -<p>To create a search keyword, open the bookmarks window by choosing "Show all bookmarks" in the Bookmarks menu, or by pressing <kbd>Control+Shift+B</kbd> (<kbd>Command+Shift+B</kbd> on Mac). Then from the utility ("Gear") menu in the Library window that appears, choose "New Bookmark...".</p> - -<p>This causes the bookmark editing dialog to appear. Fill that out as follows:</p> - -<dl> - <dt>Name</dt> - <dd>A suitable name for your search keyword; "Open MDN Template" is a good one.</dd> - <dt>Location</dt> - <dd><code>https://github.com/mdn/kumascript/blob/master/macros/%s</code></dd> - <dt>Tags{{Optional_Inline}}</dt> - <dd>A list of tags used to organize your bookmarks; these are entirely optional and what (if any) tags you use is up to you.</dd> - <dt>Keyword</dt> - <dd>The shortcut text you wish to use to access the template. Ideally, this should be something short and quick to type, such as simply "t" or "mdnt".</dd> - <dt>Description{{Optional_Inline}}</dt> - <dd>A suitable description explaining what the search keyword does.</dd> -</dl> - -<p>The resulting dialog looks something like this:</p> - -<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> - -<h2 id="Cookbook">Cookbook</h2> - -<p>This section will list examples of common patterns for templates used on MDN, including samples of legacy DekiScript templates and their new KumaScript equivalents.</p> - -<h3 id="Force_templates_used_on_a_page_to_be_reloaded">Force templates used on a page to be reloaded</h3> - -<p>It bears repeating: To force templates used on a page to be reloaded after editing, hit Shift-Reload. Just using Reload by itself will cause the page contents to be regenerated, but using cached templates and included content. A Shift-Reload is necessary to invalidate caches beyond just the content of the page itself.</p> - -<h3 id="Recovering_from_Unknown_Error">Recovering from "Unknown Error"</h3> - -<p>Sometimes, you'll see a scripting message like this when you load a page:</p> - -<pre class="brush: none no-line-numbers notranslate">Kumascript service failed unexpectedly: <class 'httplib.BadStatusLine'></pre> - -<p>This is probably a temporary failure of the KumaScript service. If you Refresh the page, the error may disappear. If that doesn't work, try a Shift-Refresh. If, after a few tries, the error persists - <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=mozilla.org&format=itrequest">file an IT bug</a> for Mozilla Developer Network to ask for an investigation.</p> - -<h3 id="Broken_wiki.languages_macros">Broken wiki.languages() macros</h3> - -<p>On some pages, you'll see a scripting error like this:</p> - -<pre class="brush: none; no-line-numbers notranslate">Syntax error at line 436, column 461: Expected valid JSON object as the parameter of the preceding macro but...</pre> - -<p>If you edit the page, you'll probably see a macro like this at the bottom of the page:</p> - -<pre class="brush: none no-line-numbers notranslate">\{{ wiki.languages(<code class="language-json">{ "zh-tw": "zh_tw/Core_JavaScript_1.5_教學/JavaScript_概要", ... }</code>) }}</pre> - -<p>To fix the problem, just delete the macro. Or, replace the curly braces on either side with HTML comments <code><!-- --></code> to preserve the information, like so:</p> - -<pre class="brush: html no-line-numbers notranslate"><!-- wiki.languages({ "zh-tw": "zh_tw/Core_JavaScript_1.5_教學/JavaScript_概要", ... }) --></pre> - -<p>Because Kuma supports localization differently, these macros aren't actually needed any more. But, they've been left intact in case we need to revisit the relationships between localized pages. Unfortunately, it seems like migration has failed to convert some of them properly.</p> - -<h3 id="Finding_the_Current_Pages_Language">Finding the Current Page's Language</h3> - -<p>In KumaScript, the locale of the current document is exposed as an environment variable:</p> - -<pre class="brush: js no-line-numbers notranslate">const lang = env.locale;</pre> - -<p>The <code>env.locale</code> variable should be reliable and defined for every document.</p> - -<h3 id="Reading_the_contents_of_a_page_attachment">Reading the contents of a page attachment</h3> - -<p>You can read the contents of an attached file by using the <code>mdn.getFileContent()</code> function, like this:</p> - -<pre class="brush: js notranslate"><% - let contents = mdn.getFileContent(fileUrl); - // ... do stuff with the contents ... -%> -</pre> - -<p>or</p> - -<pre class="brush: js no-line-numbers notranslate"><%- mdn.getFileContent(fileObject); %> -</pre> - -<p>In other words, you may specify either the URL of the file to read or as a file object. The file objects for a page can be accessed through the array <code>env.files</code>. So, for example, to embed the contents of the first file attached to the article, you can do this:</p> - -<pre class="brush: js no-line-numbers notranslate"><%- mdn.getFileContent(env.files[0]); %> -</pre> - -<div class="blockIndicator note"> -<p><strong>Note:</strong> You probably don't want to try to embed the contents of a non-text file this way, as the raw contents would be injected as text. This is meant to let you access the contents of text attachments.</p> -</div> - -<p>If the file isn't found, an empty string is returned. There is currently no way to tell the difference between an empty file and a nonexistent one. But if you're putting empty files on the wiki, you're doing it wrong.</p> - -<h3 id="Localizing_template_content" name="Localizing_template_content">テンプレートのローカライズ</h3> - -<p>Templates are not translated like wiki pages, rather any single template might be used for any number of locales.</p> - -<p>So the main way to output content tailored to the current document locale is to pivot on the value of <code>env.locale</code>. There are many ways to do this, but a few patterns are common in the conversion of legacy DekiScript templates:</p> - -<h4 id="Ifelse_blocks_in_KumaScript">If/else blocks in KumaScript</h4> - -<p>The KumaScript equivalent of this can be achieved with simple if/else blocks, like so:</p> - -<pre class="brush: js notranslate"><% if ("fr" == env.locale) { %> -<%- template("CSSRef") %> « <a href="/fr/docs/Référence_CSS/Extensions_Mozilla">Référence CSS: Extensions Mozilla</a> -<% } else if ("ja" == env.locale) { %> -<%- template("CSSRef") %> « <a href="/ja/docs/CSS_Reference/Mozilla_Extensions">CSS リファレンス: Mozilla 拡張仕様</a> -<% } else if ("pl" == env.locale) { %> -<%- template("CSSRef") %> « <a href="/pl/docs/Dokumentacja_CSS/Rozszerzenia_Mozilli">Dokumentacja CSS: Rozszerzenia Mozilli</a> -<% } else if ("de" == env.locale) { %> -<%- template("CSSRef") %> « <a href="/de/docs/CSS_Referenz/Mozilla_CSS_Erweiterungen">CSS Referenz: Mozilla Erweiterungen</a> -<% } else { %> -<%- template("CSSRef") %> « <a href="/en-US/docs/CSS_Reference/Mozilla_Extensions">CSS Reference: Mozilla Extensions</a> -<% } %></pre> - -<p>Depending on what text editor is your favorite, you may be able to copy & paste from the browser-based editor and attack this pattern with a series of search/replace regexes to get you most of the way there.</p> - -<p>My favorite editor is MacVim, and a series of regexes like this does the bulk of the work with just a little manual clean up following:</p> - -<pre class="brush: none notranslate">%s#<span#^M<span#g -%s#<span lang="\(.*\)" .*>#<% } else if ("\1" == env.locale) { %>#g -%s#<span class="script">template.CSSxRef(#<%- template("CSSxRef", [# -%s#)</span> </span>#]) %> -</pre> - -<p>Your mileage may vary, and patterns change slightly from template to template. That's why the migration script was unable to just handle this automatically, after all.</p> - -<h4 id="String_variables_and_switch">String variables and switch</h4> - -<p>Rather than switch between full chunks of markup, you can define a set of strings, switch them based on locale, and then use them to fill in placeholders in a single chunk of markup:</p> - -<pre class="brush: js notranslate"><% -var s_title = 'Firefox for Developers'; -switch (env.locale) { - case 'de': - s_title = "Firefox für Entwickler"; - break; - case 'fr': - s_title = "Firefox pour les développeurs"; - break; - case 'es': - s_title = "Firefox para desarrolladores"; - break; -}; -%> -<span class="title"><%= s_title %></span></pre> - -<h4 id="Use_mdn.localString">Use <code class="language-javascript">mdn.localString()</code></h4> - -<p>A recent addition to the <code>MDN:Common</code> module is <code class="language-javascript">mdn.localString()</code>, used like this:</p> - -<pre class="brush: js notranslate"><% -var s_title = mdn.localString({ - "en-US": "Firefox for Developers", - "de": "Firefox für Entwickler", - "es": "Firefox para desarrolladores" -}); -%> -<span class="title"><%= s_title %></span></pre> - -<p>This is more concise than the switch statement, and may be a better choice where a single string is concerned. However, if many strings need to be translated (e.g., as in {{TemplateLink("CSSRef")}}), a switch statement might help keep all the strings grouped by locale and more easily translated that way.</p> - -<p>When the object does not have the appropriate locale, the value of "en-US" is used as the initial value.</p> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="https://github.com/mdn/kumascript">KumaScript source code</a></li> - <li><a href="https://wiki.mozilla.org/MDN/Kuma">Kuma wiki</a></li> -</ul> diff --git a/files/vi/mdn/tools/kumascript/troubleshooting/index.html b/files/vi/mdn/tools/kumascript/troubleshooting/index.html deleted file mode 100644 index b7d0c99a5f..0000000000 --- a/files/vi/mdn/tools/kumascript/troubleshooting/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: Troubleshooting KumaScript errors -slug: MDN/Tools/KumaScript/Troubleshooting -translation_of: MDN/Tools/KumaScript/Troubleshooting ---- -<div>{{MDNSidebar}}</div> - -<div class="summary"> -<p><a href="/en-US/docs/MDN/Kuma/Introduction_to_KumaScript">KumaScript</a> errors appearing on a page can be very off-putting to readers, in their big scary red boxes, but fortunately anyone with an MDN account can edit a document to fix such an error. When a page has an error it gets added to the list of <a href="/docs/with-errors">documents with errors</a>. Site editors go through this list regularly to find and fix errors. This article details the four types of KumaScript error, and some steps you can take to fix them.</p> -</div> - -<h2 id="DocumentParsingError">DocumentParsingError</h2> - -<p><code>DocumentParsingError</code> errors appear when KumaScript has trouble understanding something in the document itself. The most common cause is a syntax error in a <a href="/en-US/docs/MDN/Contribute/Content/Macros">macro</a>.</p> - -<p>Check for:</p> - -<dl> - <dt>Use of curly braces without intending to call a macro.</dt> - <dd>If you need to write \{ in a document without calling a macro you can escape it with a \ like this: <code>\\{</code></dd> - <dt>Use of a special character in a macro parameter.</dt> - <dd>If you need to use a " or a \ inside of a macro parameter they can be escaped with a \ like this: <code>\\</code> or <code>\"</code></dd> - <dt>Missing commas between macro parameters.</dt> - <dd>Macro parameters need to be delimited by a comma (,) but not at the end of the list of parameters; for example <code>\{\{anch("top", "Back to top")}}</code>.</dd> - <dt>HTML tags appearing inside a macro call</dt> - <dd>If you apply styling to a macro, it will often break because, for example, a <code></code></code> tag may have appeared inside the macro code in the source code. Check the source view to see what's there, and remove any unnecessary styling.</dd> -</dl> - -<ul> -</ul> - -<h2 id="TemplateLoadingError">TemplateLoadingError</h2> - -<p><code>TemplateLoadingError</code> errors appear when KumaScript has trouble finding which <a href="/en-US/docs/MDN/Contribute/Content/Macros">macro</a> to include on a page.</p> - -<p>Check for:</p> - -<dl> - <dt>Misspelling of macro names or renamed macros.</dt> - <dd>You can look at the list of known macros in the <a href="https://github.com/mdn/kumascript/tree/master/macros">Github repo</a>.</dd> -</dl> - - - -<div class="note"> -<p><strong>Tip:</strong> You can make it quick and easy to jump to a specific macro by adding a <a href="http://kb.mozillazine.org/Using_keyword_searches">search keyword</a> to Firefox. See {{SectionOnPage("/en-US/docs/MDN/Contribute/Tools/KumaScript", "Using search keywords to open template pages")}} for a step-by-step guide to creating the search keyword for this.</p> -</div> - -<h2 id="TemplateExecutionError">TemplateExecutionError</h2> - -<p><code>TemplateExecutionError</code> errors appear when KumaScript encounters an error in the macro. These errors can only be fixed by admin users and need to be reported as bugs.</p> - -<p>Before reporting an error check to see that it hasn't already been fixed. You can do this by forcing KumaScript to give you a fresh copy of the page by holding down <kbd>Shift</kbd> while you refresh the page (<kbd>Shift</kbd> + <kbd>Ctrl</kbd> + <kbd>R</kbd> on Windows/Linux, <kbd>Shift</kbd> + <kbd>Cmd</kbd> + <kbd>R</kbd> on Mac).</p> - -<p>If the error persists, <a href="https://bugzilla.mozilla.org/form.doc">report a bug</a>, including the URL of the page and the text of the error.</p> - -<h2 id="Error_Unknown">Error & Unknown</h2> - -<p>This is the category errors end up in if they are not one of the other kinds of error.</p> - -<p>Check for fixes and report persistent bugs like described under <a href="#TemplateExecutionError">TemplateExecutionError</a>.</p> |