1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
---
title: كيفية إنشاء وتحرير الصفحات
slug: MDN/Contribute/Howto/كيفية_إنشاء_وتحرير_الصفحات
translation_of: MDN/Contribute/Howto/Create_and_edit_pages
---
<div>{{MDNSidebar}}</div>
<p><span class="seoSummary">This article introduces new contributors to the process of editing existing pages and creating new ones.</span></p>
<h2 id="Editing_an_existing_page">Editing an existing page</h2>
<p>To edit a page:</p>
<ol>
<li>Click the <strong>Edit</strong> button near the top right corner of the page.</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 'In this Article' 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>If you wish to <strong>attach a file</strong><em> </em>to an existing page, or to add an illustration for further clarification, this can be added to the bottom of the page. When uploading an image, please be sure to use an image optimization tool to make the file as small to download as possible. This improves page load time and helps MDN's performance overall. You may use your preferred tool, if you have one. Otherwise, we suggest <a href="https://tinypng.com/">TinyPNG</a>, a handy Web tool.</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<strong> </strong>your work and comments by clicking the<em> green</em> <strong>Publish</strong> button, to the right of the page title, or towards the bottom of the page. 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://bugzilla.mozilla.org/enter_bug.cgi?bug_file_loc=http%3A%2F%2F&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fx_iteration=---&cf_fx_points=---&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&flag_type-4=X&flag_type-607=X&flag_type-800=X&flag_type-803=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=--&product=Developer%20Documentation&rep_platform=Unspecified&short_desc=Create%20page%3A%20&status_whiteboard=create-page&target_milestone=---&version=unspecified">file a documentation request bug</a>, with the subject "Create page: <page title>". Fill out the URL field 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 making 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 link.</a></li>
<li><a href="#Subpage_of_an_existing_page">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>
<dl>
</dl>
<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">https://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">https://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>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>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>"/en-US/docs/" 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 OK, 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>
|