From e50d615e562eed5fded04bd1ed9876e88ff01aa4 Mon Sep 17 00:00:00 2001 From: Kalle Westerling Date: Tue, 7 May 2024 17:51:08 +0100 Subject: [PATCH] Remove `$` from code blocks in documentation Fixes #411 --- .../backend/api/assurance-cases.md | 42 +++++++++---------- .../backend/api/authentication.md | 6 +-- .../platform-details/backend/api/comment.md | 10 ++--- .../platform-details/backend/api/github.md | 6 +-- .../platform-details/backend/api/group.md | 10 ++--- .../platform-details/backend/api/index.md | 6 +-- .../docs/platform-details/backend/api/user.md | 12 +++--- .../platform-details/backend/installation.md | 6 +-- .../platform-details/docker-quickstart.md | 8 ++-- .../platform-details/frontend/installation.md | 8 ++-- .../platform-details/reset-database/azure.md | 2 +- .../platform-details/reset-database/local.md | 6 +-- 12 files changed, 61 insertions(+), 61 deletions(-) diff --git a/site/docs/platform-details/backend/api/assurance-cases.md b/site/docs/platform-details/backend/api/assurance-cases.md index 2489b7ec..f963c6ce 100644 --- a/site/docs/platform-details/backend/api/assurance-cases.md +++ b/site/docs/platform-details/backend/api/assurance-cases.md @@ -13,7 +13,7 @@ The `curl` examples in the following serve as a quick way to test and interact w #### Request ```bash -$ curl -X GET http://localhost:8000/api/cases/ \ +curl -X GET http://localhost:8000/api/cases/ \ -H "Authorization: Token your_access_token_here" ``` @@ -26,7 +26,7 @@ A JSON array of assurance cases, each with its details. #### Request ```bash -$ curl -X POST http://localhost:8000/api/cases/ \ +curl -X POST http://localhost:8000/api/cases/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Case Name", "description": "Case Description", "lock_uuid": "", "color_profile": "default"}' @@ -41,7 +41,7 @@ JSON object of the created assurance case. #### Request ```bash -$ curl -X GET http://localhost:8000/api/cases// \ +curl -X GET http://localhost:8000/api/cases// \ -H "Authorization: Token your_access_token_here" ``` @@ -54,7 +54,7 @@ JSON object of the specified assurance case. #### Request ```bash -$ curl -X PUT http://localhost:8000/api/cases// \ +curl -X PUT http://localhost:8000/api/cases// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Case Name", "description": "Updated Case Description"}' @@ -69,7 +69,7 @@ JSON object of the updated assurance case. #### Request ```bash -$ curl -X DELETE http://localhost:8000/api/cases// \ +curl -X DELETE http://localhost:8000/api/cases// \ -H "Authorization: Token your_access_token_here" ``` @@ -84,14 +84,14 @@ HTTP 204 No Content on successful deletion. #### List All Goals ```bash -$ curl -X GET http://localhost:8000/api/goals/ \ +curl -X GET http://localhost:8000/api/goals/ \ -H "Authorization: Token your_access_token_here" ``` #### Create a New Goal ```bash -$ curl -X POST http://localhost:8000/api/goals/ \ +curl -X POST http://localhost:8000/api/goals/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Goal Name", "description": "Goal Description", "assurance_case": }' @@ -104,7 +104,7 @@ To update an existing goal element in an assurance case, use the PUT method at t ##### Request ```bash -$ curl -X PUT http://localhost:8000/api/goals// \ +curl -X PUT http://localhost:8000/api/goals// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Goal Name", "description": "Updated Goal Description"}' @@ -121,7 +121,7 @@ To delete a specific goal element from an assurance case, send a DELETE request ##### Request ```bash -$ curl -X DELETE http://localhost:8000/api/goals// \ +curl -X DELETE http://localhost:8000/api/goals// \ -H "Authorization: Token your_access_token_here" ``` @@ -134,14 +134,14 @@ HTTP 204 No Content on successful deletion, indicating the goal has been removed #### List All Contexts ```bash -$ curl -X GET http://localhost:8000/api/contexts/ \ +curl -X GET http://localhost:8000/api/contexts/ \ -H "Authorization: Token your_access_token_here" ``` #### Create a New Context ```bash -$ curl -X POST http://localhost:8000/api/contexts/ \ +curl -X POST http://localhost:8000/api/contexts/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Context Name", "description": "Context Description", "goal": }' @@ -154,7 +154,7 @@ To update details of a context element linked to a goal, utilize the PUT method ##### Request ```bash -$ curl -X PUT http://localhost:8000/api/contexts// \ +curl -X PUT http://localhost:8000/api/contexts// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Context Name", "description": "Updated Context Description"}' @@ -171,7 +171,7 @@ Remove a context element by sending a DELETE request to `/contexts//`. ##### Request ```bash -$ curl -X DELETE http://localhost:8000/api/contexts// \ +curl -X DELETE http://localhost:8000/api/contexts// \ -H "Authorization: Token your_access_token_here" ``` @@ -184,14 +184,14 @@ HTTP 204 No Content, confirming the context has been successfully deleted. #### List All Property Claims ```bash -$ curl -X GET http://localhost:8000/api/propertyclaims/ \ +curl -X GET http://localhost:8000/api/propertyclaims/ \ -H "Authorization: Token your_access_token_here" ``` #### Create a New Property Claim ```bash -$ curl -X POST http://localhost:8000/api/propertyclaims/ \ +curl -X POST http://localhost:8000/api/propertyclaims/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Property Claim Name", "description": "Property Claim Description", "goal": }' @@ -204,7 +204,7 @@ Property claims can be updated by sending a PUT request to `/propertyclaims// \ +curl -X PUT http://localhost:8000/api/propertyclaims/// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Claim Name", "description": "Updated Claim Description"}' @@ -221,7 +221,7 @@ To delete a property claim, issue a DELETE command to `/propertyclaims// ##### Request ```bash -$ curl -X DELETE http://localhost:8000/api/propertyclaims/// \ +curl -X DELETE http://localhost:8000/api/propertyclaims/// \ -H "Authorization: Token your_access_token_here" ``` @@ -234,14 +234,14 @@ HTTP 204 No Content upon successful removal of the property claim. #### List All Strategies ```bash -$ curl -X GET http://localhost:8000/api/strategies/ \ +curl -X GET http://localhost:8000/api/strategies/ \ -H "Authorization: Token your_access_token_here" ``` #### Create a New Strategy ```bash -$ curl -X POST http://localhost:8000/api/strategies/ \ +curl -X POST http://localhost:8000/api/strategies/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Strategy Name", "description": "Strategy Description", "goal": }' @@ -254,7 +254,7 @@ Modify an existing strategy by using the PUT method on `/strategies//`. ##### Request ```bash -$ curl -X PUT http://localhost:8000/api/strategies/// \ +curl -X PUT http://localhost:8000/api/strategies/// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Strategy Name", "description": "Updated Strategy Description"}' @@ -271,7 +271,7 @@ Remove a strategy from an assurance case by sending a DELETE request to `/strate ##### Request ```bash -$ curl -X DELETE http://localhost:8000/api/strategies/// \ +curl -X DELETE http://localhost:8000/api/strategies/// \ -H "Authorization: Token your_access_token_here" ``` diff --git a/site/docs/platform-details/backend/api/authentication.md b/site/docs/platform-details/backend/api/authentication.md index 6767a619..05f3c3b6 100644 --- a/site/docs/platform-details/backend/api/authentication.md +++ b/site/docs/platform-details/backend/api/authentication.md @@ -9,7 +9,7 @@ To authenticate a user and receive an access token for subsequent requests, use ### Request ```bash -$ curl -X POST http://localhost:8000/api/auth/login/ \ +curl -X POST http://localhost:8000/api/auth/login/ \ -H "Content-Type: application/json" \ -d '{"username": "your_username", "password": "your_password"}' ``` @@ -29,7 +29,7 @@ To log out a user and invalidate the current token, use the `/api/auth/logout/` ### Request ```bash -$ curl -X POST http://localhost:8000/api/auth/logout/ \ +curl -X POST http://localhost:8000/api/auth/logout/ \ -H "Authorization: Token your_access_token_here" ``` @@ -44,7 +44,7 @@ To create a new user account, submit a request to `/api/auth/register/` with the ### Request ```bash -$ curl -X POST http://localhost:8000/api/auth/register/ \ +curl -X POST http://localhost:8000/api/auth/register/ \ -H "Content-Type: application/json" \ -d '{ "username": "new_user", diff --git a/site/docs/platform-details/backend/api/comment.md b/site/docs/platform-details/backend/api/comment.md index 7fe8b8c0..95aa1b2d 100644 --- a/site/docs/platform-details/backend/api/comment.md +++ b/site/docs/platform-details/backend/api/comment.md @@ -13,7 +13,7 @@ Retrieve a list of all comments associated with a specific assurance case by mak ### Request ```bash -$ curl -X GET http://localhost:8000/api/comments// \ +curl -X GET http://localhost:8000/api/comments// \ -H "Authorization: Token your_access_token_here" ``` @@ -28,7 +28,7 @@ To add a new comment to an assurance case, use the POST method with the assuranc ### Request ```bash -$ curl -X POST http://localhost:8000/api/comments// \ +curl -X POST http://localhost:8000/api/comments// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"content": "Your insightful comment here."}' @@ -45,7 +45,7 @@ Access the details of a specific comment by its ID using a GET request. ### Request ```bash -$ curl -X GET http://localhost:8000/api/comments// \ +curl -X GET http://localhost:8000/api/comments// \ -H "Authorization: Token your_access_token_here" ``` @@ -60,7 +60,7 @@ Update the content of an existing comment by sending a PUT request to the commen ### Request ```bash -$ curl -X PUT http://localhost:8000/api/comments// \ +curl -X PUT http://localhost:8000/api/comments// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"content": "Updated content of the comment."}' @@ -77,7 +77,7 @@ To remove a comment from an assurance case, issue a DELETE request to the specif ### Request ```bash -$ curl -X DELETE http://localhost:8000/api/comments// \ +curl -X DELETE http://localhost:8000/api/comments// \ -H "Authorization: Token your_access_token_here" ``` diff --git a/site/docs/platform-details/backend/api/github.md b/site/docs/platform-details/backend/api/github.md index 537194e8..3819c975 100644 --- a/site/docs/platform-details/backend/api/github.md +++ b/site/docs/platform-details/backend/api/github.md @@ -15,7 +15,7 @@ Retrieve a list of all GitHub repositories associated with a specific user by th ### Request ```bash -$ curl -X GET http://localhost:8000/api/users///github_repositories/ \ +curl -X GET http://localhost:8000/api/users///github_repositories/ \ -H "Authorization: Token your_access_token_here" ``` @@ -30,7 +30,7 @@ To view all GitHub repositories linked within the TEA Platform, irrespective of ### Request ```bash -$ curl -X GET http://localhost:8000/api/github_repositories/ \ +curl -X GET http://localhost:8000/api/github_repositories/ \ -H "Authorization: Token your_access_token_here" ``` @@ -45,7 +45,7 @@ Link a new GitHub repository to the TEA Platform by providing the repository's d ### Request ```bash -$ curl -X POST http://localhost:8000/api/github_repositories/ \ +curl -X POST http://localhost:8000/api/github_repositories/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{ diff --git a/site/docs/platform-details/backend/api/group.md b/site/docs/platform-details/backend/api/group.md index 96b9af0e..670639b2 100644 --- a/site/docs/platform-details/backend/api/group.md +++ b/site/docs/platform-details/backend/api/group.md @@ -13,7 +13,7 @@ Retrieve a comprehensive list of all groups on the TEA Platform. This is useful ### Request ```bash -$ curl -X GET http://localhost:8000/api/groups/ \ +curl -X GET http://localhost:8000/api/groups/ \ -H "Authorization: Token your_access_token_here" ``` @@ -28,7 +28,7 @@ Establish a new group on the platform by specifying its name. This endpoint can ### Request ```bash -$ curl -X POST http://localhost:8000/api/groups/ \ +curl -X POST http://localhost:8000/api/groups/ \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "New Group Name"}' @@ -45,7 +45,7 @@ Access detailed information about a specific group by its ID. This endpoint prov ### Request ```bash -$ curl -X GET http://localhost:8000/api/groups// \ +curl -X GET http://localhost:8000/api/groups// \ -H "Authorization: Token your_access_token_here" ``` @@ -60,7 +60,7 @@ Modify the details of an existing group, such as its name or members. This endpo ### Request ```bash -$ curl -X PUT http://localhost:8000/api/groups// \ +curl -X PUT http://localhost:8000/api/groups// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"name": "Updated Group Name"}' @@ -77,7 +77,7 @@ Remove a group from the platform. This action should be used with caution, as it ### Request ```bash -$ curl -X DELETE http://localhost:8000/api/groups// \ +curl -X DELETE http://localhost:8000/api/groups// \ -H "Authorization: Token your_access_token_here" ``` diff --git a/site/docs/platform-details/backend/api/index.md b/site/docs/platform-details/backend/api/index.md index 54f7d60b..aa707eec 100644 --- a/site/docs/platform-details/backend/api/index.md +++ b/site/docs/platform-details/backend/api/index.md @@ -11,7 +11,7 @@ To get you started with the TEA Platform API, we'll walk you through a few basic To interact with the TEA Platform API, you'll first need to authenticate. If you're logging in, you'll typically post your credentials to receive an authentication token. ```bash -$ curl -X POST http://localhost:8000/auth/login/ \ +curl -X POST http://localhost:8000/auth/login/ \ -H 'Content-Type: application/json' \ -d '{"username": "yourusername", "password": "yourpassword"}' ``` @@ -21,7 +21,7 @@ $ curl -X POST http://localhost:8000/auth/login/ \ You can list assurance cases available to you. ```bash -$ curl -X GET http://localhost:8000/api/cases/ +curl -X GET http://localhost:8000/api/cases/ ``` ### Add a New Case @@ -29,7 +29,7 @@ $ curl -X GET http://localhost:8000/api/cases/ To create a new assurance case, you'll need to POST the required data. ```bash -$ curl -X POST http://localhost:8000/api/cases/ \ +curl -X POST http://localhost:8000/api/cases/ \ -H 'Authorization: Bearer your_token_here' \ -H 'Content-Type: application/json' \ -d '{"name": "New Assurance Case", "description": "Detailed description of the case", "user_id": "1", "lock_uuid": "", "color_profile": "default"}' diff --git a/site/docs/platform-details/backend/api/user.md b/site/docs/platform-details/backend/api/user.md index 23505adc..634ffb45 100644 --- a/site/docs/platform-details/backend/api/user.md +++ b/site/docs/platform-details/backend/api/user.md @@ -14,7 +14,7 @@ To view your own user details, including your username, email, and associated gr #### Request ```bash -$ curl -X GET http://localhost:8000/api/user/ \ +curl -X GET http://localhost:8000/api/user/ \ -H "Authorization: Token your_access_token_here" ``` @@ -31,7 +31,7 @@ Retrieve a list of all users on the TEA Platform, useful for finding collaborato #### Request ```bash -$ curl -X GET http://localhost:8000/api/users/ \ +curl -X GET http://localhost:8000/api/users/ \ -H "Authorization: Token your_access_token_here" ``` @@ -46,7 +46,7 @@ Add a new user to the TEA Platform by providing necessary information such as us #### Request ```bash -$ curl -X POST http://localhost:8000/api/users/ \ +curl -X POST http://localhost:8000/api/users/ \ -H "Content-Type: application/json" \ -d '{"username": "new_user", "email": "new_user@example.com", "password": "secure_password"}' ``` @@ -62,7 +62,7 @@ Access detailed information about a specific user by their user ID. #### Request ```bash -$ curl -X GET http://localhost:8000/api/users/// \ +curl -X GET http://localhost:8000/api/users/// \ -H "Authorization: Token your_access_token_here" ``` @@ -77,7 +77,7 @@ Modify details of an existing user, such as their username, email, or password. #### Request ```bash -$ curl -X PUT http://localhost:8000/api/users/// \ +curl -X PUT http://localhost:8000/api/users/// \ -H "Content-Type: application/json" \ -H "Authorization: Token your_access_token_here" \ -d '{"username": "updated_username", "email": "updated_email@example.com"}' @@ -94,7 +94,7 @@ Remove a user account from the TEA Platform. This action is irreversible and sho #### Request ```bash -$ curl -X DELETE http://localhost:8000/api/users/// \ +curl -X DELETE http://localhost:8000/api/users/// \ -H "Authorization: Token your_access_token_here" ``` diff --git a/site/docs/platform-details/backend/installation.md b/site/docs/platform-details/backend/installation.md index c63d78f4..e5f3bdc3 100644 --- a/site/docs/platform-details/backend/installation.md +++ b/site/docs/platform-details/backend/installation.md @@ -73,7 +73,7 @@ Welcome to the setup guide for the backend environment of the Trustworthy and Et After making any updates to the database schema or if you're running the server for the first time, ensure to apply migrations: ```shell -$ python manage.py migrate +python manage.py migrate ``` ## Running the API Server @@ -81,7 +81,7 @@ $ python manage.py migrate To start the API server, simply execute: ```shell -$ python manage.py runserver +python manage.py runserver ``` from the `eap_backend` directory. The server will restart automatically upon code changes, making development efficient and streamlined. @@ -91,7 +91,7 @@ from the `eap_backend` directory. The server will restart automatically upon cod It's good practice to run tests frequently during development. To execute the test suite, use: ```shell -$ python manage.py test +python manage.py test ``` ## Continue with Frontend Setup diff --git a/site/docs/platform-details/docker-quickstart.md b/site/docs/platform-details/docker-quickstart.md index 716f531e..71234f5d 100644 --- a/site/docs/platform-details/docker-quickstart.md +++ b/site/docs/platform-details/docker-quickstart.md @@ -19,7 +19,7 @@ Before beginning, ensure you have Docker and docker-compose installed on your sy Start by cloning the Assurance Platform repository from GitHub to your local machine. Open your terminal and run the following command: ```shell -$ git clone https://github.com/alan-turing-institute/AssurancePlatform.git +git clone https://github.com/alan-turing-institute/AssurancePlatform.git ``` This command downloads the project files to your local system. @@ -29,7 +29,7 @@ This command downloads the project files to your local system. After cloning, change your current directory to the AssurancePlatform folder: ```shell -$ cd AssurancePlatform/ +cd AssurancePlatform/ ``` ### Deploy with Docker Compose @@ -37,7 +37,7 @@ $ cd AssurancePlatform/ Use docker-compose to pull the necessary images and start the containers. Execute: ```shell -$ docker compose pull && docker compose up +docker compose pull && docker compose up ``` This command fetches the latest Docker images for the TEA Platform and runs them. The process may take a few minutes the first time as it downloads the images and initializes the containers. @@ -53,7 +53,7 @@ You should now see the TEA Platform's homepage, ready for exploration and use. When you're done using the platform and wish to stop the Docker containers, open a new terminal window. Ensure you're in the AssurancePlatform directory, then execute: ```shell -$ docker compose down +docker compose down ``` This command stops and removes the containers set up by docker-compose, effectively shutting down the platform until you choose to run it again. diff --git a/site/docs/platform-details/frontend/installation.md b/site/docs/platform-details/frontend/installation.md index 02344ca4..67297c54 100644 --- a/site/docs/platform-details/frontend/installation.md +++ b/site/docs/platform-details/frontend/installation.md @@ -59,7 +59,7 @@ Setting up and running the frontend of the Trustworthy and Ethical Assurance (TE To enable the export of SVG images from the frontend, you need to install the Mermaid CLI globally on your system. ```shell -$ npm install -g @mermaid-js/mermaid-cli +npm install -g @mermaid-js/mermaid-cli ``` ## Troubleshooting SSL Errors @@ -67,9 +67,9 @@ $ npm install -g @mermaid-js/mermaid-cli If you encounter any SSL errors during setup, try updating npm and forcing an audit fix, followed by updating react-scripts to the latest version. ```shell -$ npm update -$ npm audit fix --force -$ npm i react-scripts@latest +npm update && \ +npm audit fix --force && \ +npm i react-scripts@latest ``` ## Conclusion diff --git a/site/docs/platform-details/reset-database/azure.md b/site/docs/platform-details/reset-database/azure.md index c0df5fa2..4d0cee68 100644 --- a/site/docs/platform-details/reset-database/azure.md +++ b/site/docs/platform-details/reset-database/azure.md @@ -25,7 +25,7 @@ You will now drop the existing database and create a new one using `psql`. Open your terminal or command prompt and execute the following commands: ```bash -$ psql --host=SERVER_NAME.postgres.database.azure.com --port=5432 --username=ADMIN_USERNAME@SERVER_NAME --dbname=postgres +psql --host=SERVER_NAME.postgres.database.azure.com --port=5432 --username=ADMIN_USERNAME@SERVER_NAME --dbname=postgres ``` Once connected, run: diff --git a/site/docs/platform-details/reset-database/local.md b/site/docs/platform-details/reset-database/local.md index d4b7f284..668ff0ee 100644 --- a/site/docs/platform-details/reset-database/local.md +++ b/site/docs/platform-details/reset-database/local.md @@ -15,7 +15,7 @@ The local database for the TEA Platform is stored in an SQLite file typically lo To reset your database, you need to delete the existing SQLite file. Navigate to the **`eap_backend`** directory and remove the **`db.sqlite3`** file. ```bash -$ rm eap_backend/db.sqlite3 +rm eap_backend/db.sqlite3 ``` ## 3. Recreate the Database @@ -25,8 +25,8 @@ After deleting the old database file, you'll need to recreate the database struc Ensure your backend environment is correctly set up, then execute the following Django management commands: ```bash -$ python manage.py makemigrations -$ python manage.py migrate +python manage.py makemigrations && \ +python manage.py migrate ``` These commands will generate a **new `db.sqlite3` file** with a fresh database schema based on your Django models.