|
| 1 | +# Development Guide |
| 2 | + |
| 3 | +## Add or Remove a Pinned Topic |
| 4 | + |
| 5 | +"Pinned" topics are always shown at the top of the category's listing. |
| 6 | + |
| 7 | +1. Find the category for the pinned topic under [the `content/categories` folder](../content/categories). |
| 8 | +1. Open the `_pins.md` file you find there. |
| 9 | +1. Add or remove the URL of the topic to the list. |
| 10 | +1. Save the file. |
| 11 | +1. Submit a [pull request](contributor-guide/pull-requests.md) for the change. |
| 12 | + |
| 13 | +## Change the Description of a Topic |
| 14 | + |
| 15 | +The content of the "**About the \_\_\_\_\_ category**" topics is used as the category description in the category listings. This description helps the users to understand whether the category is the appropriate place for a topic they are creating. |
| 16 | + |
| 17 | +1. Find the category for the pinned topic under [the `content/categories` folder](../content/categories). |
| 18 | +1. Open the `_topics` subfolder. |
| 19 | +1. Find the subfolder for the category's "**About the \_\_\_\_\_ category**" topic is used as the category description in the category listings. |
| 20 | +1. Open the `1.md` file from the subfolder. |
| 21 | +1. Make the desired changes to the content of the file. |
| 22 | +1. Save the file. |
| 23 | +1. Submit a [pull request](contributor-guide/pull-requests.md) for the change. |
| 24 | + |
| 25 | +## Add or Edit a Discourse Template |
| 26 | + |
| 27 | +["Discourse Templates"](https://meta.discourse.org/t/discourse-templates/229250) provide standardized reusable content for common posts. |
| 28 | + |
| 29 | +Templates are used in posts by clicking the **⚙** icon on the post composer toolbar and then selecting "**Insert template**" from the menu. |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +❗ The Discourse Templates feature is only available for staff members (moderators and administrators). |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +### Add Template |
| 38 | + |
| 39 | +The [existing templates](../content/categories/templates/_topics) will serve as a reference for the addition of new template source content. |
| 40 | + |
| 41 | +1. Open [the `content/categories/templates/_topics` folder](../content/categories/templates/_topics). |
| 42 | +1. Create a folder named according to the template title. |
| 43 | +1. Create a file named `README.md`. |
| 44 | +1. Add the template title as an H1 [heading](https://www.markdownguide.org/basic-syntax/#headings). <br /> |
| 45 | + For example: |
| 46 | + ```markdown |
| 47 | + # Some Amazing Template |
| 48 | + ``` |
| 49 | + **ⓘ** This will be the title shown in the "**Insert template**" interface on the forum. |
| 50 | +1. Save the file. |
| 51 | +1. Create a file named `1.md`. |
| 52 | +1. Add the template text to the file. |
| 53 | +1. Save the file. |
| 54 | +1. Submit a [pull request](contributor-guide/pull-requests.md) for the change. |
| 55 | + |
| 56 | +### Edit Template |
| 57 | + |
| 58 | +1. Open [the `content/categories/templates/_topics` folder](../content/categories/templates/_topics). |
| 59 | +1. Find the folder of the template you want to edit. |
| 60 | +1. If you want to edit the template title, open the `README.md` file and edit the text of the H1 [heading](https://www.markdownguide.org/basic-syntax/#headings). <br /> |
| 61 | + For example: |
| 62 | + ```markdown |
| 63 | + # Some Amazing Template |
| 64 | + ``` |
| 65 | +1. If you want to edit the template text, open the `1.md` file and edit the text. |
| 66 | +1. Save the file. |
| 67 | +1. Submit a [pull request](contributor-guide/pull-requests.md) for the change. |
| 68 | + |
| 69 | +## Add an Asset Topic |
| 70 | + |
| 71 | +New asset topics can be added to the repository to enable collaborative development and maintenance of its content. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +❗ In order to allow maintenance to continue in perpetuity, ownership of all posts maintained in this repository must be transferred to the forum's `@system` user. |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +1. Find the category for the topic under [the `content/categories` folder](../content/categories). |
| 80 | +1. Open the `_topics` subfolder. |
| 81 | +1. Create a folder named according to the topic title. |
| 82 | +1. Create a file named `README.md`. |
| 83 | +1. Add the topic title as an H1 [heading](https://www.markdownguide.org/basic-syntax/#headings). <br /> |
| 84 | + For example: |
| 85 | + ```markdown |
| 86 | + # Some Valuable Topic |
| 87 | + ``` |
| 88 | +1. If the topic is already published on Arduino Forum, add the URL under a `## Published At` heading. |
| 89 | + For example: |
| 90 | + ```markdown |
| 91 | + ## Published At |
| 92 | + |
| 93 | + https://forum.arduino.cc/t/some-valuable-topic/1234 |
| 94 | + ``` |
| 95 | +1. Save the file. |
| 96 | +1. Create a file named `1.md`. |
| 97 | +1. Add the post text to the file. |
| 98 | +1. Save the file. |
| 99 | +1. Repeat steps (8)-(10) for any additional asset posts in the topic (naming the file according to the post number). |
| 100 | +1. Submit a [pull request](contributor-guide/pull-requests.md) for the change. |
| 101 | + |
| 102 | +## Validating Your Work |
| 103 | + |
| 104 | +When you submit a pull request to the repository, automated checks will run to detect any problems or inconsistencies. It is possible to also run these checks locally during the development if you like. |
| 105 | + |
| 106 | +### Prerequisites |
| 107 | + |
| 108 | +The following development tools must be available in your local environment: |
| 109 | + |
| 110 | +- [**Task**](https://taskfile.dev/installation/) |
| 111 | +- [**Node.js**](https://nodejs.dev/en/download/) |
| 112 | +- [**Python**](https://www.python.org/downloads/) |
| 113 | +- [**Poetry**](https://python-poetry.org/docs/#installation) |
| 114 | + |
| 115 | +### Running Checks |
| 116 | + |
| 117 | +Execute the following command from the root of the repository to run all available checks: |
| 118 | + |
| 119 | +```text |
| 120 | +task check |
| 121 | +``` |
| 122 | + |
| 123 | +If you prefer to run specific checks individually, run the `task` command to get a list of available tasks. |
| 124 | + |
| 125 | +### Automatic Corrections |
| 126 | + |
| 127 | +Tools are provided to automatically bring the project into compliance with some of the required checks. |
| 128 | + |
| 129 | +Execute the following command from the root of the repository to run all available corrections: |
| 130 | + |
| 131 | +```text |
| 132 | +task fix |
| 133 | +``` |
| 134 | + |
| 135 | +If you prefer to run specific correction operations individually, run the `task` command to get a list of available tasks. |
0 commit comments