Skip to content

Commit 0165de9

Browse files
committed
attempted child
1 parent 02700c8 commit 0165de9

File tree

10 files changed

+106
-224
lines changed

10 files changed

+106
-224
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ vendor/
1616
.Rproj.user
1717

1818
/.quarto/
19+
20+
# Ignore R environment
21+
.Renviron

README.md

Lines changed: 8 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,174 +1,12 @@
1-
# just-the-docs-template
1+
# Introduction
22

3-
This is a *bare-minimum* template to create a [Jekyll] site that:
3+
The Centre for Longitudinal Studies (CLS) manages four cohort studies for which data is currently available to researchers:
44

5-
- uses the [Just the Docs] theme;
6-
- can be built and published on [GitHub Pages];
7-
- can be built and previewed locally, and published on other platforms.
5+
1. [The National Child Development Study (NCDS)](https://doi.org/10.1093/ije/dyi183), a birth cohort of individuals born in Britain in a single week of March 1958.
6+
2. [The 1970 British Cohort Study (BCS70)](https://doi.org/10.1093/ije/dyac148), a birth cohort of individuals born in Britain in a single week of April 1970.
7+
3. [Next Steps](https://doi.org/10.5334/ohd.16), a cohort of English schoolchildren followed from age 13/14 and born in 1989/90.
8+
4. [The Millennium Cohort Study (MCS)](https://doi.org/10.1093/ije/dyu001), a birth cohort of individuals born in Britain in 2000/02.
89

9-
More specifically, the created site:
10+
This is the GitHub repository for the [cls-data.github.io/](https://cls-data.github.io/) website which provides `R` and `Stata` code for common data management tasks in each of the studies. This include merging files across survey sweeps, reshaping data from wide to long format, and identifying correct identifier variables for observational units in each study (e.g., cohort members, families, parents, and so on);
1011

11-
- uses a gem-based approach, i.e. uses a `Gemfile` and loads the `just-the-docs` gem;
12-
- uses the [GitHub Pages / Actions workflow] to build and publish the site on GitHub Pages.
13-
14-
To get started with creating a site, simply:
15-
16-
1. click "[use this template]" to create a GitHub repository
17-
2. go to Settings > Pages > Build and deployment > Source, and select GitHub Actions
18-
19-
If you want to maintain your docs in the `docs` directory of an existing project repo, see [Hosting your docs from an existing project repo](#hosting-your-docs-from-an-existing-project-repo).
20-
21-
After completing the creation of your new site on GitHub, update it as needed:
22-
23-
## Replace the content of the template pages
24-
25-
Update the following files to your own content:
26-
27-
- `index.md` (your new home page)
28-
- `README.md` (information for those who access your site repo on GitHub)
29-
30-
## Changing the version of the theme and/or Jekyll
31-
32-
Simply edit the relevant line(s) in the `Gemfile`.
33-
34-
## Adding a plugin
35-
36-
The Just the Docs theme automatically includes the [`jekyll-seo-tag`] plugin.
37-
38-
To add an extra plugin, you need to add it in the `Gemfile` *and* in `_config.yml`. For example, to add [`jekyll-default-layout`]:
39-
40-
- Add the following to your site's `Gemfile`:
41-
42-
```ruby
43-
gem "jekyll-default-layout"
44-
```
45-
46-
- And add the following to your site's `_config.yml`:
47-
48-
```yaml
49-
plugins:
50-
- jekyll-default-layout
51-
```
52-
53-
Note: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`.
54-
55-
## Publishing your site on GitHub Pages
56-
57-
1. If your created site is `YOUR-USERNAME/YOUR-SITE-NAME`, update `_config.yml` to:
58-
59-
```yaml
60-
title: YOUR TITLE
61-
description: YOUR DESCRIPTION
62-
theme: just-the-docs
63-
64-
url: https://YOUR-USERNAME.github.io/YOUR-SITE-NAME
65-
66-
aux_links: # remove if you don't want this link to appear on your pages
67-
Template Repository: https://github.com/YOUR-USERNAME/YOUR-SITE-NAME
68-
```
69-
70-
2. Push your updated `_config.yml` to your site on GitHub.
71-
72-
3. In your newly created repo on GitHub:
73-
- go to the `Settings` tab -> `Pages` -> `Build and deployment`, then select `Source`: `GitHub Actions`.
74-
- if there were any failed Actions, go to the `Actions` tab and click on `Re-run jobs`.
75-
76-
## Building and previewing your site locally
77-
78-
Assuming [Jekyll] and [Bundler] are installed on your computer:
79-
80-
1. Change your working directory to the root directory of your site.
81-
82-
2. Run `bundle install`.
83-
84-
3. Run `bundle exec jekyll serve` to build your site and preview it at `localhost:4000`.
85-
86-
The built site is stored in the directory `_site`.
87-
88-
## Publishing your built site on a different platform
89-
90-
Just upload all the files in the directory `_site`.
91-
92-
## Customization
93-
94-
You're free to customize sites that you create with this template, however you like!
95-
96-
[Browse our documentation][Just the Docs] to learn more about how to use this theme.
97-
98-
## Hosting your docs from an existing project repo
99-
100-
You might want to maintain your docs in an existing project repo. Instead of creating a new repo using the [just-the-docs template](https://github.com/just-the-docs/just-the-docs-template), you can copy the template files into your existing repo and configure the template's Github Actions workflow to build from a `docs` directory. You can clone the template to your local machine or download the `.zip` file to access the files.
101-
102-
### Copy the template files
103-
104-
1. Create a `.github/workflows` directory at your project root if your repo doesn't already have one. Copy the `pages.yml` file into this directory. GitHub Actions searches this directory for workflow files.
105-
106-
2. Create a `docs` directory at your project root and copy all remaining template files into this directory.
107-
108-
### Modify the GitHub Actions workflow
109-
110-
The GitHub Actions workflow that builds and deploys your site to Github Pages is defined by the `pages.yml` file. You'll need to edit this file to that so that your build and deploy steps look to your `docs` directory, rather than the project root.
111-
112-
1. Set the default `working-directory` param for the build job.
113-
114-
```yaml
115-
build:
116-
runs-on: ubuntu-latest
117-
defaults:
118-
run:
119-
working-directory: docs
120-
```
121-
122-
2. Set the `working-directory` param for the Setup Ruby step.
123-
124-
```yaml
125-
- name: Setup Ruby
126-
uses: ruby/setup-ruby@v1
127-
with:
128-
ruby-version: '3.1'
129-
bundler-cache: true
130-
cache-version: 0
131-
working-directory: '${{ github.workspace }}/docs'
132-
```
133-
134-
3. Set the path param for the Upload artifact step:
135-
136-
```yaml
137-
- name: Upload artifact
138-
uses: actions/upload-pages-artifact@v1
139-
with:
140-
path: "docs/_site/"
141-
```
142-
143-
4. Modify the trigger so that only changes within the `docs` directory start the workflow. Otherwise, every change to your project (even those that don't affect the docs) would trigger a new site build and deploy.
144-
145-
```yaml
146-
on:
147-
push:
148-
branches:
149-
- "main"
150-
paths:
151-
- "docs/**"
152-
```
153-
154-
## Licensing and Attribution
155-
156-
This repository is licensed under the [MIT License]. You are generally free to reuse or extend upon this code as you see fit; just include the original copy of the license (which is preserved when you "make a template"). While it's not necessary, we'd love to hear from you if you do use this template, and how we can improve it for future use!
157-
158-
The deployment GitHub Actions workflow is heavily based on GitHub's mixed-party [starter workflows]. A copy of their MIT License is available in [actions/starter-workflows].
159-
160-
----
161-
162-
[^1]: [It can take up to 10 minutes for changes to your site to publish after you push the changes to GitHub](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll#creating-your-site).
163-
164-
[Jekyll]: https://jekyllrb.com
165-
[Just the Docs]: https://just-the-docs.github.io/just-the-docs/
166-
[GitHub Pages]: https://docs.github.com/en/pages
167-
[GitHub Pages / Actions workflow]: https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/
168-
[Bundler]: https://bundler.io
169-
[use this template]: https://github.com/just-the-docs/just-the-docs-template/generate
170-
[`jekyll-default-layout`]: https://github.com/benbalter/jekyll-default-layout
171-
[`jekyll-seo-tag`]: https://jekyll.github.io/jekyll-seo-tag
172-
[MIT License]: https://en.wikipedia.org/wiki/MIT_License
173-
[starter workflows]: https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml
174-
[actions/starter-workflows]: https://github.com/actions/starter-workflows/blob/main/LICENSE
12+
For background on these studies, please see cohort profile papers (linked above) and the [CLS website](https://cls.ucl.ac.uk/cls-studies/). Queries on the data can be sent to the [CLS Data team](mailto:[email protected]).

docs/mcs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: MCS
4+
has_children: true
45
nav_order: 5
56
---
67

docs/misc-sweep_folders.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: default
3+
title: "Creating Per-Sweep Folders"
4+
nav_order: 1
5+
parent: Miscellaneous
6+
format: docusaurus-md
7+
---
8+
9+
# Introduction {#introduction}
10+
11+
This page shows code for taking UKDS zipped files, unzipping them and
12+
placing in per-sweep folders. For this code to work, you should download
13+
UKDS Stata files for a single study.
14+
15+
To begin you will need to create a folder, XX. Alternatively, this code
16+
can be downloaded by cloning the this GitHub repository, saving, opening
17+
the `.Rpoj` file
18+
19+
Why is this not working?
20+
21+
``` r
22+
df <- read_dta("3y/mcs2_cm_interview.dta")
23+
df
24+
```
25+
26+
``` text
27+
# A tibble: 15,778 × 56
28+
MCSID BCNUM00 BCMEAS00 BCHSER00 BCHPOU00 BCHCOU00 BCBKHT00 BCHTCM00
29+
<chr> <dbl+lbl> <dbl+lb> <dbl+lbl> <dbl+lb> <dbl+lb> <dbl+lb> <dbl+lbl>
30+
1 M10001N 1 [1st Cohor… 1 [Both… 26 1 [Par… 1 [Chi… -1 [Not… 97
31+
2 M10002P 1 [1st Cohor… 1 [Both… 159 1 [Par… 1 [Chi… -1 [Not… 96
32+
3 M10007U 1 [1st Cohor… 1 [Both… 74 1 [Par… 1 [Chi… -1 [Not… 102
33+
4 M10008V 1 [1st Cohor… 0 [No m… -2 [No … -2 [No … -2 [No … -2 [No … -2 [No …
34+
5 M10008V 2 [2nd Cohor… 0 [No m… -2 [No … -2 [No … -2 [No … -2 [No … -2 [No …
35+
6 M10011Q 1 [1st Cohor… 1 [Both… 96 1 [Par… 1 [Chi… -1 [Not… 106
36+
7 M10014T 1 [1st Cohor… 1 [Both… 246 1 [Par… 1 [Chi… -1 [Not… 97
37+
8 M10015U 1 [1st Cohor… 1 [Both… 28 1 [Par… 1 [Chi… -1 [Not… 94
38+
9 M10016V 1 [1st Cohor… 1 [Both… 153 1 [Par… 1 [Chi… -1 [Not… 102
39+
10 M10017W 1 [1st Cohor… 1 [Both… 125 1 [Par… 1 [Chi… -1 [Not… 99
40+
# ℹ 15,768 more rows
41+
# ℹ 48 more variables: BCHTMM00 <dbl+lbl>, BCHCMC00 <dbl+lbl>,
42+
# BCHMMC00 <dbl+lbl>, BCHTOC00 <dbl+lbl>, BCHTAM00 <dbl+lbl>,
43+
# BCHBKD00 <dbl+lbl>, BCHBKM00 <dbl+lbl>, BCHBKY00 <dbl+lbl>,
44+
# BCHTAT00 <dbl+lbl>, BCHTTM00 <dbl+lbl>, BCHTIM00 <dbl+lbl>,
45+
# BCHTRL0A <dbl+lbl>, BCHTRL0B <dbl+lbl>, BCHTRL0C <dbl+lbl>,
46+
# BCHTRL0D <dbl+lbl>, BCHTRL0E <dbl+lbl>, BCHTRL0F <dbl+lbl>, …
47+
```
48+

docs/misc.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
title: Miscellaneous
4+
has_children: true
5+
nav_order: 6
6+
---
7+
8+
This section contains code that is applicable to all cohorts.

docs/next_steps-test.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/next_steps.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
layout: default
33
title: Next Steps
4-
has_children: true
54
nav_order: 4
65
---
76

docs/test.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

quarto/README.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Use the following command to save and render into the correct folder:
2+
3+
quarto_render("quarto/next_steps-test.qmd", output_file = "next_steps-test.md")

quarto/misc-sweep_folders.qmd

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: default
3+
title: "Creating Per-Sweep Folders"
4+
nav_order: 1
5+
parent: Miscellaneous
6+
format: docusaurus-md
7+
---
8+
9+
# Introduction
10+
11+
This page shows code for taking UKDS zipped files, unzipping them and placing in per-sweep folders. For this code to work, you should download UKDS Stata files for a single study.
12+
13+
To begin you will need to create a folder, XX. Alternatively, this code can be downloaded by cloning the this GitHub repository, saving, opening the `.Rpoj` file
14+
15+
```{r}
16+
#| echo: false
17+
#| include: false
18+
# curr_dir <- getwd()
19+
# setwd(Sys.getenv("mcs_fld"))
20+
```
21+
22+
```{r}
23+
#| include: false
24+
25+
library(tidyverse)
26+
library(haven)
27+
```
28+
29+
Why is this not working?
30+
31+
```{r}
32+
df <- read_dta("3y/mcs2_cm_interview.dta")
33+
df
34+
```
35+

0 commit comments

Comments
 (0)