|
1 |
| -# Website |
| 1 | +# Fictionlab documentation |
2 | 2 |
|
3 |
| -This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator. |
| 3 | +Welcome to the Fictionlab documentation repository. This documentation is built |
| 4 | +using [Docusaurus 3](https://docusaurus.io/), a modern static website generator. |
4 | 5 |
|
5 |
| -### Installation |
| 6 | +## Links |
| 7 | + |
| 8 | +- [Production link](http://docs.fictionlab.pl) |
| 9 | +- [development (local) link](http://localhost:3000) |
| 10 | + |
| 11 | +## Getting Started |
| 12 | + |
| 13 | +### Prerequisites |
| 14 | + |
| 15 | +Ensure the following tools are installed on your local machine: |
| 16 | + |
| 17 | +- Code editor ([Visual Studio Code](https://code.visualstudio.com/) is |
| 18 | + recommended) |
| 19 | +- [Node.js](https://nodejs.org/en/) |
| 20 | +- [Yarn 1.22.22 (Classic)](https://classic.yarnpkg.com/en/) |
| 21 | +- [Git](https://git-scm.com/) |
| 22 | +- A web browser |
| 23 | + |
| 24 | +#### Recommended VS Code extensions |
| 25 | + |
| 26 | +<!-- prettier-ignore --> |
| 27 | +> [!TIP] |
| 28 | +> When opening this project in VS Code, you should be prompted to install the recommended extensions. If not, you can install them from the list below. |
| 29 | +
|
| 30 | +- [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) |
| 31 | +- [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) |
| 32 | +- [MDX](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) |
| 33 | +- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) |
| 34 | + |
| 35 | +### Cloning repository |
| 36 | + |
| 37 | +To clone the repository, execute the following command in your terminal: |
| 38 | + |
| 39 | +```sh |
| 40 | +git clone https://github.com/fictionlab/docs |
| 41 | +``` |
| 42 | + |
| 43 | +Alternatively, use the VS Code command palette: |
6 | 44 |
|
7 | 45 | ```
|
8 |
| -$ yarn |
| 46 | +> git clone |
9 | 47 | ```
|
10 | 48 |
|
11 |
| -### Local Development |
| 49 | +and paste the repository URL. |
| 50 | + |
| 51 | +By default, `development` branch is selected. To create new branch see |
| 52 | +[Updating the Documentation](#updating-the-documentation). |
| 53 | + |
| 54 | +### Launching development environment |
| 55 | + |
| 56 | +After cloning the repository, open the folder in VS Code and run: |
| 57 | + |
| 58 | +``` |
| 59 | +yarn install |
| 60 | +``` |
| 61 | + |
| 62 | +To start the development environment, use: |
| 63 | + |
| 64 | +``` |
| 65 | +yarn start |
| 66 | +``` |
| 67 | + |
| 68 | +A new browser tab will open at http://localhost:3000, reflecting any changes |
| 69 | +made to the files. |
| 70 | + |
| 71 | +## Editing the documentation |
| 72 | + |
| 73 | +### Creating documents |
| 74 | + |
| 75 | +To create an entirely new page, create a new `.mdx` file in the desired folder |
| 76 | +within the repository. Docusaurus maps the file structure relative to the |
| 77 | +`/docs` folder into web URLs. |
| 78 | + |
| 79 | +For example: `/docs/leo-rover/specification.mdx` is translated to |
| 80 | +`https://docs.fictionlab.pl/leo-rover/specification`. |
| 81 | + |
| 82 | +<!-- prettier-ignore --> |
| 83 | +> [!TIP] |
| 84 | +> To avoid including the document name in the URL (e.g., creating a `leo-rover` page), name the document the same as the parent folder. |
| 85 | +> Alternatively, you can name it `index.mdx`. For more information see: [Doc URLs - Docusaurus.io](https://docusaurus.io/docs/create-doc#doc-urls). |
| 86 | +
|
| 87 | +### Editing documents |
| 88 | + |
| 89 | +To update the documentation, clone this repository and create a new branch from |
| 90 | +`development` (or any other branch). For example, to create a branch named |
| 91 | +`feature/new-button` from `development`: |
12 | 92 |
|
13 | 93 | ```
|
14 |
| -$ yarn start |
| 94 | +git checkout -b feature/new-button development |
15 | 95 | ```
|
16 | 96 |
|
17 |
| -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. |
| 97 | +Make necessary modifications and test everything using the development |
| 98 | +environment. For guidelines on styling and formatting, refer to our |
| 99 | +Documentation style guide - |
| 100 | +[Documentation guidelines](https://docs.fictionlab.pl/guidelines). |
| 101 | + |
| 102 | +<!-- prettier-ignore --> |
| 103 | +> [!TIP] |
| 104 | +> For more information on Docusaurus, visit [docusaurus.io](https://docusaurus.io/docs). |
| 105 | +
|
| 106 | +### Testing implemented changes |
| 107 | + |
| 108 | +After making changes, test the compiled code in the browser. |
| 109 | + |
| 110 | +<!-- prettier-ignore --> |
| 111 | +> [!IMPORTANT] |
| 112 | +> Always test your edits on both desktop and mobile browsers. |
| 113 | +> |
| 114 | +> Use developer tools to simulate mobile views (press F12 and select Toggle device emulation in Chrome-based browsers). |
| 115 | +
|
| 116 | +Finally, check the spelling and formatting: |
| 117 | + |
| 118 | +``` |
| 119 | +yarn formatcheck |
| 120 | +``` |
18 | 121 |
|
19 |
| -### Build |
| 122 | +This will list files requiring formatting changes, which you can fix manually. |
| 123 | +To fix formatting automatically, use: |
20 | 124 |
|
21 | 125 | ```
|
22 |
| -$ yarn build |
| 126 | +yarn format |
23 | 127 | ```
|
24 | 128 |
|
25 |
| -This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 129 | +<!-- prettier-ignore --> |
| 130 | +> [!CAUTION] |
| 131 | +> Prettier has limited support for MDXv3. Automatic formatting can sometimes create unexpected results. |
| 132 | +> |
| 133 | +> For more details, see [docusaurus.io - usage with prettier](https://docusaurus.io/docs/markdown-features/admonitions#usage-with-prettier) |
26 | 134 |
|
27 |
| -### Deployment |
| 135 | +If using |
| 136 | +[Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) |
| 137 | +extension, you can also use Prettier to only format current document. To do |
| 138 | +this, in VS Code use **Shift+Alt+F** shortcut or type `> Format document` into |
| 139 | +search bar. |
28 | 140 |
|
29 |
| -Using SSH: |
| 141 | +To check spelling, run: |
30 | 142 |
|
31 | 143 | ```
|
32 |
| -$ USE_SSH=true yarn deploy |
| 144 | +yarn spellcheck |
33 | 145 | ```
|
34 | 146 |
|
35 |
| -Not using SSH: |
| 147 | +This will list unrecognized words in markdown files, which you must correct |
| 148 | +manually. |
| 149 | + |
| 150 | +<!-- prettier-ignore --> |
| 151 | +> [!TIP] |
| 152 | +> If you use the [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) |
| 153 | +> extension in VS Code, documents will be spell-checked in real-time. Any unrecognized words will be displayed in the PROBLEMS tab of VS Code. |
| 154 | +
|
| 155 | +Sometimes, CSpell will mistakenly mark correct words as unknown, including |
| 156 | +custom names like ROS topics and variables. To remove this error, add the word |
| 157 | +to the CSpell configuration. Right-click the word and select **Spelling** > |
| 158 | +**Add words to the CSpell configuration**. This can be done either in the editor |
| 159 | +or in the **PROBLEMS** tab of VS Code. |
| 160 | + |
| 161 | +In the editor, you can use the VS Code shortcut **Ctrl+.** to bring up the |
| 162 | +**Quick Fix** menu, which provides the same options as mentioned above. |
| 163 | + |
| 164 | +### Pushing Changes to the Remote Repository |
| 165 | + |
| 166 | +When ready, push your changes using: |
36 | 167 |
|
37 | 168 | ```
|
38 |
| -$ GIT_USER=<Your GitHub username> yarn deploy |
| 169 | +git push |
39 | 170 | ```
|
40 | 171 |
|
41 |
| -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
| 172 | +<!-- prettier-ignore --> |
| 173 | +> [!TIP] |
| 174 | +> For more information on using Git, see [Atlassian Git Tutorial](https://www.atlassian.com/git). |
| 175 | +
|
| 176 | +After pushing changes, create a Pull Request to merge them into the |
| 177 | +`development` branch. Your code will be reviewed by the Fictionlab team. Default |
| 178 | +reviewers are: |
| 179 | + |
| 180 | +- [@Krzemien97](https://github.com/Krzemien97) |
| 181 | +- [@bjsowa](https://github.com/bjsowa) |
| 182 | + |
| 183 | +<!-- prettier-ignore --> |
| 184 | +> [!WARNING] |
| 185 | +> Pull requests to the `production` branch from any branch other than `development` will not be merged. |
| 186 | +
|
| 187 | +### Branch Naming Conventions |
| 188 | + |
| 189 | +Follow these naming conventions for branches: |
| 190 | + |
| 191 | +- `/feature/description` - for new features, components etc. |
| 192 | +- `/content/description` - for markdown content updates |
| 193 | +- `/fix/description` - for fixes |
| 194 | +- `/chore/description` - for dependency updates |
| 195 | + |
| 196 | +## Reporting Issues |
| 197 | + |
| 198 | +To report documentation issues, create an |
| 199 | +[issue](https://github.com/fictionlab/docs/issues) on this repository or email |
| 200 | +us at contact@fictionlab.pl. |
0 commit comments