summaryrefslogtreecommitdiffstats
path: root/tools/moztreedocs/docs/mdn-import.rst
blob: 9de78b6213fa329f71a9045ce96b8dd270554b58 (plain)
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
Importing documentation from MDN
--------------------------------

As MDN should not be used for documenting mozilla-central specific code or process,
the documentation should be migrated in this repository.

Fortunatelly, there is an easy way to import the doc from MDN
to the firefox source docs.

1. Install https://pandoc.org/

2. Add a ``?raw=1`` add the end of the MDN URL

3. Run pandoc the following way:

.. code-block:: shell

   $ pandoc -t rst https://wiki.developer.mozilla.org/docs/Web/JavaScript?raw\=1  > doc.rst

4. Verify the rst syntax using `./mach lint -l rst`_

.. _./mach lint -l rst: /tools/lint/linters/rstlinter.html

5. If relevant, remove unbreakable spaces (rendered with a "!" on Phabricator)

.. code-block:: shell

   $ sed -i -e 's/\xc2\xa0/ /g' doc.rst