הנחיות סגנון

This document contains the various MD and RST/Sphinx specific guidelines for the frc-docs project. For guidelines related to the various WPILib code projects, see the WPILib GitHub

שמות הקבצים

השתמשו רק באותיות קטנות באנגלית, במספרים, ובסימן - (מינוס).

למסמכים בעלי שם תוכנה/חומרה זהה, הוסיפו ”Hardware“ או ”Software“ בסוף שם הקובץ. לדוגמא, ultrasonics-hardware.rst.

תנו לקבצים את הסיומת .rst.

הערה

If you are having issues editing files with the .rst extension, the recommended text editor is VS Code with the reStructuredText extension.

טקסט

All text content should be on the same line. If you need readability, use the word-wrap function of your editor.

השתמשו בהתאמות האותיות הגדולות והקטנות באנגלית הבאות למונחים אלו:

  • roboRIO (לא RoboRIO, roboRio, או RoboRio)

  • LabVIEW (לא labview או LabView)

  • Visual Studio Code (VS Code) (לא vscode, VScode, vs code, וכו׳)

  • macOS (לא Mac OS, Mac OSX, Mac OS X, Mac, Mac OS, וכו׳)

  • GitHub (לא github, Github, וכו׳)

  • PowerShell (לא powershell, Powershell, וכו׳)

  • Linux (לא linux)

  • Java (לא java)

Use the ASCII character set for English text. For special characters (e.g. Greek symbols) use the standard character entity sets.

Use .. math:: for standalone equations and :math: for inline equations. A useful LaTeX equation cheat sheet can be found here.

השתמשו במילים פשוטות עבור שמות הקבצים, פונקציות ושמות משתנים.

Use of the registered trademarks FIRST® and FRC® should follow the Policy from this page. Specifically, where possible (i.e. not nested inside other markup or in a document title), the first use of the trademarks should have the ® symbol and all instances of FIRST should be italicized. The ® symbol can be added by using .. include:: <isonum.txt> at the top of the document and then using *FIRST*\ |reg| or FRC\ |reg|.

Commonly used terms should be added to the מילון מונחי FRC. You can reference items in the glossary by using :term:`deprecated`.

Whitespace

הזחה

ההזחה תמיד צריכה להתאים לרמה הקודמת של ההזחה, אלא אם כן אתם יוצרים בלוק תוכן חדש.

Indentation of content directives as new line .. toctree:: should be 3 spaces.

שורות ריקות

There should be 1 blank line separating basic text blocks and section titles. There should be 1 blank line separating text blocks and content directives.

Whitespace פנימי

השתמשו ברווח אחד בין משפטים.

כותרות

Headings should be in the following structure.

  1. # for document titles. Do not use this more than once per article.

  2. ## for document sections

  3. ### for document sub-sections

  4. #### for document sub-sub-sections

  5. אם אתם צריכים להשתמש ברמות נמוכות יותר של מבנה, אתם עושים דברים לא נכונים.

Use title case for headings.

רשימות

לרשימות צריך להיות קו חדש בכל רמת הזחה. על רשימה הגבוהה ביותר צריכה להיות בהזחה 0, ורשימות המשנה הבאות צריכות להיות בהזחה החל מהתו הראשון של ההזחה הקודמת.

- Block one
- Block two
- Block three
  - Sub 1
  - Sub 2
- Block four

בלוקי קוד

יש לציין שפה לכל בלוקי הקוד.

```python
print("Hello!")

import antigravity
```
  1. חריג: תוכן בו יש לשמור על עיצוב ואין לו שפה. במקום זאת השתמשו ב- text.

Follow the WPILib style guide for C++ and Java example code. For example, use two spaces for indentation in C++ and Java.

RLI (Remote Literal Include)

When possible, instead of using code blocks, an RLI should be used. This pulls code lines directly from GitHub, most commonly using the example programs. This automatically keeps the code up to date with any changes that are made. The format of an RLI is:

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted/Robot.java
   :language: java
   :lines: 19-25
   :lineno-match:

.. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2026.2.1/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp
   :language: c++
   :lines: 50-60
   :lineno-match:

.. remoteliteralinclude:: https://raw.githubusercontent.com/robotpy/examples/242924b3843fdcc6efc2cefa8eac7bfff8b6bc48/GettingStarted/robot.py
   :language: python
   :lines: 12-29
   :lineno-match:

Make sure to link to the raw version of the file on GitHub. There is a handy Raw button in the top right corner of the page.

הערה

RLIs should use a tag instead of main to ensure the documentation isn’t broken the next time there is a change to the RLIed code. If a tag hasn’t been created, use the full (40 character) commit hash.

Tabs

To create code tabs in an article, you can use the .. tab-set-code:: directive. You can use md style ``` codeblocks and rli directives inside. The format is:

.. tab-set-code::
   .. remoteliteralinclude:: https://raw.githubusercontent.com/wpilibsuite/allwpilib/v2026.2.1/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted/Robot.java
      :language: java
      :lines: 19-25
      :lineno-match:

   ```c++
   // Start the timer.
   m_timer.Start();
   // Send Field2d to SmartDashboard.
   frc::SmartDashboard::PutData(&m_field);
   // Reset the drivetrain's odometry to the starting pose of the trajectory.
   m_drive.ResetOdometry(m_trajectory.InitialPose());
   // Send our generated trajectory to Field2d.
   m_field.GetObject("traj")->SetTrajectory(m_trajectory);
   ```

If you need to use more than one tab per language, multiple RLIs per language, or text tabs, you can use the .. tab-set:: and .. tab-item:: directive. The format is:

.. tab-set::
   .. tab-item:: Title
      :sync: sync-id
         Content

This example uses the sync argument to allow all of the tabs with the same key to be synced together. This means that when you click on a tab, all of the tabs with the same key will open.

If you have a mix of tab-set and tab-set-code directives on a page, you can sync them by setting the sync id on the tab-item directives to tabcode-LANGUAGE. For example, a java tab would have a sync id of tabcode-java.

אזהרות

Admonitions (list here) should have their text on the same line as the admonition itself. There are exceptions to this rule, however, when having multiple sections of content inside of an admonition. Generally having multiple sections of content inside of an admonition is not recommended.

השתמשו ב:

.. warning:: This is a warning!

ולא ב:

.. warning::
   This is a warning!

תמונות

תמונות צריכות להיות עם שורה 1 חדשה המפרידה בין התוכן וההנחיה.

כל התמונות (כולל הווקטורים) צריכות להיות קטנות מ-500 קילובייט. אנא השתמשו ברזולוציה קטנה יותר ובאלגוריתמי דחיסה יעילים יותר.

.. image:: images/my-article/my-image.png
   :alt: Always add alt text here describing the image.

קבצי תמונה

Image files should be stored in the document directory, sub-directory of document-name/images.

עליהם להיות על פי תבנית השמות של short-description.png, כאשר שם התמונה הוא תיאור קצר של מה שהתמונה מראה. זה צריך להיות פחות מ-24 תווים.

הם צריכות להיות עם הסיומות .png או .jpg. הסיומת .gif אינה מקובלת בגלל חששות לאחסון ונגישות.

הערה

נגישות היא חשובה! כל התמנות חייבות להכיל :alt:.

.. image:: images/my-document/my-image.png
   :alt: An example image

תמונות וקטוריות

קבצי SVG נתמכים באמצעות הרחבת svg2pdfconverter של Sphinx.

השתמשו בהם כמו בכל תמונה אחרת.

הערה

ודאו כי תמונות פקסלים בווקטור אינן מנפחות את גודל הקובץ כדי לחרוג ממגבלת 500KB.

.. image:: images/my-document/my-image.svg
   :alt: Always add alt text here describing the image.

תרשימי Draw.io

Draw.io (also known as diagrams.net) diagrams are supported through svg files with embedded .drawio metadata, allowing the svg file to act as a source file of the diagrams, and to be rendered like a normal vector graphics file.

השתמשו בהם כמו בכל תמונה וקטורית אחרת, או בכל תמונה אחרת.

.. image:: diagrams/my-document/diagram-1.drawio.svg
   :alt: Always add alt text here describing the image.

קבצי Draw.io

קבצי Draw.io זהים לתבנית השמות של התמונות הרגילות. כדי לעקוב אחר קבצים עם מטא-דאטה .drawio, הוסיפו .drawio לסוף שם הקובץ, לפני הסיומת, לדוגמא document-title-1.drawio.svg. בנוסף, יש לאחסן דיאגרמות בספריית המסמכים בתיקיית משנה בשם diagrams.

לקבלת הפרטים על שמירת דיאגרמה כ- .svg עם מטא-דאטה, עיינו במסמך הנחיות שמירת Draw.io.

אזהרה

הקפידו לא לערוך שום קובץ שנמצא בתיקיית diagrams או מסתיים ב-.drawio.svg, בכל תוכנית אחרת שאינה draw.io, אחרת אתם עלולים להסתכן בשבירת המטא-דאטה של הקובץ, מה שיהפוך אותו לבלתי ניתן לעריכה.

סיומות הקבצים

סיומות קבצים צריכות להשתמש בעיצוב קוד. לדוגמה, השתמשו ב:

``.png``

במקום:

.png
".png"
"``.png``"

תוכן עניינים

כל קטגוריה צריכה להכיל index.rst. קובץ index זה צריך להכיל maxdepth של 1. תתי קטגוריות מקובלים, עם maxdepth של 1.

The category index.rst file can then be added to the root index file located at source/index.rst.

דוגמאות

# Title
This is an example article
```java
System.out.println("Hello World");
```
## Section
This is a section!

הערה חשובה!

רשימה זו אינה ממצה והמנהלים שומרים לעצמם את הזכות לבצע שינויים. שינויים יבואו לידי ביטוי במסמך זה.