docs_writing_guidelines.rst 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. .. _doc_docs_writing_guidelines:
  2. Writing guidelines
  3. ==================
  4. The Godot community is rich and international. Users come from all
  5. around the world. Some of them are young, and many aren't native English
  6. speakers. That's why we must all write using a clear and a common
  7. language. For the class reference, the goal is to make it easy to read
  8. for everyone and precise.
  9. In summary, always try to:
  10. 1. Use the active voice
  11. 2. Use precise action verbs
  12. 3. Avoid verbs that end in -ing
  13. 4. Remove unnecessary adverbs and adjectives.
  14. 5. Ban these 8 words: obvious, simple, basic, easy, actual, just, clear, and however
  15. 6. Use explicit references
  16. 7. Use 's to show possession
  17. 8. Use the Oxford comma
  18. There are 3 rules to describe classes:
  19. 1. Give an overview of the node in the brief description
  20. 2. Mention what methods return if it's useful
  21. 3. Use "if true" to describe booleans
  22. .. note::
  23. A technical writer's job is to pack as much information as possible into
  24. the smallest and clearest sentences possible. These guidelines will help
  25. you work towards that goal.
  26. .. seealso::
  27. See the :ref:`content guidelines <doc_content_guidelines>` for information
  28. on the types of documentation you can write in the official documentation.
  29. 7 rules for clear English
  30. -------------------------
  31. Use the active voice
  32. ~~~~~~~~~~~~~~~~~~~~
  33. Use the active voice when possible. Take the classes, methods, and
  34. constants you describe as the subject. It's natural to write using the
  35. passive voice, but it's harder to read and produces longer sentences.
  36. .. highlight:: none
  37. Passive:
  38. ::
  39. The man **was bitten** by the dog.
  40. Active:
  41. ::
  42. The dog bit the man.
  43. **Don't** use the passive voice:
  44. ::
  45. void edit_set_pivot ( Vector2 pivot )
  46. [...] This method **is implemented** only in some nodes that inherit Node2D.
  47. **Do** use the node's name as a noun:
  48. ::
  49. void edit_set_pivot ( Vector2 pivot )
  50. [...] Only some Node2Ds **implement** this method.
  51. Use precise action verbs
  52. ~~~~~~~~~~~~~~~~~~~~~~~~
  53. Favor precise yet common verbs over generic ones like ``make``, ``set``,
  54. and any expression you can replace with a single word.
  55. **Don't** repeat the method's name. It already states it sets the pivot
  56. value to a new one:
  57. ::
  58. void edit_set_pivot ( Vector2 pivot )
  59. Set the pivot position of the 2D node to [code]pivot[/code] value. [...]
  60. **Do** explain what's the consequence of this "set": use precise verbs
  61. like ``place``, ``position``, ``rotate``, ``fade``, etc.
  62. ::
  63. void edit_set_pivot ( Vector2 pivot )
  64. Position the node's pivot to the [code]pivot[/code] value. [...]
  65. Avoid verbs that end in -ing
  66. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67. The progressive forms describe continuous actions. E.g. "is calling",
  68. "is moving".
  69. **Don't** use the progressive form for instant changes.
  70. ::
  71. Vector2 move ( Vector2 rel_vec )
  72. Move the body in the given direction, **stopping** if there is an obstacle. [...]
  73. **Do** use simple present, past, or future.
  74. ::
  75. Vector2 move ( Vector2 rel_vec )
  76. Moves the body in the vector's direction. The body **stops** if it collides with an obstacle. [...]
  77. Exception: If the subject is not clear, replacing "ing" verbs is not an
  78. improvement. For example, in the previous sentence, "it replaces"
  79. would not make much sense where "replacing" currently is.
  80. You may use the progressive tense to describe actions that are
  81. continuous in time. Anything like animation or coroutines.
  82. .. tip::
  83. Verbs can turn into adjectival nouns with -ing. This is not a
  84. conjugation, so you may use them: ``the remaining movement``,
  85. ``the missing file``, etc.
  86. Remove unnecessary adverbs and adjectives
  87. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  88. Write as few adjectives and adverbs as possible. Only use them if they
  89. add key information to the description.
  90. **Don't** use redundant or meaningless adverbs. Words that lengthen the
  91. documentation but don't add any information:
  92. ::
  93. **Basically** a big texture [...]
  94. **Do** write short sentences in a simple, descriptive language:
  95. ::
  96. A big texture [...]
  97. Ban these 8 words
  98. ~~~~~~~~~~~~~~~~~
  99. **Don't** ever use these 8 banned words:
  100. 1. obvious
  101. 2. simple
  102. 3. basic
  103. 4. easy
  104. 5. actual
  105. 6. just
  106. 7. clear
  107. 8. however (some uses)
  108. Game creation and programming aren't simple, and nothing's easy to
  109. someone learning to use the API for the first time. Other words in the
  110. list, like ``just`` or ``actual`` won't add any info to the sentence.
  111. Don't use corresponding adverbs either: obviously, simply, basically,
  112. easily, actually, clearly.
  113. **Don't** example. The banned words lengthen the description and take
  114. attention away from the most important info:
  115. ::
  116. **TextureRect**
  117. Control frame that **simply** draws an assigned texture. It can stretch or not. It's a **simple** way to **just** show an image in a UI.
  118. **Do** remove them:
  119. ::
  120. **TextureRect**
  121. [Control] node that displays a texture. The texture can stretch to the node's bounding box or stay in the center. Useful to display sprites in your UIs.
  122. "Simple" never helps. Remember, for other users, anything could be
  123. complex or frustrate them. There's nothing like a good old *it's simple*
  124. to make you cringe. Here's the old brief description, the first sentence
  125. on the Timer node's page:
  126. ::
  127. **Timer**
  128. A **simple** Timer node.
  129. **Do** explain what the node does instead:
  130. ::
  131. **Timer**
  132. Calls a function of your choice after a certain duration.
  133. **Don't** use "basic", it is too vague:
  134. ::
  135. **Vector3**
  136. Vector class, which performs **basic** 3D vector math operations.
  137. **Do** use the brief description to offer an overview of the node:
  138. ::
  139. **Vector3**
  140. Provides essential math functions to manipulate 3D vectors: cross product, normalize, rotate, etc.
  141. Use explicit references
  142. ~~~~~~~~~~~~~~~~~~~~~~~
  143. Favor explicit references over implicit ones.
  144. **Don't** use words like "the former", "the latter", etc. They're not
  145. the most common in English, and they require you to check the reference.
  146. ::
  147. [code]w[/code] and [code]h[/code] define right and bottom margins. The **latter** two resize the texture so it fits in the defined margin.
  148. **Do** repeat words. They remove all ambiguity:
  149. ::
  150. [code]w[/code] and [code]h[/code] define right and bottom margins. **[code]w[/code] and [code]h[/code]** resize the texture so it fits the margin.
  151. If you need to repeat the same variable name 3 or 4 times, you probably
  152. need to rephrase your description.
  153. Use 's to show possession
  154. ~~~~~~~~~~~~~~~~~~~~~~~~~
  155. Avoid "The milk **of** the cow". It feels unnatural in English. Write "The cow's
  156. milk" instead.
  157. **Don't** write "of the X":
  158. ::
  159. The region **of the AtlasTexture that is** used.
  160. **Do** use ``'s``. It lets you put the main subject at the start of the
  161. sentence, and keep it short:
  162. ::
  163. The **AtlasTexture's** used region.
  164. Use the Oxford comma to enumerate anything
  165. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  166. From the Oxford dictionary:
  167. The 'Oxford comma' is an optional comma before the word 'and' at the end of a list:
  168. *We sell books, videos, and magazines.*
  169. [...] Not all writers and publishers use it, but it can clarify the meaning of a sentence when the items in a list are not single words:
  170. *These items are available in black and white, red and yellow, and blue and green.*
  171. **Don't** leave the last element of a list without a comma:
  172. ::
  173. Create a CharacterBody2D node, a CollisionShape2D node and a sprite node.
  174. **Do** add a comma before `and` or `or`, for the last
  175. element of a list with more than two elements.
  176. ::
  177. Create a CharacterBody2D node, a CollisionShape2D node, and a sprite node.
  178. How to write methods and classes
  179. --------------------------------
  180. Dynamic vs static typing
  181. ~~~~~~~~~~~~~~~~~~~~~~~~
  182. The code examples in the documentation should follow a consistent style not to
  183. confuse users. As static type hints are an optional feature of GDScript, we
  184. chose to stick to writing dynamic code. This leads to writing GDScript that is
  185. concise and accessible.
  186. The exception is topics that explain static typing concepts to users.
  187. **Don't** add a type hint with a colon or by casting:
  188. ::
  189. const MainAttack := preload("res://fire_attack.gd")
  190. var hit_points := 5
  191. var name: String = "Bob"
  192. var body_sprite := $Sprite2D as Sprite2D
  193. **Do** write constants and variables with dynamic typing:
  194. ::
  195. const MainAttack = preload("res://fire_attack.gd")
  196. var hit_points = 5
  197. var name = "Bob"
  198. var body_sprite = $Sprite2D
  199. **Don't** write functions with inferred arguments or return types:
  200. ::
  201. func choose(arguments: PackedStringArray) -> String:
  202. # Chooses one of the arguments from array with equal chances
  203. randomize()
  204. var size := arguments.size()
  205. var choice: int = randi() % size
  206. return arguments[choice]
  207. **Do** write functions using dynamic typing:
  208. ::
  209. func choose(arguments):
  210. # Chooses one of the arguments from array with equal chances
  211. randomize()
  212. var size = arguments.size()
  213. var choice = randi() % size
  214. return arguments[choice]
  215. Use real-world code examples where appropriate
  216. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  217. Real-world examples are more accessible to beginners than abstract ``foos`` and
  218. ``bars``. You can also copy them directly from your game projects, ensuring that
  219. any code snippet compiles without errors.
  220. Writing ``var speed = 10`` rather than ``var my_var = 10`` allows beginners to
  221. understand code better. It gives them a frame of reference as to where they
  222. could use the code snippets in a live project.
  223. **Don't** write made-up examples:
  224. .. code-block:: gdscript
  225. @onready var a = preload("res://MyPath")
  226. @onready var my_node = $MyNode
  227. func foo():
  228. # Do stuff
  229. **Do** write concrete examples:
  230. .. code-block:: gdscript
  231. @onready var sfx_player_gun = preload("res://Assets/Sound/SFXPlayerGun.ogg")
  232. @onready var audio_player = $Audio/AudioStreamPlayer
  233. func play_shooting_sound():
  234. audio_player.stream = sfx_player_gun
  235. audio_player.play()
  236. Of course, there are times when using real-world examples is impractical. In
  237. those situations, you should still avoid using names such as ``my_var``,
  238. ``foo()`` or ``my_func()`` and consider more meaningful names for your examples.
  239. Give an overview of the node in the brief description
  240. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  241. The brief description is the reference's most important sentence. It's
  242. the user's first contact with a node:
  243. 1. It's the only description in the "Create New Node" dialog.
  244. 2. It's at the top of every page in the reference
  245. The brief description should explain the node's role and its
  246. functionality, in up to 200 characters.
  247. **Don't** write tiny and vague summaries:
  248. ::
  249. **Node2D**
  250. Base node for 2D system.
  251. **Do** give an overview of the node's functionality:
  252. ::
  253. **Node2D**
  254. A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index.
  255. Use the node's full description to provide more information, and a code
  256. example, if possible.
  257. Mention what methods return if it's useful
  258. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  259. Some methods return important values. Describe them at the end of the
  260. description, ideally on a new line. No need to mention the return values
  261. for any method whose name starts with ``set`` or ``get``.
  262. **Don't** use the passive voice:
  263. ::
  264. Vector2 move ( Vector2 rel_vec )
  265. [...] The returned vector is how much movement was remaining before being stopped.
  266. **Do** always use "Returns".
  267. ::
  268. Vector2 move ( Vector2 rel_vec )
  269. [...] Returns the remaining movement before the body was stopped.
  270. Notice the exception to the "direct voice" rule: with the move method,
  271. an external collider can influence the method and the body that calls
  272. ``move``. In this case, you can use the passive voice.
  273. Use "if true" to describe booleans
  274. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  275. For boolean member variables, always use ``if true`` and/or
  276. ``if false``, to stay explicit. ``Controls whether or not`` may be
  277. ambiguous and won't work for every member variable.
  278. Also, surround boolean values, variable names and methods with ``[code][/code]``.
  279. **Do** start with "if true":
  280. ::
  281. Timer.autostart
  282. If [code]true[/code], the timer will automatically start when entering the scene tree.
  283. Use ``[code]`` around arguments
  284. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  285. In the class reference, always surround arguments with ``[code][/code]``. In the
  286. documentation and in Godot, it will display like ``this``. When you edit XML
  287. files in the Godot repository, replace existing arguments written like 'this' or
  288. \`this\` with ``[code]this[/code]``.
  289. Common vocabulary to use in Godot's documentation
  290. -------------------------------------------------
  291. The developers chose some specific words to refer to areas of the
  292. interface. They're used in the sources, in the documentation, and you
  293. should always use them instead of synonyms, so the users know what
  294. you're talking about.
  295. .. figure:: img/editor-vocabulary-overview.png
  296. :alt: Overview of the interface and common vocabulary
  297. Overview of the interface and common vocabulary
  298. In the top left corner of the editor lie the ``main menus``. In the
  299. center, the buttons change the ``workspace``. And together the buttons
  300. in the top right are the ``playtest buttons``. The area in the center,
  301. that displays the 2D or the 3D space, is the ``viewport``. At its top,
  302. you find a list of ``tools`` inside the ``toolbar``.
  303. The tabs or dockable panels on either side of the viewport are
  304. ``docks``. You have the ``FileSystem dock``, the ``Scene dock`` that
  305. contains your scene tree, the ``Import dock``, the ``Node dock``, and
  306. the ``Inspector`` or ``Inspector dock``. With the default layout you may
  307. call the tabbed docks ``tabs``: the ``Scene tab``, the ``Node tab``...
  308. The Animation, Debugger, etc. at the bottom of the viewport are
  309. ``panels``. Together they make up the ``bottom panels``.
  310. Foldable areas of the Inspector are ``sections``. The node's parent
  311. class names, which you can't fold, are ``Classes`` e.g. the
  312. ``CharacterBody2D class``. And individual lines with key-value pairs are
  313. ``properties``. E.g. ``position`` or ``modulate color`` are both
  314. ``properties``.
  315. Keyboard shortcut guidelines
  316. ----------------------------
  317. Keyboard and mouse shortcuts should make use of the ``:kbd:`` tag, which allows
  318. shortcuts to stand out from the rest of the text and inline code. Use the
  319. compact form for modifier keys (:kbd:`Ctrl`/:kbd:`Cmd`) instead of their spelled
  320. out form (:kbd:`Control`/:kbd:`Command`). For combinations, use the ``+`` symbol
  321. with a space on either side of the symbol.
  322. Make sure to mention shortcuts that differ on macOS compared to other platforms.
  323. You can find a list of all shortcuts, including what they are on macOS, on
  324. :ref:`this page <doc_default_key_mapping>`.
  325. Try to integrate the shortcut into sentences the best you can. Here are some
  326. examples with the ``:kbd:`` tag left as-is for better visibility:
  327. - Press ``:kbd:`Ctrl + Alt + T``` to toggle the panel (``:kbd:`Opt + Cmd + T``` on macOS).
  328. - Press ``:kbd:`Space``` and hold the left mouse button to pan in the 2D editor.
  329. - Press ``:kbd:`Shift + Up Arrow``` to move the node upwards by 8 pixels.
  330. Manual style guidelines
  331. -----------------------
  332. Follow these formatting and style guidelines when writing the manual.
  333. Use your best judgement. If you can write more clearly by breaking one of these
  334. guidelines, please do! But remember that the guidelines exist for a reason.
  335. .. note:: In many cases, the manual does not follow these guidelines. If you are
  336. already making changes to a paragraph or section of the docs, update it to
  337. follow these standards. Avoid making unrelated changes that *only* update style,
  338. since every change will require the paragraph to be re-translated.
  339. Text styles
  340. ~~~~~~~~~~~
  341. There are a few styles that the manual uses.
  342. +---------------------+--------------------------+------------------------------------------------------------------------+
  343. | Style | RST formatting | Typical usage |
  344. +=====================+==========================+========================================================================+
  345. | Plaintext | ``text`` | Used for most text. |
  346. +---------------------+--------------------------+------------------------------------------------------------------------+
  347. | *Italics* | ``*text*`` | Used for emphasis. Used for introducing new terms. |
  348. +---------------------+--------------------------+------------------------------------------------------------------------+
  349. | **Bold** | ``**text**`` | Used for emphasis, and for editor UI like menus and windows. |
  350. | | | |
  351. +---------------------+--------------------------+------------------------------------------------------------------------+
  352. | ``Code`` | `` text `` | Used for variable names, literal values, and code snippets. ``code`` is|
  353. | | | used in many cases where you would use "quoted plaintext" in typical |
  354. | | | English. |
  355. +---------------------+--------------------------+------------------------------------------------------------------------+
  356. | "Quotes" | ``"text"`` | Used for some literal or quoted values. In many cases, another |
  357. | | | style is preferred. |
  358. +---------------------+--------------------------+------------------------------------------------------------------------+
  359. Emphasis
  360. ~~~~~~~~
  361. Use either **bold style** or *italic style* to emphasize words or sentences.
  362. In most cases, either **bold** or *italics* is fine. Use whichever seems best,
  363. or whatever the page already uses.
  364. Prefer using **bold style** for simple emphasis.
  365. - Do **not** close the window without saving first.
  366. Use *italic style* or to emphasize one word in the context of a sentence.
  367. - You can *add* a node to the scene (but you can't connect one).
  368. - You can add a *node* to the scene (but you can't add a resource).
  369. - You can add a node to the *scene* (but you can't add one to a resource).
  370. Use *italic style* when introducing new technical terms. **Bold style**
  371. is fine too.
  372. - Godot uses *nodes* with *scripts* in a *scene tree*.
  373. - Godot uses **nodes** with **scripts** in a **scene tree**.
  374. Literals
  375. ~~~~~~~~
  376. Use ``code style`` for literal values. Literals include:
  377. - Integer or ``int`` literals like ``0``, ``-2``, or ``100``
  378. - Float literals like ``0.0``, ``0.5``, ``-2.0``, or ``100.0``
  379. - Vector literals like ``(0.0, 0.0)``, ``(0.5, -0.5, 0.5)``, or ``(1.0, 2.0, 3.0, 4.0)``.
  380. Classes, properties, and methods
  381. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  382. Link to classes the first time that you mention them in a page. After the first
  383. mention, use ``code style``. For common classes, like ``Node``, ``Control``, or
  384. ``Viewport``, you can also use plaintext.
  385. Link to class members (properties, methods, enums, and constants) the first time
  386. that you mention them in a page. After the first mention, use ``code style``. If
  387. the class member is very common, like a Node2D's ``position``, you don't have to
  388. link.
  389. When discussing properties in the context of the inspector, use **bold style**
  390. instead.
  391. Editor UI
  392. ~~~~~~~~~
  393. Use **bold style** for editor UI, including window titles, menus, buttons, input
  394. fields, inspector properties, and inspector sections. Use the exact
  395. capitalization that the editor uses.
  396. - Open the **Editor Settings** window.
  397. - Press the **Confirm** button.
  398. - Change the node's **Transform > Position** property to ``(0, 0)``.
  399. - In the **Project Settings** window, enable the **Advanced Settings** toggle.
  400. Use **Bold > With > Separators** when describing sequence of menus that the
  401. reader must navigate. Use ``>`` as a separator. You can omit ellipses in menu names.
  402. - In **Project > Project Settings > Input Map**, add a new input action.
  403. - Select **Scene > Export As... > MeshLibrary...**.
  404. - Select **Scene > Export As > MeshLibrary**.
  405. .. note:: Sometimes, ``->`` or ``→`` is used as a separator. This is nonstandard.
  406. Replace it with ``>`` if you are already making changes to a section.
  407. Project settings
  408. ~~~~~~~~~~~~~~~~
  409. Link to individual project settings. Either include the section and subsection
  410. in the link itself, or include the section and subsection separately from the
  411. link. Since long links are not split into multiple lines when the page is
  412. rendered, prefer splitting the setting name and the section when the link is long.
  413. - Set the :ref:`Application > Run > Max FPS<class_ProjectSettings_property_application/run/max_fps>` setting to ``60``.
  414. - In the project settings under **Application > Run**, set :ref:`Max FPS<class_ProjectSettings_property_application/run/max_fps>` to ``60``.
  415. - In **Project Settings > Application > Run**, set :ref:`Max FPS<class_ProjectSettings_property_application/run/max_fps>` to ``60``.
  416. Manually wrapping lines
  417. ~~~~~~~~~~~~~~~~~~~~~~~
  418. In the manual, lines must be manually wrapped to no more than 80-100 characters
  419. per line. However, links must not be split into multiple lines, and can exceed
  420. 100 characters. Tables can also exceed 100 characters.
  421. When making small changes, you don't need to manually re-wrap the whole paragraph,
  422. as long as the lines don't exceed 100 characters.
  423. **Bad:** Line length exceeds 100 characters:
  424. .. code-block::
  425. The best thing to do is to wrap lines to under 80 characters per line. Wrapping to around 80-90 characters per line is also fine.
  426. If your lines exceed 100 characters, you definitely need to add a newline! Don't forget to remove trailing whitespace when you do.
  427. **Good:** Lines are wrapped to 80-90 characters:
  428. .. code-block::
  429. The best thing to do is to wrap lines to under 80 characters per line. Wrapping to
  430. around 80-90 characters per line is also fine. If your lines exceed 100 characters, you
  431. definitely need to add a newline! Don't forget to remove trailing whitespace when you do.
  432. **Best:** Lines are wrapped to under 80 characters:
  433. .. code-block::
  434. The best thing to do is to wrap lines to under 80 characters per line. Wrapping
  435. to around 80-90 characters per line is also fine. If your lines exceed 100
  436. characters, you definitely need to add a newline! Don't forget to remove
  437. trailing whitespace when you do.
  438. .. tip:: In most text editors, you can add a vertical guide or "ruler" at 80
  439. characters. For example, in Visual Studio Code, you can add the following to
  440. your ``settings.json`` to add rulers at 80 and 100 characters:
  441. .. code:: json
  442. "editor.rulers": [80,100],
  443. When to refer to a specific Godot version
  444. -----------------------------------------
  445. Most of the time, the class reference and the manual should not specify the first
  446. version in which a feature is added. This is because the documentation describes
  447. the *current* features of the engine. Documentation will be read and maintained
  448. for many versions after it is initially written, and a reference to a first supported
  449. version is only relevant for a few versions after a feature is added. After that,
  450. it becomes historical trivia best left to a dedicated changelog.
  451. Follow these guidelines for when to refer to a specific Godot version:
  452. - If a feature was added in the current major version (4.x), **you can specify**
  453. the feature is new in 4.x.
  454. - If a feature or default approach to a problem was changed between major versions
  455. (3.x -> 4.x), describe the current feature in the main body of the page, and
  456. optionally add a brief sentence or note block to compare 3.x and 4.x.
  457. - If a large feature is added in a 4.x minor version, **you can specify** the minor
  458. version when it was added. Large features have a whole page or large section of
  459. documentation. In many cases it should still be avoided, since it's only relevant
  460. for the next few minor versions.
  461. - If a small feature is added in a 4.x minor version, **do not specify** the minor
  462. version when it was added. Small features have only a short section of
  463. documentation, or are minor additions to existing features.
  464. - If the default approach to a problem is changed in a 4.x minor version, **do
  465. specify** the minor version in which a new default approach was added. For example,
  466. the change from ``TileMap`` to ``TileMapLayer`` in 4.3.
  467. - If a feature was added in a 3.x major or minor version, **do not specify** when
  468. the feature was added. These features are old enough that the exact version
  469. in which they were added is not relevant.