重要
翻訳は あなたが参加できる コミュニティの取り組みです。このページは現在 87.13% 翻訳されています。
2. 執筆のためのガイドライン
総じて、QGISプロジェクトのためにreSTドキュメントを作成するときには、 Python documentation style guidelines に従ってください。簡便のために以下に、QGISドキュメントを書く際に依拠すべき一般的なルールを、一通り示します。
2.1. ドキュメントを書く
2.1.1. 見出し
ドキュメントのそれぞれのウェブページには、ひとつの .rst ファイルが対応しています。
Sections used to structure the text are identified through their title which is underlined (and overlined for the first level). Same level titles must use same character for underline adornment. Precede section titles with a blank line. In QGIS Documentation, you should use following styles for chapter, section, subsection and minisec.
********
Chapter
********
Section
=======
Subsection
----------
Minisec
.......
Subminisec
^^^^^^^^^^
2.1.2. リスト
リストはテキストを構造化するのに便利です。ここではすべてのリストに共通する簡単な規則を紹介します:
すべての項目は大文字で始めてください
単独の簡単な文のみを含むリスト項目の後には句読点を使わないでください
複数の文または1つの複合文からなるリスト項目の句読点としてピリオド(
.)を使ってください
2.1.3. 字下げ
Indentation in reStructuredText should be aligned with the list or markup marker. It is also possible to create block quotes with indentation. See the Specification
#. In a numbered list, there should be
three spaces when you break lines
#. And next items directly follow
* Nested lists
* Are also possible
* And when they also have
a line that is too long,
the text should be naturally
aligned
* and be in their own paragraph
However, if there is an unindented paragraph, this will reset the numbering:
#. This item starts at 1 again
2.1.5. ラベル/参照
セクションやページへのハイパーリンクを作るのにテキスト内のアンカーを使うことができます。
次の例は、セクションのアンカー(ラベル/参照タイトルなど)を作成します
.. _my_anchor:
Label/reference
---------------
同じページ 内の参照を呼び出すには次を使います
see my_anchor_ for more information.
こうなります:
see my_anchor for more information.
「アンカー」に従って行/物にジャンプすることに注目してください。アポストロフィを使う必要はありませんが、アンカーの後に空行が必要です。
ドキュメント内のどこからでも 同じ場所にジャンプする別の方法は、 :ref: 役割を使うことです。
see :ref:`my_anchor` for more information.
これはキャプション(この場合はこのセクションのタイトル!)を含むリンクが作成されます:
see ラベル/参照 for more information.
つまり、参照1(my_anchor)と参照2(ラベル/参照)です。参照はしばしば完全なキャプションを表示するため、section という単語を使う必要はあまりありません。参照を説明するためにカスタムキャプションを使うこともできることに注意してください:
see :ref:`Label and reference <my_anchor>` for more information.
こうなります:
see Label and reference for more information.
2.1.6. 図と画像
画像
画像を挿入するには、次を使います
.. figure:: /static/common/logo.png
:width: 10 em
こうなります
Icon substitution
You can add an image inside a text paragraph (e.g., as a tool icon).
To do so, you first need to create an alias (also named substitution),
which is a reference name used to display the icon.
To ensure consistency across the documents and help in the use of the icons,
we maintain a list in the substitutions.txt file at the root of this repository.
Find more details in the 置換参照と定義 chapter.
Using an icon substitution is usually achieved through these steps:
Add the icon substitution in the
substitutions.txtfile as below. If a substitution already exists for the icon you want to use, then skip this step... |logo| image:: /static/common/logo.png :width: 1 em
Call it in your paragraph:
My paragraph begins here with |logo|.
Add (again) the icon substitution at the end of the file you are modifying. This helps connecting the replacement text with the actual image, and can be done by copy-pasting it from
substitutions.txtor by executing thescripts/find_set_subst.pyscript.これは例がどのように表示されるかを示します:
図
.. _figure_logo:
.. figure:: /static/common/logo.png
:width: 20 em
:align: center
A caption: A logo I like
これの結果は次の通りです:
図 2.24 A caption: A logo I like
他の参照との衝突を避けるため、図のアンカーは常に _figure_ で始め、図のキャプションにつながりやすい用語を使用してください。画像は中央揃えのみが必須ですが、図には必要に応じて他のオプション(width、height、scale など)を自由に使ってください。
スクリプトは、ドキュメントから生成されるHTML版とPDF版の図のキャプションの前に、自動的に生成された番号を挿入します。
キャプションを使用するには( My caption を参照)、図ブロックに空白行の後ろに字下げテキストを挿入します。
図はこのような参照ラベルを使って参照付けできます:
see :numref:`figure_logo`
こう表示されます:
see 図 2.24
これが図を参照する好ましい方法です。
注釈
:numref: を機能させるには、 図に キャプションが必要です 。
参照には :numref: の代わりに :ref: を使うことができますが、それは画像の完全なキャプションを返します。
see :ref:`figure_logo`
こう表示されます:
2.1.7. 表
You can make a simple table like this:
======= ======= =======
x y z
======= ======= =======
1 2 3
4 5
======= ======= =======
このように表示されます:
x |
y |
z |
|---|---|---|
1 |
2 |
3 |
4 |
5 |
Tables should have a caption. You can use an explicit reST "table" directive to add a caption to simple tables or grid tables. Add the caption on the same line as the directive and indent the table at least one space.
You can also add a hyperlink target
before a table in order to reference it elsewhere. To avoid conflicts with
other references, always begin hyperlink targets with _table_ and use terms
relevant to the table caption.
Here is an example of a more complicated grid table with a caption and a hyperlink target:
.. _table-grid-caption:
.. table:: Grid table with caption
+---------------+--------------------+
| Windows | macOS |
+---------------+--------------------+
| |win| | |osx| |
+---------------+--------------------+
| and of course not to forget |nix| |
+------------------------------------+
結果:
Windows |
macOS |
You may find it easier to use list tables
or CSV tables
to make complex tables. Add the caption after the list-table or
csv-table directive.
Here is an example of a list table with a caption and a hyperlink target:
.. _table-list-caption:
.. list-table:: List table with caption
:header-rows: 1
:widths: 20 20 20 40
* - What
- Purpose
- Key word
- Description
* - **Test**
- ``Useful test``
- complexity
- Geometry. One of:
* Point
* Line
結果:
What |
目的 |
Key word |
説明 |
|---|---|---|---|
テスト |
|
complexity |
Geometry. One of:
|
Use :numref: roles to reference tables like this:
see :numref:`table-grid-caption` or :numref:`table-list-caption`
結果:
注釈
You must add a caption to your table in order to create a cross reference
with the :numref: role.
2.1.8. Index
索引は読者がドキュメント内で必要な情報を見つけるのを手助けする手軽な方法です。QGISドキュメントは必須の索引項目のみを提供しています。本当に有用な(よく整理され、首尾一貫し、相互に関連づけられた)索引項目のセットのみを提供する助けとなるルールがいくつかあります。
索引は、人間が読めるもの、理解できるもの、翻訳可能なものでなければなりません。索引は複数の単語から作ることができますが、それらを繋ぐ不要な
_や-などは使用しないようにしてください。たとえばloading_layersやloadingLayersではなく、Loading layersとしてください。特別な綴りを持つ単語でない限りは、索引語の最初の文字のみを大文字にします。たとえば、
Loading layers、Atlas generation、WMS、pgsql2shpなどとします。常に現在の 索引語リスト に注意を払うことで、より好適な表現を正しい綴りで再利用し、不要な重複は避けるようにしてください。
Several index tags exist in reST. You can use the inline :index: tag
within normal text:
QGIS can load several :index:`Vector formats` supported by GDAL ...
ブロックレベルのマークアップの .. index:: を使うこともできます。これは次の段落の始まりにリンクします。上記ルールにより、ブロックレベルタグの使用を推奨します。
.. index:: WMS, WFS, Loading layers
single 、 pair 、 see のような索引パラメータの使用も推奨します。これはより構造化され相互に関連した索引語テーブルを作るのに有用です。索引作成についてのより詳しい情報は Index generating を参照してください。
2.1.9. 特別なコメント
時には、説明のいくつかのポイントを強調して、ユーザーに警告したり、注意喚起したり、ヒントを与えたりしたいことがあります。QGIS文書では、reSTの特別なディレクティブである ... warning::, ... seealso::, ... note::, ... tip:: を使っています。これらのディレクティブは、コメントを強調するフレームを生成します。詳しくは 段落レベルのマークアップ をご覧ください。警告とヒントの両方には、明確で適切なタイトルが必要です。
.. tip:: **Always use a meaningful title for tips**
Begin tips with a title that summarizes what it is about. This helps
users to quickly overview the message you want to give them, and
decide on its relevance.
2.1.10. コードスニペット
また、例を示したり、コードスニペットを挿入したい場合もあります。この場合、:: ディレクティブが挿入された行の下にコメントを記述します。 より良いレンダリング、特にコードに言語に合ったカラーハイライトを適用するには、code-blockディレクティブを使います(例:... code-block:: xml`. 詳細は、Showing code を参照してください。
注釈
Text in special comments will be translated, but text in code-block frames will not be translated. So keep comments in code blocks as short as possible and avoid comments unrelated to code.
2.1.11. 脚注
これは、脚注を作成するためのものです(例として示します [1] )
blabla [1]_
これが指しているのは:
2.2. スクリーンショットを管理する
2.2.1. 新しいスクリーンショットを追加
以下は、新しいスクリーンショットを、見た目良く作成するためのヒントです。画像ファイルは、参照元の .rst ファイルがあるフォルダの中の、画像フォルダ (img/) に置きます。
You can find some prepared QGIS projects that are used to create screenshots in the
./qgis-projectsfolder of this repository. This makes it easier to reproduce screenshots for the next version of QGIS. These projects use the QGIS Sample Data (aka Alaska Dataset), which should be unzipped and placed in the same folder as the QGIS-Documentation Repository.ウィンドウは説明に必要な範囲で最小にします(小さなモーダルウィンドウのためだけに全画面表示をするのは過剰です)。
ごちゃごちゃしていないほど良いです(すべてのツールバーをアクティブにする必要はありません)。
画像編集ソフトでリサイズしないでください。サイズは必要であれば
.rstファイル中で設定されます(解像度を適切に上げることなく大きさだけを縮小すると、画像が汚くなります)。背景はカットします。
背景が白でない場合は上部の角を透明にします。
Set print size resolution to
135 dpi(e.g., in GIMP scale down the image using and setting "X/Y" to135 pixels/in, and export it through ). This way, images will be at original size in HTML and at a good print resolution in the PDF.ImageMagickのconvertコマンドを使用して画像のバッチ処理を行うこともできます:
convert -units PixelsPerInch input.png -density 135 output.png
.pngで保存します (.jpegは避けてください)。スクリーンショットはテキストの記載に従った内容を表示していなければなりません。
Tip
Ubuntuの場合、以下のコマンドでグローバルメニュー機能を取り除き、メニューを持った小さなアプリケーション画面を作ることができます:
sudo apt autoremove appmenu-gtk appmenu-gtk3 appmenu-qt
2.2.2. 翻訳されたスクリーンショット
翻訳されたユーザガイド用にスクリーンショットを作成したい人向けのヒントです。
Translated images should be placed in a img/<your_language>/
folder. Use the same filename as the 'original' English screenshot.
2.3. プロセシングアルゴリズムのドキュメントを作成する
プロセシングアルゴリズムのドキュメントを書きたいときは、以下のガイドラインを考慮してください。
Processing algorithm help files are part of QGIS User Guide, so use the same formatting as the User Guide and other documentation.
各アルゴリズムのドキュメントは対応する プロバイダ フォルダと グループ ファイル中に置いてください。アルゴリズム ボロノイポリゴン は QGIS プロバイダと vectorgeometry グループに属します。そのため、説明を追加する正しいファイルは
source/docs/user_manual/processing_algs/qgis/vectorgeometry.rstです。注釈
ガイドを書き始める前に、そのアルゴリズムの説明がないかどうかを確認してください。すでにある場合は、既存の説明を拡張できます。
It is extremely important that each algorithm has an anchor that corresponds to the provider name + the unique name of the algorithm itself. This allows the Help button to open the Help page of the correct section. The anchor should be placed above the title, e.g. (see also the ラベル/参照 section):
.. _qgisvoronoipolygons: Voronoi polygons ----------------
アルゴリズム名を調べるには、「プロセシング」ツールボックスのアルゴリズム上にマウスを置くだけです。
Avoid using "This algorithm does this and that..." as the first sentence in the algorithm description. Try to use more general expressions like:
Takes a point layer and generates a polygon layer containing the...
アルゴリズムがすることをその名前を繰り返すことで説明するのは避け、また、パラメータの名前をパラメータの説明の中で繰り返さないようにしてください。例えば、アルゴリズムが
ボロノイポリゴンの場合、入力レイヤをポリゴンの計算に使用するレイヤと記述することを検討してください。説明中ではアルゴリズムにQGISのデフォルトショートカットがあるか、またはインプレース編集をサポートするのかを示します。
画像を追加してください!画像は千の言葉に値します!
.png形式を使用し、ドキュメントの一般的なガイドラインに従います(詳細は 図と画像 セクションを参照してください)。画像ファイルは正しいフォルダ、つまり編集中の.rstファイルの隣にあるimgフォルダに置いてください。必要に応じて、アルゴリズムに関する追加情報(例:出版物やウェブページ)を提供するリンクを「See Also」セクションに追加します。「 See also」セクションは、本当に見るべきものがある場合にのみ追加してください。グッドプラクティスとして、「See also」セクションは、類似のアルゴリズムへのリンクで埋めることができます。
アルゴリズムのパラメータと出力について明確に説明してください。既存のアルゴリズムからヒントを得てください。
アルゴリズムオプションの詳細な説明と重複しないようにします。この情報は、パラメータの説明に追加してください。
アルゴリズムやパラメータの説明にベクタジオメトリの型に関する情報を追加することは避けてください。その情報はパラメータの説明で利用できます。
Add the default value of the parameter, e.g.:
* - **Number of points** - ``NUMBER_OF_POINTS`` - [numeric: integer] Default: 1 - Number of points to create
サポートされている入力の 型 を説明してください。利用できる型がいくつかあり、次から選ぶことができます:
パラメータ/出力型
説明
視覚的な表示
ポイントベクタレイヤ
vector: pointラインベクタレイヤ
vector: lineポリゴンベクタレイヤ
vector: polygon全ての空間ベクタレイヤ
vector: geometryジオメトリのないベクタレイヤ
vector: table一般的なベクタレイヤ
ベクタ: 任意ベクタフィールド数値
tablefield: numericベクタフィールド文字列
tablefield: stringベクタフィールド一般
tablefield: anyラスタレイヤ
rasterラスタバンド
raster bandHTMLファイル
html式
expressionLine geometry
geometry: lineポイントジオメトリ
coordinates領域
extentCRS
crs列挙
enumerationリスト
list整数値
numeric: integer小数点値
numeric: double文字列
string
ブール値
booleanフォルダパス
フォルダファイル
file行列
matrixレイヤ
layer出力の型は入力の型と同じ
same as input定義
definition地図レイヤ
layerlist範囲(Range)
rangeAuthConfig
authconfigメッシュ
meshレイアウト
layoutLayoutItem
layoutitem色
color縮尺
scale地図のテーマ
map theme既存の、よく文書化されたアルゴリズムを研究し、有用なレイアウトをすべてコピーします。
作業が終わったら、 貢献のための一歩一歩 に記載されているガイドラインに従って、変更をコミットし、Pull Request を作成するだけです。
Here is an example of an existing algorithm to help you with the layout and the description:
.. _qgiscountpointsinpolygon:
Count points in polygon
-----------------------
Takes a point and a polygon layer and counts the number of points from the
point layer in each of the polygons of the polygon layer.
A new polygon layer is generated, with the exact same content as the input
polygon layer, but containing an additional field with the points count
corresponding to each polygon.
.. figure:: img/count_points_polygon.png
:align: center
The labels in the polygons show the point count
An optional weight field can be used to assign weights to each point.
Alternatively, a unique class field can be specified. If both options
are used, the weight field will take precedence and the unique class field
will be ignored.
``Default menu``: :menuselection:`Vector --> Analysis Tools`
Parameters
..........
.. list-table::
:header-rows: 1
:widths: 20 20 20 40
:class: longtable
* - Label
- Name
- Type
- Description
* - **Polygons**
- ``POLYGONS``
- [vector: polygon]
- Polygon layer whose features are associated with the count of
points they contain
* - **Points**
- ``POINTS``
- [vector: point]
- Point layer with features to count
* - **Weight field**
Optional
- ``WEIGHT``
- [tablefield: numeric]
- A field from the point layer.
The count generated will be the sum of the weight field of the
points contained by the polygon.
* - **Class field**
Optional
- ``CLASSFIELD``
- [tablefield: any]
- Points are classified based on the selected attribute and if
several points with the same attribute value are within the
polygon, only one of them is counted.
The final count of the points in a polygon is, therefore, the
count of different classes that are found in it.
* - **Count field name**
- ``FIELD``
- [string]
Default: 'NUMPOINTS'
- The name of the field to store the count of points
* - **Count**
- ``OUTPUT``
- [vector: polygon]
Default: [Create temporary layer]
- Specification of the output layer type (temporary, file,
GeoPackage or PostGIS table).
Encoding can also be specified.
Outputs
.......
.. list-table::
:header-rows: 1
:widths: 20 20 20 40
* - Label
- Name
- Type
- Description
* - **Count**
- ``OUTPUT``
- [vector: polygon]
- Resulting layer with the attribute table containing the
new column with the points count






