Skip to content

Commit

Permalink
better entry docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yochannah committed Jan 27, 2024
1 parent b2c46ba commit 2458026
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ This code was used in a year-long study looking at CHAOSS and other sustainabili

## Code components

There are two main components within this code.
There are four main components within this code.

1. One is the **data visualisation component**, which runs on [Jekyll](https://jekyllrb.com/), with lots of javascript-based processing, since Jekyll can generate static sites but doesn't always allow advanced data manipulation. The entry point for this section is in the `view` folder.
2. The second is the **data collection component**. This is fully written in Javascript. The entry point is in index.js in this folder.
2. The rest are **data collection components**.
1. General: This is fully written in Javascript. The entry point is in index.js in this folder. Entire suite of metrics-gathering.
2. Individual methods: JS-based. Entry: singleMethod.js. Useful to gather all of a single metric from all repos.
3. Local methods: clone git and run some metrics locally rather than infuriating the github api.

## Data collection
### To set up
Expand All @@ -32,17 +35,26 @@ To run the local scripts:
Setup:
1. Create a directory in the parent directory of this repo, and call it `localData`
2. Copy sample.tsv into localData. Tweak the repo names and dates, and/or add any lines you need to, to add more repos.
3. You may also need to give the script permissions to run, e.g.:
1. Create a directory in the parent directory of this repo, and call it `localData`.
2. Copy sample.tsv into localData.
3. Tweak the repo names and dates, and/or add any lines you need to, to add more repos.
4. You may also need to give the script permissions to run using `chmod +x`
The above setup steps, as one copy-pastable block:
```bash
#go to the folder containing the script
cd sustainable-communities-tracker/src/localMethods
#go to the folder containing this code.
cd sustainable-communities-tracker
#change the script to be executable
chmod +x localMethods.sh
chmod +x /src/localMethods/localMethods.sh
# make a folder to store all the output data
mkdir ../localData
#copy the sample data to the data folder.
cp templates/sample.tsv ../localData/sample.tsv
```
Run:
To run the local script, after the above setup is complete:
```node
npm run localMethods
Expand All @@ -52,7 +64,7 @@ npm run localMethods
Once you've run stats on a repo, there's a minimal UI to view the json and data more visually. To use it:
1. copy files generated by this script to `view/_data`
1. copy files generated by the script(s) to `view/_data`
2. set up [jekyll](https://jekyllrb.com/docs/installation/) if you haven't already (`gem install jekyll bundler`). I use [rvm](https://rvm.io/) to manage ruby versions, it makes things easier.
3. once it's all set up, cd into the view directory `cd view` and run `bundle exec jekyll serve` - presto, you'll serve the visualisations.

Expand Down

0 comments on commit 2458026

Please sign in to comment.