MDN 스타일 가이드

현재 번역은 완벽하지 않습니다. 한국어로 문서 번역에 동참해주세요.

정돈되고, 표준화되어 읽기 쉬운 문서를 제공하기 위해서, 모질라 개발자 네트워크 스타일 가이드는 구조적으로 정돈되고, 철자가 맞고, 형식이 올바른 글을 작성하는 방법에 대해 설명합니다. 이 가이드는 엄격한 규칙이라기보다 가이드라인입니다. 우리는 형식보다는 내용에 더 관심이 있습니다. 그러니 기여하기 전에 스타일 가이드를 배워야 한다는 부담을 느끼시지 않아도 됩니다. 하지만나중에 다른 부지런한 지원자가 이 가이드를 따라 당신의 작업물을 편집할 수 있습니다. 만약 그런 일이 벌어지더라도 화내거나 놀리지 마세요.

특정한 양식의 페이지를 구조화하는 방법에 대한 상세한 설명을 찾는다면, MDN 페이지 레이아웃 가이드를 보세요.

이 가이드의 언어적 측면의 내용은 영문을 위주로 작성되었습니다. 기타 다른 언어는 언어만의 고유한 스타일 가이드를 가질 수 있으며, 새롭게 만드는 것도 좋습니다. 이 페이지들은 지역화 팀 페이지의 하위 페이지로 생성되어야 합니다.

MDN이 아닌 다른 사이트를 위해 쓰여진 콘텐츠를 적용하는 스타일 표준에 대한 내용은 One Mozilla 스타일 가이드를 참고하세요.

기본

여러 광범위한 편집 스타일 가이드에서 처음 시작하기에 가장 좋은 방법은 일관된 문서화를 유지하는데 도움이 되는 가장 기본적인 텍스트 표준을 택하는 것입니다. 다음 섹션에서는 이런 기본적인 텍스트 표준에 대해 도움이 될 만한 몇 가지 가이드라인을 제시합니다.

페이지 제목

페이지 제목은 검색 결과에 사용되며, 페이지 상단의 탐색 경로 목록에 페이지 계층 구조를 구성하는 데 사용됩니다. (페이지 상단과 검색 결과 상단에 표시되는) 페이지 제목은 "<locale>/docs/" 다음의 페이지 URL 부분인 페이지"슬러그"와 다를 수 있습니다.

제목 및 헤딩 대소문자

페이지 제목과 섹션 머리글은 헤드 라인 스타일보다는 문장 스타일(첫 단어와 고유 명사들만 대문자 사용)의 대문자를 사용해야합니다:

  • 정확: "A new method for creating JavaScript rollovers"
  • 부정확: "A New Method for Creating JavaScript Rollovers"

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.

제목 및 슬러그 선택

Page slugs should be kept short; when creating a new level of hierarchy, the new level's component in the slug should generally just be a word or two.

Page titles, on the other hand, may be as long as you like, within reason, and they should be descriptive.

신규 서브트리 생성

When you need to add a number of articles about a topic or topic 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 a number of macros we've created.

For example, consider the JavaScript guide, which is structured like this:

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.

섹션, 단락, 줄바꿈

Use heading levels in decreasing order: <h2> then <h3> then <h4>, without skipping levels. 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 you should consider breaking up the article into several smaller articles with a landing page, linking them together using the Next, Previous, and PreviousNext macros.

The enter (or return) key on your keyboard starts a new paragraph. To insert a newline without a space, hold down the shift key while pressing enter.

텍스트 서식 및 스타일

Use the "Formatting Styles" drop-down list to apply predefined styles to selected content.

Note: The "Note" style is used to call out important notes, like this one.
Warning: Similarly, the "Warning" style creates warning boxes like this.

Unless specifically instructed to do so, do not use the HTML style attribute to manually style content. If you can't do it using a predefined class, drop into #mdn and ask for help.

코드 샘플 스타일 및 서식

탭 및 라인 브레이크

Use two spaces per tab in all code samples. Code should be indented cleanly, with open-brace ("{") characters on the same line as the statement that opens the block. For example:

if (condition) {
  /* handle the condition */
} else {
  /* handle the "else" case */
} 

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:

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);

인라인 코드 서식

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 <code> element). For example, "the frenchText() function".

Method names should be followed by a pair of parentheses: doSomethingUseful(). This helps to differentiate methods from other code terms.

문법 하이라이팅

Screenshot of the "syntax highlighting" menu.Entire lines (or multiple lines) of code should be formatted using syntax highlighting rather than the <code> element. Click the "pre" button in the toolbar to create the preformatted content box in which you'll then write your code. Then, with the text entry cursor inside the code box, select the appropriate language from the language list button to the right of the "pre" button, as seen in the screenshot to the right. The following example shows text with JavaScript formatting:

for (var i = 0, j = 9; i <= 9; i++, j--)
  document.writeln("a[" + i + "][" + j + "]= " + a[i][j]);

If no appropriate transformation is available, use the pre tag without specifying a language ("No Highlight" in the language menu).

x = 42;

Styling HTML element references

There are various specific rules to follow when writing about HTML elements, in order to consistently describe the various components of elements, and to ensure that they're properly linked to detailed documentation.

Element names
Use the HTMLElement macro, which creates a link to the page for that element. For example, writing {{HTMLElement("title")}} produces "<title>". If you don't want to create a link, enclose the name in angle brackets and use "Code (inline)" style (e.g., <title>).
Attribute names
Use bold face.
Attribute definitions
Use the htmlattrdef macro (e.g., {{htmlattrdef("type")}}) for the definition term, so that it can be linked to from other pages, then use the htmlattrxref macro (e.g., {{htmlattrxref("attr","element")}}) to reference attribute definitions.
Attribute values
Use "Code (inline)" style, and do not use quotation marks around strings, unless needed by the syntax of a code sample. E.g.: When the type attribute of an <input> element is set to email or tel ...
Labeling attributes
Use labels like HTML5 thoughtfully. For example, use them next to the bold attribute name but not for every occurrence in your body text.

Latin abbreviations

In notes and parentheses

  • Common Latin abbreviations (etc., i.e., e.g.) may be used in parenthetical expressions and in notes. Use periods in these abbreviations.
    • Correct: Web browsers (e.g. Firefox) can be used ...
    • Incorrect: Web browsers e.g. Firefox can be used ...
    • Incorrect: Web browsers, e.g. Firefox, can be used ...
    • Incorrect: Web browsers, (eg: Firefox) can be used ...

In running text

  • In regular text (i.e. text outside of notes or parentheses), use the English equivalent of the abbreviation.
    • Correct: ... web browsers, and so on.
    • Incorrect: ... web browsers, etc.
    • Correct: Web browsers such as Firefox can be used ...
    • Incorrect: Web browsers e.g. Firefox can be used ...

Meanings and English equivalents of Latin abbreviations

Abbrev Latin English
cf. confer compare
e.g. exempli gratia for example
et al. et alii and others
etc. et cetera and so forth, and so on
i.e. id est that is, in other words
N.B. nota bene note well
P.S. post scriptum postscript

Note: 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. And be sure that you 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.

Acronyms and abbreviations

Capitalization and periods

Use full capitals and delete periods in all acronyms and abbreviations, including organizations such as "US" and "UN".

  • Correct: XUL
  • Incorrect: X.U.L.; Xul

Expansion

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 glossary entry describing the technology.

  • Correct: "XUL (XML User Interface Language) is Mozilla's XML-based language..."
  • Incorrect: "XUL is Mozilla's XML-based language..."

Plurals of acronyms and abbreviations

For plurals of acronyms or abbreviations, add s. Don't use an apostrophe. Ever. Please.

  • Correct: CD-ROMs
  • Incorrect: CD-ROM's

Capitalization

Use standard English capitalization rules in body text, and capitalize "World Wide Web" and "Web".

Contractions

Use contractions (e.g. "don't", "can't", "shouldn't") if you prefer. We're not that formal!

Pluralization

Use English-style plurals, not the Latin- or Greek-influenced forms.

  • Correct: syllabuses, octopuses
  • Incorrect: syllabi, octopi

Hyphenation

Hyphenate compounds when the last letter of the prefix is a vowel and is the same as the first letter of the root.

  • Correct: email, re-elect, co-op
  • Incorrect: e-mail, reelect, coop

Gender-neutral language

It is a good idea to use gender-neutral language in any kind of 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 would be fine, but if the subject is a person of either gender, he/his isn't really appropriate.

Let's take the following example:

A confirmation dialog appears, asking the user if he allows the web page to make use of his web cam.

A confirmation dialog appears, asking the user if she allows the web page to make use of her web cam.

Both versions in this case are gender-specific. This could be fixed by using gender-neutral pronouns:

A confirmation dialog appears, asking the user if they allow the web page to make use of their web cam.

Note: MDN allows the use of this very common syntax (which is controversial among usage authorities), in order to make up for the lack of a neutral gender in English. The use of the third-person plural as a neutral gender pronoun (that is, using "they," them", "their," and "theirs") is an accepted practice, commonly known as "singular 'they.'"

You can use both genders:

A confirmation dialog appears, asking the user if he or she allows the web page to make use of his/her web cam.

making the users plural:

A confirmation dialog appears, asking the users if they allow the web page to make use of their web cams.

The best solution, of course, is to rewrite and eliminate the pronouns completely:

A confirmation dialog appears, requesting the user's permission for web cam access.

A confirmation dialog box appears, which asks the user for permission to use the web cam.

The last way of dealing with the problem is arguably better, as 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 varying gender rules. This can make translation easier, both for readers reading English, then translating it into their own language as they read, and for localizers translating articles into their own language.

Numbers and numerals

Dates

For dates (not including dates in code samples) use the format "January 1, 1990".

  • Correct: February 24, 2006
  • Incorrect: February 24th, 2006; 24 February, 2006; 24/02/2006

Alternately, you can use the YYYY/MM/DD format.

  • Correct: 2006/02/24
  • Incorrect: 02/24/2006; 24/02/2006; 02/24/06

Decades

For decades, use the format "1990s". Don't use an apostrophe.

  • Correct: 1990s
  • Incorrect: 1990's

Plurals of numerals

For plurals of numerals add "s". Don't use an apostrophe.

  • Correct: 486s
  • Incorrect: 486's

Commas

In running text, use commas only in five-digit and larger numbers.

  • Correct: 4000; 54,000
  • Incorrect: 4,000; 54000

Punctuation

Serial comma

Use the serial comma. The serial (also known as "Oxford") comma is the comma that appears before the conjunction in a series of three or more items.

  • Correct: I will travel on trains, planes, and automobiles.
  • Incorrect: I will travel on trains, planes and automobiles.

Note: This is in contrast to the One Mozilla style guide, which specifies that the serial comma is not to be used. MDN is an exception to this rule.

Spelling

For words with variant spellings, always use the first entry at Answers.com. Do not use variant spellings.

  • Correct: localize, honor
  • Incorrect: localise, honour

Terminology

Obsolete vs. deprecated

It's important to be clear on the difference between the terms obsolete and deprecated.

Obsolete:
On MDN, the term obsolete marks an API or technology that is not only no longer recommended, but also no longer implemented in the browser. For Mozilla-specific technologies, the API is no longer implemented in Mozilla code; for Web standard technology, the API or feature is no longer supported by current, commonly-used browsers.
Deprecated:
On MDN, the term deprecated marks an API or technology that is no longer recommended, but is still implemented and may still work. These technologies will in theory eventually become obsolete and be removed, so you should stop using them. For Mozilla-specific technologies, the API is still supported in Mozilla code; for Web standard technology, the API or feature has been removed or replaced in a recent version of the defining standard.

HTML elements

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 <code> style. Also, at least the first time you reference a given element in a section should use the HTMLElement macro, to create a link to the documentation for the element (unless you're writing within that element's reference document page).

  • Correct: the <span> element
  • Incorrect: the span tag

User interface actions

In task sequences, describe user interface actions using the imperative mood. Identify the user interface element by its label and type.

  • Correct: Click the Edit button.
  • Incorrect: Click Edit.

Voice

While the active voice is generally preferred, the passive voice is also acceptable, given the informal feel of our content. Try to be consistent, though.

Wiki markup and usage

To automatically create a link to a Bugzilla bug, use this template:

{{Bug(322603)}}

This results in:

bug 322603

For WebKit bugs, you can use this template:

{{Webkitbug("322603")}}

This results in:

WebKit bug 322603

Page tags

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. You can find details on tagging in our How to properly tag pages guide.

The tagging interface lives at the bottom of a page while you're in edit mode, and looks something like this:

Screenshot of the UX for adding and removing tags on MDN

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.

To remove a tag, simply click the little "X" icon in the tag.

Tagging pages that need work

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.

Tagging obsolete pages

Use the following tags for pages that are not current:

  • Junk: 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.
  • Obsolete: Use for content that is technically superceded, 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 obsolete_header macro to put a prominent banner on the topic.
  • Archive: Use for content that is technically superceded 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 NeedsUpdate 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 Archive section.

SEO summary

The SEO summary is a very short summary of the 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.

By default, the first pagragraph of the page is used as the SEO summary. However you can override this behavior by marking a section with the "SEO summary" style in the WYSIWYG editor.

Landing pages

Landing pages are pages at the root of a topic area of the site, such as the main CSS or HTML pages. They have a standard format that consists of three areas:

  1. A brief (typically one paragraph) overview of what the technology is and what it's used for. See Writing a landing page overview for tips.
  2. A two-column list of links with appropriate headings. See Creating a page link list for guidelines.
  3. An optional "Browser compatibility" section at the bottom of the page.

The link list section of an MDN landing page consists of two columns. These are created using the following HTML:

<div class="row topicpage-table">
  <div class="section">
    ... left column contents ...
  </div>
  <div class="section">
    ... right column contents ...
  </div>
</div>

The left-hand column should be a list of articles, with an <h2> header at the top of the left column explaining that it's a list of articles about the topic (for example "Documentation and tutorials about foo"); this header should use the CSS class "Documentation". Below that is a <dl> list of articles, with each article's link in a <dt> block and a brief one-or-two sentence summary of the article in the corresponding <dd> block.

The right-hand column should contain one or more of the following sections, in order:

Getting help from the community
This should provide information on IRC channels and mailing lists available about the topic. The heading should use the class "Community".
Tools
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".
Related topics
A list of links to landing pages for other, related, technologies of relevance. The heading should use the class "Related_Topics".

<<<finish this once we finalize the landing page standards>>>

Using, inserting images

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:

  1. Attach the desired image file to the article (at the bottom of every article in edit mode)
  2. Create an image in the WYSIWYG editor
  3. In the WYSIWYG editor in the drop-down list listing attachments, select the newly created attachment which is your image
  4. Press OK.

Other References

Preferred style guides

If you have questions about usage and style not covered here, we recommend referring to the Economist style guide or, failing that, the Chicago Manual of Style.

Preferred dictionary

For questions of spelling, please refer to Answers.com. The spell-checker for this site uses American English. Please do not use variant spellings (e.g., use honor rather than honour).

We will be expanding the guide over time, so if you have specific questions that aren't covered in this document, please send them to the MDC mailing list or project lead so we know what should be added.

MDN-specific

Language, grammar, spelling

If you're interested in improving your writing and editing skills, you may find the following resources to be helpful.

문서 태그 및 공헌자

 이 페이지의 공헌자: sominlee, naduhy2, dale0713, webix
 최종 변경: sominlee,