Skip to content

Commit 18a7856

Browse files
committed
Update README.md with more clarity
1 parent b3a9903 commit 18a7856

1 file changed

Lines changed: 39 additions & 17 deletions

File tree

README.md

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ This repository contains an automated CI/CD pipeline for the `main-mvp` branch t
1717
- Automatically updates deployment configurations
1818
- Deploys to Integration environment via ArgoCD
1919

20-
2120
### Branch Structure
2221

2322
```
@@ -176,14 +175,48 @@ Most of these can be installed with Homebrew on a Mac.
176175

177176
### Getting Started
178177

179-
First run `yarn`
178+
#### 1. Run the rake task
180179

181-
Then run `bin/setup` to bundle, etc
180+
```bash
181+
bundle exec rake markdown:render
182+
```
182183

183-
Then run `rails s`.
184+
⚠️ This is a required step to see content in the app. This is a one time setup step and you can run it again whenever you make changes to the markdown files located at `app/content`.
184185

185-
Or: `yarn && bundle exec rails s`
186+
#### 2. Build the dependencies
186187

188+
```bash
189+
yarn
190+
```
191+
yarn installs the node dependencies and builds the assets for the app.
192+
193+
```bash
194+
bin/setup
195+
```
196+
This will install the ruby dependencies and start the server on `http://localhost:3000` and you can view the app in your browser.
197+
198+
199+
#### 3. Run the server
200+
201+
```
202+
bundle exec rails s
203+
```
204+
Or
205+
```
206+
yarn && bundle exec rails s
207+
```
208+
209+
### Markdown rendering
210+
211+
The markdown rendering executed by the rake task `markdown:render` is a two step process:
212+
213+
1. The markdown files located at `app/content` are parsed and the content is extracted.
214+
215+
2. The content is then used to create or update the corresponding content in the `app/views/generated/collections` directory.
216+
217+
⚠️ The generated files are ignored by git and are not meant to be edited directly. Any changes to the content should be made in the markdown files and the rake task should be run again to see the changes reflected in the app.
218+
219+
This rake task is also used in the CI pipeline to ensure that any changes to the markdown files are reflected in the app when deployed.
187220

188221
## Deployment
189222

@@ -196,15 +229,4 @@ See [the developer docs on data.gov.uk deployment](https://docs.publishing.servi
196229
- Dataset: https://data.gov.uk/dataset/ce5f9a81-742d-4446-8610-2ec138e1b7e5/st-john-s-lake-intertidal-biotope-map-tamar-estuary-plymouth
197230
- Dataset with publisher login: https://data.gov.uk/dataset/cf725d50-6535-4f8b-bc98-5ab01aa866a7/grants-to-voluntary-community-and-social-enterprise-organisations-local-government-transparency-code
198231
- Support page: https://data.gov.uk/support
199-
- Publisher login page: https://data.gov.uk/publishers
200-
201-
## Markdown rendering
202-
203-
The markdown contents live in the `app/content` directory. The markdown parser rake task (`lib/tasks/markdown_to_static_html.rake`) will parse the markdown files, read the front matter, body and create or update the corresponding content in `app/views/generated/collections` directory. This allows us to manage content in markdown files while still being able to serve it dynamically.
204-
205-
### How to run the markdown parser rake task locally
206-
207-
```bash
208-
# Run the rake task
209-
bundle exec rake markdown:render
210-
```
232+
- Publisher login page: https://data.gov.uk/publishers

0 commit comments

Comments
 (0)