The MDN editing interface

The WYSIWYG (what-you-see-is-what-you-get) editor offered by MDC makes it easy to contribute new content to the MDN Documentation Center.  This article provides some information on how to use the editor, as well as some information about helpful features that may improve your productivity.

The MDC style guide offers information about how to format and style the content itself.

Keyboard shortcuts

See the section "Keyboard shortcuts" in the article MDN editor guide.

Including a revision note

When saving your change, it's helpful if you include a note explaining why you made the change. Enter some text in the "Edit summary" box below the editor before saving your change.

There are a few reasons this is helpful:

  • If the reason for your change isn't obvious, your note can explain the reasoning to others.
  • If your change is technically complex, it can explain to editors the logic behind it; this can include a bug number, for example, that editors can refer to for more information.
  • If your edit involves deleting a large amount of content, you can justify the deletion (for example, "I moved this content to article X").

Linking

There are some templates that make it easy to create in-page links. For example, you can link to a section with a given name using the anch template, like this:

Including a revision note

This inserts an anchor like this: Including a revision note.

When writing interface documentation, and you need to link to a method within the current article, you can use the manch template, like this:

methodName()

This looks like this: methodName().

Using live sample code

See "Using the live sample system" in the MDN editor guide for this material's new home.

Deleting a page

If you come upon a page that needs to be deleted for any reason, simply add the tag "junk" to it. A helpful MDC administrator will remove the page shortly thereafter.

What are good reasons to mark a page for deletion?

  • The page was created by accident and has no content.
  • The page's contents were merged with another article.
  • The page is spam.
  • The page's contents are so woefully obsolete as to be dangerous.

Useful KumaScript commands

Sometimes, it's useful to take advantage of special KumaScript commands to improve the look and feel of your content.

By default, the MindTouch wiki truncates lengthy URLs when displaying them in the bodies of articles. This is not typically what we want. If you find this is happening to you, you can use the web.link command to embed the full URL, like this:

Truncated: http://www.bitstampede.com/2009/06/0...atures-on-mdc/

Inlined: http://www.bitstampede.com/2009/06/04/more-new-features-on-mdc/

This is done by using the text http://www.bitstampede.com/2009/06/04/more-new-features-on-mdc/.

Using syntax highlighting

MDC supports syntax highlighting for code samples.  To use it, the first step is to insert the code sample into the document:

void main(int argc, char **argv) {

printf("Hello world\n");

}

The second step is to select the text and click the "PRE" icon in the toolbar.

void main(int argc, char **argv) {
  printf("Hello world\n");
}

The third step is to use the drop-down menu next to the "PRE" icon to select the language corresponding to the syntax highlighting you wish to apply.  In this case, we'll use the C++ syntax highlighter.

void main(int argc, char **argv) {
  printf("Hello world\n");
}
Note: The editor does not display the syntax highlighting.  You'll need to save your changes and look at the article to see the syntax highlighting in effect.

Accessing your browser's standard contextual menu

By default, the editor uses its own contextual menu when you right-click on the editor. To access your browser's default contextual menu (such as to access the Firefox spell checker's list of suggested corrections), hold down the Control key (the Command key on Mac OS X) while clicking.

The toolbar

See the "The toolbar" section of the new MDN editor guide for documentation on the toolbar.

Redirects

If you need to make a page redirect to another page, you can use the REDIRECT command. To do this, simply make the entire content of your article look like this:

REDIRECT <a class="redirect" href="%(location)s">%(title)s</a>

Once you've done this, any visit to the page will automatically redirect to the specified location.

If you need to view a page that performs a redirect at a later time, simply add "?redirect=no" to its URL. This will prevent the redirect from occurring so you can view and edit the redirect command.

See also

Document Tags and Contributors

Last updated by: jswisher,