Kuma入门

2 位贡献者:

草案
本页尚未完工.

This is an introductory guide to the Kuma wiki platform that powers MDN. "Kuma" is the Japanese word for "bear;" we chose this name because it's a bigger, more powerful creature than Kitsune ("fox"), the software on which it's based that powers the SUMO web site.

Note: Much of this needs to move into the MDN user guide content, and this isn't necessarily well organized.

Development process

Servers

We have several servers for MDN, based on the state of development of the platform.

Environment URL Purpose
Development https://developer-dev.allizom.org/ Newest features and fixes are added immediately after they pass code review.
Stage https://developer.allizom.org/ Beta features and fixes that will go on the next push to production.
Production https://developer.mozilla.org/ The live MDN server. You're looking at it.

Tracking development

You can see information about recent pushes of code updates to the production server on our Changelog page.

Things that work differently

Redirects

Please see the "Creating redirects" section of the new MDN editor guide for information on redirects.

By default, you create links by specifying as the anchor (that is, the part after the hash or "#" symbol) the heading name of the section you want to link to. However, if you're concerned that this might break if headings are changed over time, there's a way to create permanent references for headings. Just add the name attribute to the heading element. Currently you need to do this in the source editor, but in the future we intend to have a user interface for this. Here's an example of what this might look like in the source:

<h2 name="Doing_foo">All about foo</h2>

Now how can link to this section, even if the title's text changes, using {{anch("Doing foo")}}, or by using "/en-US/path/to/article#Doing_foo" as the link destination.

New features of Kuma

Localization and Translation

KumaScript

See Introduction to KumaScript

Live samples

You can create live samples in Kuma by adding special markup. For example:

<section id="live-sample">
  <pre class="brush: html"><p class="shadow">text-shadow</p></pre>
  <pre class="brush: css">.shadow { text-shadow: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue; }</pre>
  <pre class="brush: js">window.alert("Alert!")</pre>
</section>

Note: You should wrap the code blocks in a non-fragment element - i.e., <section> instead of <ul>.

To display the sample live, use the EmbedLiveSample macro. The first parameter to this macro specifies where the sample is; this can either be the name of a header on the page or an element ID.

In the above example, you'd use {{EmbedLiveSample("live-sample")}}, resulting in:

Note: See the documentation about this in the MDN editor guide for more information about how to use the built-in tools for more easily building live samples.

Finding pages

There are some special search queries you can use to find things:

Search URL Description
https://developer.mozilla.org/admin/wiki/document/?slug__startswith=term Searches for pages whose slug starts with the given term.
https://developer.mozilla.org/admin/wiki/document/?slug__contains=term Searches for pages whose slug contains the given term.

Attachments

You can see a list of all attached files.

Automating and feeds

Kuma offers an an API for retrieving information and (eventually) automatically updating content. See The Kuma API for details.

Additionally, Kuma provides a number of RSS feeds that you can use to monitor the site. See Kuma RSS feeds.

See also

文档标签和贡献者

向此页面作出贡献: trevorh, xcffl
最后编辑者: trevorh,