{"title":"Menulis dokumentasi","version":"1.9","locale":"id","docname":"internals/contributing/writing-documentation","url":"/id/1.9/internals/contributing/writing-documentation/","canonical":"https://djangodocs.dev/id/1.9/internals/contributing/writing-documentation/","summary":"We place a high importance on consistency and readability of documentation. After all, Django was created in a journalism environment! So we treat our documentation…","html":"<h1>Menulis dokumentasi<a class=\"heading-anchor\" href=\"#writing-documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>We place a high importance on consistency and readability of documentation.\nAfter all, Django was created in a journalism environment! So we treat our\ndocumentation like we treat our code: we aim to improve it as often as\npossible.</p>\n<p>Dokumentasi berubah secara umum datang dalam dua bentuk:</p>\n<ul class=\"simple\">\n<li><p>Perbaikan umum: pembenaran kesalahan ketik, perbaikan kesalahan dan penjelasan lebih baik melalui penulisan lebih jelas dan lebih contoh.</p></li>\n<li><p>Fitur baru: dokumentasi dari ditur yang telah ditambahkan ke kerangka kerja sejak terbitan terakhir.</p></li>\n</ul>\n<p>This section explains how writers can craft their documentation changes\nin the most useful and least error-prone ways.</p>\n<section id=\"getting-the-raw-documentation\">\n<h2>Mendapatkan dokumentasi mentah<a class=\"heading-anchor\" href=\"#getting-the-raw-documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Though Django's documentation is intended to be read as HTML at\n<a class=\"reference external\" href=\"https://docs.djangoproject.com/\">https://docs.djangoproject.com/</a>, we edit it as a collection of text files for\nmaximum flexibility. These files live in the top-level <code class=\"docutils literal notranslate\"><span class=\"pre\">docs/</span></code> directory of a\nDjango release.</p>\n<p>If you'd like to start contributing to our docs, get the development version of\nDjango from the source code repository\n(see <a class=\"reference internal\" href=\"/id/1.9/topics/install/#installing-development-version\"><span class=\"std std-ref\">Installing the development version</span></a>). The development version has the\nlatest-and-greatest documentation, just as it has latest-and-greatest code.\nWe also backport documentation fixes and improvements, at the discretion of the\ncommitter, to the last release branch. That's because it's highly advantageous\nto have the docs for the last release be up-to-date and correct (see\n<a class=\"reference internal\" href=\"/id/1.9/intro/whatsnext/#differences-between-doc-versions\"><span class=\"std std-ref\">Perbedaan diantara versi</span></a>).</p>\n</section>\n<section id=\"getting-started-with-sphinx\">\n<h2>Mulai dengan Sphinx<a class=\"heading-anchor\" href=\"#getting-started-with-sphinx\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django's documentation uses the <a class=\"reference external\" href=\"http://sphinx-doc.org/\">Sphinx</a> documentation system, which in turn\nis based on <a class=\"reference external\" href=\"http://docutils.sourceforge.net/\">docutils</a>. The basic idea is that lightly-formatted plain-text\ndocumentation is transformed into HTML, PDF, and any other output format.</p>\n<p>To actually build the documentation locally, you'll currently need to install\nSphinx -- <code class=\"docutils literal notranslate\"><span class=\"pre\">pip</span> <span class=\"pre\">install</span> <span class=\"pre\">Sphinx</span></code> should do the trick.</p>\n<p>Kemudian, membangun HTML sangat mudah; cukup <code class=\"docutils literal notranslate\"><span class=\"pre\">make</span> <span class=\"pre\">html</span></code> (atau <code class=\"docutils literal notranslate\"><span class=\"pre\">make.bat</span> <span class=\"pre\">html</span></code> pada Windows) dari direktori <code class=\"docutils literal notranslate\"><span class=\"pre\">docs</span></code>.</p>\n<p>Untuk mulai membantu, anda akan ingin membaca  <a class=\"reference external\" href=\"https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rst-primer\" title=\"(di Sphinx v9.1.1)\"><span class=\"xref std std-ref\">reStructuredText Primer</span></a>. Setelah itu, anda akan ingin membaca tentang <span class=\"xref std std-ref\">Sphinx-specific markup</span> yang digunakan untuk mengelola meta data, pengindeksan, dan acuan-silang.</p>\n</section>\n<section id=\"how-the-documentation-is-organized\">\n<h2>Bagaimana dokumentasi diatur<a class=\"heading-anchor\" href=\"#how-the-documentation-is-organized\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Dokumentasi disusun kedalam beberapa kategori:</p>\n<ul>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/intro/\"><span class=\"doc\">Tutorials</span></a> membawa pembaca dengan tangan melalui rangkaian langkah-langkah untuk membuat sesuatu.</p>\n<p>Hal terpenting dalam tutorial ini adalah membantu pembaca mendapatkan sesuatu berguna,  lebih disukai seawal mungkin, agar memberikan mereka rasa nyaman.</p>\n<p>Explain the nature of the problem we're solving, so that the reader\nunderstands what we're trying to achieve. Don't feel that you need to begin\nwith explanations of how things work - what matters is what the reader does,\nnot what you explain. It can be helpful to refer back to what you've done and\nexplain afterwards.</p>\n</li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/topics/\"><span class=\"doc\">Topic guides</span></a> bertujuan untuk menjelaskan konsep atau subjek pada tingkatan yang cukup tinggi.</p>\n<p>Link to reference material rather than repeat it. Use examples and don't be\nreluctant to explain things that seem very basic to you - it might be the\nexplanation someone else needs.</p>\n<p>Menyediakan konteks latar belakang membantu pendatang baru menghubungkan topik ke hal-hal yang mereka sudah ketahui.</p>\n</li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/ref/\"><span class=\"doc\">Reference guides</span></a> mengandung acuan teknis untuk API. Mereka menggambarkan fungsi dari perlengkapan dalam Django dan petunjuk dalam penggunaannya.</p>\n<p>Keep reference material tightly focused on the subject. Assume that the\nreader already understands the basic concepts involved but needs to know or\nbe reminded of how Django does it.</p>\n<p>Reference guides aren't the place for general explanation. If you find\nyourself explaining basic concepts, you may want to move that material to a\ntopic guide.</p>\n</li>\n<li><p><a class=\"reference internal\" href=\"/id/1.9/howto/\"><span class=\"doc\">How-to guides</span></a> adalah resep yang membawa pembaca melalui langkah-langkah dalam subjek kunci.</p>\n<p>What matters most in a how-to guide is what a user wants to achieve.\nA how-to should always be result-oriented rather than focused on internal\ndetails of how Django implements whatever is being discussed.</p>\n<p>These guides are more advanced than tutorials and assume some knowledge about\nhow Django works. Assume that the reader has followed the tutorials and don't\nhesitate to refer the reader back to the appropriate tutorial rather than\nrepeat the same material.</p>\n</li>\n</ul>\n</section>\n<section id=\"writing-style\">\n<h2>Gaya menulis<a class=\"heading-anchor\" href=\"#writing-style\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>When using pronouns in reference to a hypothetical person, such as &quot;a user with\na session cookie&quot;, gender neutral pronouns (they/their/them) should be used.\nInstead of:</p>\n<ul class=\"simple\">\n<li><p>dia laki-laki atau dia perempuan... gunakan mereka</p></li>\n<li><p>dia laki-laki atau dia perempuan... gunakan mereka</p></li>\n<li><p>dia laki-laki atau dia perempuan... gunakan mereka</p></li>\n<li><p>dia laki-laki atau dia perempuan... gunakan mereka</p></li>\n<li><p>dia laki-laki atau dia perempuan... gunakan mereka</p></li>\n</ul>\n</section>\n<section id=\"commonly-used-terms\">\n<h2>Istilah umum digunakan<a class=\"heading-anchor\" href=\"#commonly-used-terms\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Ini adalah beberapa panduan pada istilah paling umum digunakan sepanjang dokumentasi:</p>\n<ul class=\"simple\">\n<li><p><strong>Django</strong> -- ketika mengacukan ke kerangka kerja, huruf besarkan Django. Huruf kecil hanya dalam kode Python dan dalam logo djangoproject.com.</p></li>\n<li><p><strong>email</strong> -- tanpa tanda penghubung</p></li>\n<li><p><strong>MySQL</strong>, <strong>PostgreSQL</strong>, <strong>SQLite</strong></p></li>\n<li><p><strong>SQL</strong> -- when referring to SQL, the expected pronunciation should be\n&quot;Ess Queue Ell&quot; and not &quot;sequel&quot;. Thus in a phrase like &quot;Returns an\nSQL expression&quot;, &quot;SQL&quot; should be preceded by &quot;an&quot; and not &quot;a&quot;.</p></li>\n<li><p><strong>Python</strong> -- when referring to the language, capitalize Python.</p></li>\n<li><p><strong>realize</strong>, <strong>customize</strong>, <strong>initialize</strong>, etc. -- use the American\n&quot;ize&quot; suffix, not &quot;ise.&quot;</p></li>\n<li><p><strong>subclass</strong> -- it's a single word without a hyphen, both as a verb\n(&quot;subclass that model&quot;) and as a noun (&quot;create a subclass&quot;).</p></li>\n<li><p><strong>Web</strong>, <strong>World Wide Web</strong>, <strong>the Web</strong> -- note Web is always\ncapitalized when referring to the World Wide Web.</p></li>\n<li><p><strong>website</strong> -- gunakan satu kata, tanpa huruf besar.</p></li>\n</ul>\n</section>\n<section id=\"django-specific-terminology\">\n<h2>Django-specific terminology<a class=\"heading-anchor\" href=\"#django-specific-terminology\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<ul class=\"simple\">\n<li><p><strong>model</strong> -- itu tidak huruf besar.</p></li>\n<li><p><strong>template</strong> -- itu tidak huruf besar.</p></li>\n<li><p><strong>URLconf</strong> -- gunakan tiga huruf besar, tanpa ruang sebelum &quot;conf.&quot;</p></li>\n<li><p><strong>view</strong> -- itu tidak huruf besar.</p></li>\n</ul>\n</section>\n<section id=\"guidelines-for-restructuredtext-files\">\n<h2>Panduan untuk berkas-berkas reStructuredText<a class=\"heading-anchor\" href=\"#guidelines-for-restructuredtext-files\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Panduan ini mengatur bentuk dari dokumentasi dari reST (reStructuredText) kami:</p>\n<ul>\n<li><p>In section titles, capitalize only initial words and proper nouns.</p></li>\n<li><p>Wrap the documentation at 80 characters wide, unless a code example\nis significantly less readable when split over two lines, or for another\ngood reason.</p></li>\n<li><p>The main thing to keep in mind as you write and edit docs is that the\nmore semantic markup you can add the better. So:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>Add ``django.contrib.auth`` to your ``INSTALLED_APPS``...\n</code></pre></div>\n<p>Isn't nearly as helpful as:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>Add :mod:`django.contrib.auth` to your :setting:`INSTALLED_APPS`...\n</code></pre></div>\n<p>This is because Sphinx will generate proper links for the latter, which\ngreatly helps readers. There's basically no limit to the amount of\nuseful markup you can add.</p>\n</li>\n<li><p>Gunakan <a class=\"reference external\" href=\"https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#module-sphinx.ext.intersphinx\" title=\"(di Sphinx v9.1.1)\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">intersphinx</span></code></a> untuk mengacu dokumentasi Python and Sphinx'.</p></li>\n<li><p>Gunakan gaya kepala ini:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">===</span>\n<span class=\"n\">One</span>\n<span class=\"o\">===</span>\n\n<span class=\"n\">Two</span>\n<span class=\"o\">===</span>\n\n<span class=\"n\">Three</span>\n<span class=\"o\">-----</span>\n\n<span class=\"n\">Four</span>\n<span class=\"o\">~~~~</span>\n\n<span class=\"n\">Five</span>\n<span class=\"o\">^^^^</span>\n</code></pre></div>\n</li>\n</ul>\n</section>\n<section id=\"django-specific-markup\">\n<h2>Django-specific markup<a class=\"heading-anchor\" href=\"#django-specific-markup\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Besides the <span class=\"xref std std-ref\">Sphinx built-in markup</span>, Django's\ndocs defines some extra description units:</p>\n<ul>\n<li><p>Pengaturan:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">setting</span><span class=\"p\">::</span> <span class=\"n\">INSTALLED_APPS</span>\n</code></pre></div>\n<p>To link to a setting, use <code class=\"docutils literal notranslate\"><span class=\"pre\">:setting:`INSTALLED_APPS`</span></code>.</p>\n</li>\n<li><p>Cetakan etiket:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">templatetag</span><span class=\"p\">::</span> <span class=\"n\">regroup</span>\n</code></pre></div>\n<p>Untuk mengkaitkan, gunakan <code class=\"docutils literal notranslate\"><span class=\"pre\">:ttag:`regroup`</span></code>.</p>\n</li>\n<li><p>Cetakan penyaring:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">templatefilter</span><span class=\"p\">::</span> <span class=\"n\">linebreaksbr</span>\n</code></pre></div>\n<p>To link, use <code class=\"docutils literal notranslate\"><span class=\"pre\">:tfilter:`linebreaksbr`</span></code>.</p>\n</li>\n<li><p>Field lookups (i.e. <code class=\"docutils literal notranslate\"><span class=\"pre\">Foo.objects.filter(bar__exact=whatever)</span></code>):</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">fieldlookup</span><span class=\"p\">::</span> <span class=\"n\">exact</span>\n</code></pre></div>\n<p>Untuk mengkaitkan, gunakan <code class=\"docutils literal notranslate\"><span class=\"pre\">:lookup:`exact`</span></code>.</p>\n</li>\n<li><p>Perintah <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span><span class=\"p\">::</span> <span class=\"n\">migrate</span>\n</code></pre></div>\n<p>Untuk mengkaitkan, gunakan <code class=\"docutils literal notranslate\"><span class=\"pre\">:djadmin:`migrate`</span></code>.</p>\n</li>\n<li><p>Pilihan baris-perintah <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span><span class=\"o\">-</span><span class=\"n\">option</span><span class=\"p\">::</span> <span class=\"o\">--</span><span class=\"n\">traceback</span>\n</code></pre></div>\n<p>To link, use <code class=\"docutils literal notranslate\"><span class=\"pre\">:option:`command_name</span> <span class=\"pre\">--traceback`</span></code> (or omit <code class=\"docutils literal notranslate\"><span class=\"pre\">command_name</span></code>\nfor the options shared by all commands like <code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span></code>).</p>\n</li>\n<li><p>Links to Trac tickets (typically reserved for patch release notes):</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>:ticket:`12345`\n</code></pre></div>\n</li>\n</ul>\n</section>\n<section id=\"documenting-new-features\">\n<span id=\"id3\"></span><h2>Mendokumentasikan fitur baru<a class=\"heading-anchor\" href=\"#documenting-new-features\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Kebijakan kami untuk fitur baru adalah:</p>\n<blockquote>\n<div><p>All documentation of new features should be written in a way that\nclearly designates the features are only available in the Django\ndevelopment version. Assume documentation readers are using the latest\nrelease, not the development version.</p>\n</div></blockquote>\n<p>Our preferred way for marking new features is by prefacing the features'\ndocumentation with: &quot;<code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionadded::</span> <span class=\"pre\">X.Y</span></code>&quot;, followed by a mandatory\nblank line and an optional description (indented).</p>\n<p>General improvements, or other changes to the APIs that should be emphasized\nshould use the &quot;<code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionchanged::</span> <span class=\"pre\">X.Y</span></code>&quot; directive (with the same format\nas the <code class=\"docutils literal notranslate\"><span class=\"pre\">versionadded</span></code> mentioned above.</p>\n<p>These <code class=\"docutils literal notranslate\"><span class=\"pre\">versionadded</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">versionchanged</span></code> blocks should be &quot;self-contained.&quot;\nIn other words, since we only keep these annotations around for two releases,\nit's nice to be able to remove the annotation and its contents without having\nto reflow, reindent, or edit the surrounding text. For example, instead of\nputting the entire description of a new or changed feature in a block, do\nsomething like this:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>.. class:: Author(first_name, last_name, middle_name=None)\n\n    A person who writes books.\n\n    ``first_name`` is ...\n\n    ...\n\n    ``middle_name`` is ...\n\n    .. versionchanged:: A.B\n\n        The ``middle_name`` argument was added.\n</code></pre></div>\n<p>Put the changed annotation notes at the bottom of a section, not the top.</p>\n<p>Also, avoid referring to a specific version of Django outside a\n<code class=\"docutils literal notranslate\"><span class=\"pre\">versionadded</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">versionchanged</span></code> block. Even inside a block, it's often\nredundant to do so as these annotations render as &quot;New in Django A.B:&quot; and\n&quot;Changed in Django A.B&quot;, respectively.</p>\n<p>If a function, attribute, etc. is added, it's also okay to use a\n<code class=\"docutils literal notranslate\"><span class=\"pre\">versionadded</span></code> annotation like this:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">attribute</span><span class=\"p\">::</span> <span class=\"n\">Author</span><span class=\"o\">.</span><span class=\"n\">middle_name</span>\n\n    <span class=\"o\">..</span> <span class=\"n\">versionadded</span><span class=\"p\">::</span> <span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">B</span>\n\n    <span class=\"n\">An</span> <span class=\"n\">author</span><span class=\"s1\">&#39;s middle name.</span>\n</code></pre></div>\n<p>We can simply remove the <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">versionadded::</span> <span class=\"pre\">A.B</span></code> annotation without any\nindentation changes when the time comes.</p>\n</section>\n<section id=\"minimizing-images\">\n<h2>Mengecilkan gambar<a class=\"heading-anchor\" href=\"#minimizing-images\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Optimize image compression where possible. For PNG files, use OptiPNG and\nAdvanceCOMP's <code class=\"docutils literal notranslate\"><span class=\"pre\">advpng</span></code>:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span><span class=\"nb\">cd</span><span class=\"w\"> </span>docs/\n<span class=\"gp\">$ </span>optipng<span class=\"w\"> </span>-o7<span class=\"w\"> </span>-zm1-9<span class=\"w\"> </span>-i0<span class=\"w\"> </span>-strip<span class=\"w\"> </span>all<span class=\"w\"> </span><span class=\"sb\">`</span>find<span class=\"w\"> </span>.<span class=\"w\"> </span>-type<span class=\"w\"> </span>f<span class=\"w\"> </span>-not<span class=\"w\"> </span>-path<span class=\"w\"> </span><span class=\"s2\">&quot;./_build/*&quot;</span><span class=\"w\"> </span>-name<span class=\"w\"> </span><span class=\"s2\">&quot;*.png&quot;</span><span class=\"sb\">`</span>\n<span class=\"gp\">$ </span>advpng<span class=\"w\"> </span>-z4<span class=\"w\"> </span><span class=\"sb\">`</span>find<span class=\"w\"> </span>.<span class=\"w\"> </span>-type<span class=\"w\"> </span>f<span class=\"w\"> </span>-not<span class=\"w\"> </span>-path<span class=\"w\"> </span><span class=\"s2\">&quot;./_build/*&quot;</span><span class=\"w\"> </span>-name<span class=\"w\"> </span><span class=\"s2\">&quot;*.png&quot;</span><span class=\"sb\">`</span>\n</code></pre></div>\n<p>This is based on OptiPNG version 0.7.5. Older versions may complain about the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--strip</span> <span class=\"pre\">all</span></code> option being lossy.</p>\n</section>\n<section id=\"an-example\">\n<h2>Sebuah contoh<a class=\"heading-anchor\" href=\"#an-example\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>For a quick example of how it all fits together, consider this hypothetical\nexample:</p>\n<ul>\n<li><p>First, the <code class=\"docutils literal notranslate\"><span class=\"pre\">ref/settings.txt</span></code> document could have an overall layout\nlike this:</p>\n<div class=\"code-block\" data-language=\"rst\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Rst</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Rst code\"><code><span class=\"gh\">========</span>\n<span class=\"gh\">Settings</span>\n<span class=\"gh\">========</span>\n\n<span class=\"c\">...</span>\n\n<span class=\"p\">..</span> <span class=\"nt\">_available-settings:</span>\n\n<span class=\"gh\">Available settings</span>\n<span class=\"gh\">==================</span>\n\n<span class=\"c\">...</span>\n\n<span class=\"p\">..</span> <span class=\"nt\">_deprecated-settings:</span>\n\n<span class=\"gh\">Deprecated settings</span>\n<span class=\"gh\">===================</span>\n\n<span class=\"c\">...</span>\n</code></pre></div>\n</li>\n<li><p>Next, the <code class=\"docutils literal notranslate\"><span class=\"pre\">topics/settings.txt</span></code> document could contain something like\nthis:</p>\n<div class=\"code-block\" data-language=\"rst\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Rst</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Rst code\"><code>You can access a :ref:`listing of all available settings\n<span class=\"nt\">&lt;available-settings&gt;</span>`. For a list of deprecated settings see\n<span class=\"na\">:ref:</span><span class=\"nv\">`deprecated-settings`</span>.\n\nYou can find both in the :doc:`settings reference document\n<span class=\"nt\">&lt;/ref/settings&gt;</span>`.\n</code></pre></div>\n<p>We use the Sphinx <a class=\"reference external\" href=\"https://www.sphinx-doc.org/en/master/usage/referencing.html#role-doc\" title=\"(di Sphinx v9.1.1)\"><code class=\"xref rst rst-role docutils literal notranslate\"><span class=\"pre\">doc</span></code></a> cross reference element when we want to\nlink to another document as a whole and the <a class=\"reference external\" href=\"https://www.sphinx-doc.org/en/master/usage/referencing.html#role-ref\" title=\"(di Sphinx v9.1.1)\"><code class=\"xref rst rst-role docutils literal notranslate\"><span class=\"pre\">ref</span></code></a> element when\nwe want to link to an arbitrary location in a document.</p>\n</li>\n<li><p>Next, notice how the settings are annotated:</p>\n<div class=\"code-block\" data-language=\"rst\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Rst</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Rst code\"><code><span class=\"p\">..</span> <span class=\"ow\">setting</span><span class=\"p\">::</span> ADMINS\n\n<span class=\"gh\">ADMINS</span>\n<span class=\"gh\">======</span>\n\nDefault: <span class=\"s\">``[]``</span> (Empty list)\n\nA list of all the people who get code error notifications. When\n<span class=\"s\">``DEBUG=False``</span> and a view raises an exception, Django will email these people\nwith the full exception information. Each member of the list should be a tuple\nof (Full name, email address). Example<span class=\"se\">::</span>\n\n<span class=\"s\">    [(&#39;John&#39;, &#39;john@example.com&#39;), (&#39;Mary&#39;, &#39;mary@example.com&#39;)]</span>\n\nNote that Django will email <span class=\"ge\">*all*</span> of these people whenever an error happens.\nSee <span class=\"na\">:doc:</span><span class=\"nv\">`/howto/error-reporting`</span> for more information.\n</code></pre></div>\n<p>This marks up the following header as the &quot;canonical&quot; target for the\nsetting <code class=\"docutils literal notranslate\"><span class=\"pre\">ADMINS</span></code>. This means any time I talk about <code class=\"docutils literal notranslate\"><span class=\"pre\">ADMINS</span></code>,\nI can reference it using <code class=\"docutils literal notranslate\"><span class=\"pre\">:setting:`ADMINS`</span></code>.</p>\n</li>\n</ul>\n<p>That's basically how everything fits together.</p>\n</section>\n<section id=\"improving-the-documentation\">\n<span id=\"id4\"></span><h2>Memperbaharui dokumentasi<a class=\"heading-anchor\" href=\"#improving-the-documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Sedikit perbaharuan kecil dapat dibuat untuk membuat dokumentasi dibaca dan kelihatan lebih baik:</p>\n<ul>\n<li><p>Most of the various <code class=\"docutils literal notranslate\"><span class=\"pre\">index.txt</span></code> documents have <em>very</em> short or even\nnon-existent intro text. Each of those documents needs a good short\nintro the content below that point.</p></li>\n<li><p>The glossary is very perfunctory. It needs to be filled out.</p></li>\n<li><p>Add more metadata targets. Lots of places look like:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>``File.close()``\n~~~~~~~~~~~~~~~~\n</code></pre></div>\n<p>... ini seharusnya menjadi:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"o\">..</span> <span class=\"n\">method</span><span class=\"p\">::</span> <span class=\"n\">File</span><span class=\"o\">.</span><span class=\"n\">close</span><span class=\"p\">()</span>\n</code></pre></div>\n<p>Yaitu, gunakan metadata daripada judul.</p>\n</li>\n<li><p>Jika memungkinkan, gunakan kaitan. Jadi gunakan <code class=\"docutils literal notranslate\"><span class=\"pre\">:setting:`ADMINS`</span></code> daripada <code class=\"docutils literal notranslate\"><span class=\"pre\">``ADMINS``</span></code>.</p></li>\n<li><p>Use directives where appropriate. Some directives\n(e.g. <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">setting::</span></code>) are prefix-style directives; they go <em>before</em>\nthe unit they're describing. These are known as &quot;crossref&quot; directives.\nOthers (e.g. <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">class::</span></code>) generate their own markup; these should go\ninside the section they're describing. These are called\n&quot;description units&quot;.</p>\n<p>You can tell which are which by looking at in\n<code class=\"file docutils literal notranslate\"><span class=\"pre\">_ext/djangodocs.py</span></code>; it registers roles as one of the other.</p>\n</li>\n<li><p>Add <code class=\"docutils literal notranslate\"><span class=\"pre\">..</span> <span class=\"pre\">code-block::</span> <span class=\"pre\">&lt;lang&gt;</span></code> to literal blocks so that they get\nhighlighted.</p></li>\n<li><p>When referring to classes/functions/modules, etc., you'll want to use\nthe fully-qualified name of the target\n(<code class=\"docutils literal notranslate\"><span class=\"pre\">:class:`django.contrib.contenttypes.models.ContentType`</span></code>).</p>\n<p>Since this doesn't look all that awesome in the output -- it shows the\nentire path to the object -- you can prefix the target with a <code class=\"docutils literal notranslate\"><span class=\"pre\">~</span></code>\n(that's a tilde) to get just the &quot;last bit&quot; of that path. So\n<code class=\"docutils literal notranslate\"><span class=\"pre\">:class:`~django.contrib.contenttypes.models.ContentType`</span></code> will just\ndisplay a link with the title &quot;ContentType&quot;.</p>\n</li>\n</ul>\n</section>\n<section id=\"spelling-check\">\n<span id=\"documentation-spelling-check\"></span><h2>Pemeriksaan ejaan<a class=\"heading-anchor\" href=\"#spelling-check\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Before you commit your docs, it's a good idea to run the spelling checker.\nYou'll need to install a couple packages first:</p>\n<ul class=\"simple\">\n<li><p><a class=\"reference external\" href=\"https://pypi.python.org/pypi/pyenchant/\">pyenchant</a> (which requires\n<a class=\"reference external\" href=\"http://www.abisource.com/projects/enchant/\">enchant</a>)</p></li>\n<li><p><a class=\"reference external\" href=\"https://pypi.python.org/pypi/sphinxcontrib-spelling/\">sphinxcontrib-spelling</a></p></li>\n</ul>\n<p>Then from the <code class=\"docutils literal notranslate\"><span class=\"pre\">docs</span></code> directory, run <code class=\"docutils literal notranslate\"><span class=\"pre\">make</span> <span class=\"pre\">spelling</span></code>. Wrong words (if any)\nalong with the file and line number where they occur will be saved to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">_build/spelling/output.txt</span></code>.</p>\n<p>If you encounter false-positives (error output that actually is correct), do\none of the following:</p>\n<ul class=\"simple\">\n<li><p>Surround inline code or brand/technology names with grave accents (`).</p></li>\n<li><p>Find synonyms that the spell checker recognizes.</p></li>\n<li><p>If, and only if, you are sure the word you are using is correct - add it\nto <code class=\"docutils literal notranslate\"><span class=\"pre\">docs/spelling_wordlist</span></code> (please keep the list in alphabetical order).</p></li>\n</ul>\n</section>\n<section id=\"translating-documentation\">\n<h2>menterjemahkan dokumentasi<a class=\"heading-anchor\" href=\"#translating-documentation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>See <a class=\"reference internal\" href=\"/id/1.9/internals/contributing/localizing/#translating-documentation\"><span class=\"std std-ref\">Localizing the Django documentation</span></a> if\nyou'd like to help translate the documentation into another language.</p>\n</section>\n<section id=\"django-admin-man-page\">\n<span id=\"django-admin-manpage\"></span><h2><code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> man page<a class=\"heading-anchor\" href=\"#django-admin-man-page\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Sphinx can generate a manual page for the\n<a class=\"reference internal\" href=\"/id/1.9/ref/django-admin/\"><span class=\"doc\">django-admin</span></a> command. This is configured in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/conf.py</span></code>. Unlike other documentation output, this man page should be\nincluded in the Django repository and the releases as\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/man/django-admin.1</span></code>. There isn't a need to update this file when\nupdating the documentation, as it's updated once as part of the release process.</p>\n<p>To generate an updated version of the man page, run <code class=\"docutils literal notranslate\"><span class=\"pre\">make</span> <span class=\"pre\">man</span></code> in the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs</span></code> directory. The new man page will be written in\n<code class=\"docutils literal notranslate\"><span class=\"pre\">docs/_build/man/django-admin.1</span></code>.</p>\n</section>","rootId":"writing-documentation","toc":[{"title":"Mendapatkan dokumentasi mentah","anchor":"getting-the-raw-documentation","children":[]},{"title":"Mulai dengan Sphinx","anchor":"getting-started-with-sphinx","children":[]},{"title":"Bagaimana dokumentasi diatur","anchor":"how-the-documentation-is-organized","children":[]},{"title":"Gaya menulis","anchor":"writing-style","children":[]},{"title":"Istilah umum digunakan","anchor":"commonly-used-terms","children":[]},{"title":"Django-specific terminology","anchor":"django-specific-terminology","children":[]},{"title":"Panduan untuk berkas-berkas reStructuredText","anchor":"guidelines-for-restructuredtext-files","children":[]},{"title":"Django-specific markup","anchor":"django-specific-markup","children":[]},{"title":"Mendokumentasikan fitur baru","anchor":"documenting-new-features","children":[]},{"title":"Mengecilkan gambar","anchor":"minimizing-images","children":[]},{"title":"Sebuah contoh","anchor":"an-example","children":[]},{"title":"Memperbaharui dokumentasi","anchor":"improving-the-documentation","children":[]},{"title":"Pemeriksaan ejaan","anchor":"spelling-check","children":[]},{"title":"menterjemahkan dokumentasi","anchor":"translating-documentation","children":[]},{"title":"django-admin man page","anchor":"django-admin-man-page","children":[]}],"breadcrumbs":[{"docname":"internals/index","title":"Dalam Django","url":"/id/1.9/internals/"},{"docname":"internals/contributing/index","title":"Membantu untuk Django","url":"/id/1.9/internals/contributing/"}],"prev":{"docname":"internals/contributing/writing-code/javascript","title":"JavaScript","url":"/id/1.9/internals/contributing/writing-code/javascript/"},"next":{"docname":"internals/contributing/localizing","title":"Localizing Django","url":"/id/1.9/internals/contributing/localizing/"},"formats":{"html":"/id/1.9/internals/contributing/writing-documentation/","markdown":"/id/1.9/internals/contributing/writing-documentation.md","json":"/id/1.9/internals/contributing/writing-documentation.json"},"source":"https://github.com/django/django/blob/stable/1.9.x/docs/internals/contributing/writing-documentation.txt","official":"https://docs.djangoproject.com/id/1.9/internals/contributing/writing-documentation/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9"],"inLocales":["en","fr","ja","id","pt-br","es"]}