Skip to content

Commit

Permalink
Clean up book README (#225)
Browse files Browse the repository at this point in the history
Closes #224
  • Loading branch information
edelarua authored Mar 1, 2024
1 parent aacb5b8 commit 131cf88
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 28 deletions.
64 changes: 42 additions & 22 deletions book/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,73 @@
# TLG Catalog <a href='https://insightsengineering.github.io/tlg-catalog/'><img src="assets/img/logo.png" align="right" height="139" style="max-width: 100%; max-height: 139px;"/></a>

The catalog for (T)ables, (L)istings, and (G)raphs for clinical trials generated using NEST packages.
The TLG catalog is a catalog of **T**ables, **L**istings, and **G**raphs for clinical trials generated using NEST packages.

This repository provides a comprehensive collection of clinical trials outputs generated using the R language.
The target audience is the clinical trials community, including statisticians, data scientists, and other professionals interested in applying R to clinical trials data.

## Usage

Each output is generated in a separate article and this usually consists of:
Each TLG is represented on a separate article page, typically including the following sections:

* Data setup using synthetic data.
* The output itself (many variants if applicable).
* The output embedded in an interactive application.
* Reproducibility information.
- Setup and pre-processing of synthetic data.
- Steps to produce the TLG.
- The output TLG generated by the given code (including any available variants).
- An interactive application that can alternatively be used to produce and interact with the TLG.
- Reproducibility information.

See the full list of available TLGs in [Index page](tlg-index.qmd).
See the full list of available TLGs on the [Index page](tlg-index.qmd).

The source code of each article can be inspected by clicking on the "Source Code" button. Use copy-paste to get the code and run it in your environment.
### Interacting with Catalog R Code

![artice code copy](assets/img/article-code-copy.gif)
<div class="columns">
<div class="column" style="vertical-align: middle; width: 30%; padding-right: 5%">
The full source code of each article can be viewed by clicking on the "Source Code" button at the top of the page and copied using the "Copy to Clipboard" button.
</div>

Source code of an individual output can also be copied.
<div class="column" style="vertical-align: middle; width: 65%">
<img src="assets/img/article-code-copy.gif" style="max-width: 100%; max-height: 100%"/>
</div>

![chunk code copy](assets/img/chunk-code-copy.gif)
<div class="column" style="vertical-align: middle; width: 30%; padding-right: 5%">
Individual code chunks from within the article can also be viewed and copied.
</div>

<div class="column" style="vertical-align: middle; width: 65%">
<a><img src="assets/img/chunk-code-copy.gif" style="max-width: 100%; max-height: 100%"/></a>
</div>

<div class="column" style="vertical-align: middle; width: 30%; padding-right: 5%">
The Reproducibility tab contains session information and allows one to install the packages required to properly run the code.
</div>

![download lockfile](assets/img/article-lock-download.gif)
<div class="column" style="vertical-align: middle; width: 65%">
<a><img src="assets/img/article-lock-download.gif" style="max-width: 100%; max-height: 100%"/></a>
</div>
</div>

## License

This catalog as well as code examples are licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE) file for details.

## Contributing

We welcome contributions to this catalog. Please refer to the [Contributing](CONTRIBUTING.md) guide for more information.
Use `giscus` to share your feedback, ideas, ask questions, or report issues.
We welcome contributions big and small to the TLG catalog.
Please refer to the [Contributing](CONTRIBUTING.md) guide for more information on how you can contribute.
Use the `giscus` panels at the bottom of each page to share your feedback & ideas, ask questions, and report issues.

## Development

This website is built using [Quarto](https://quarto.org/) and hosted on [Github Pages](https://pages.github.com/). This website is rebuilt and republished every time a change is pushed to the repository as well as on a daily basis as a part of the CI/CD process.
This website is built using [Quarto](https://quarto.org/) and hosted on [GitHub Pages](https://pages.github.com/).
This website is rebuilt and republished daily as well as every time a change is pushed to the repository as part of the CI/CD process.

The catalog is rendered using "Stable" and "Development" profiles.
The main difference between them is the package versions used when generating the outputs.
The "Stable" profile uses the most recently released versions of all packages, whereas the "Development" profile uses the latest development versions of the NEST packages.
This means that the same R code (e.g. `foo::bar()`) would be run using both the latest released and development package versions (e.g. `[email protected]` and `[email protected]` respectively).
If your item is affected by API changes between released and development versions, please consider [conditional content](https://quarto.org/docs/authoring/conditional.html) (checking `QUARTO_PROFILE` environment variable) and/or `if` statements on respective package version to enable the article to work in both profiles.
The main difference between these two profiles is the package versions used to generate the outputs.
The "Stable" profile uses the most recently released versions of all packages, whereas the "Development" profile uses the latest development versions of all NEST packages.
This means that the same R code (e.g. `foo::bar()`) would be run using both the latest released and development package versions (e.g. `[email protected]` on the "Stable" profile and `[email protected]` on the "Development" profile).
If your article is affected by API changes between released and development versions, please consider [conditional content](https://quarto.org/docs/authoring/conditional.html) (checking `QUARTO_PROFILE` environment variable) and/or `if` statements on respective package versions to enable the article to work in both profiles.

As a part of the CI/CD process, each article's code is checked for quality, coherence and readability using tools such as `lintr`, `styler`, and `spelling`.
Additionally, regression testing is performed using `testthat2` snapshot testing (see the [package repository component](https://github.com/insightsengineering/tlg-catalog/tree/main/package) for more details).
As a part of the CI/CD process, each article's code is checked for quality, coherence, and readability using tools such as `lintr`, `styler`, and `spelling`.
Additionally, regression testing is performed using `testthat` snapshot testing (see the [package component of the repository](https://github.com/insightsengineering/tlg-catalog/tree/main/package) for more details).

If you are adding a new table, listing, or graph in the form a new `.qmd` file, then you will also need to update the index in the [index.qmd](index.qmd) file with the new file name. To do so, run the R code in the [generate-index.R](generate-index.R) file after creating your template.
If you are adding a new table, listing, or graph in the form a new `.qmd` file, then you will also need to update the index in the [tlg-index.qmd](tlg-index.qmd) file with the new file name.
To do so, run the R code in the [generate-index.R](generate-index.R) file after creating your template.
Binary file modified book/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions book/generate-index.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Run file contents within TLG-C project to update the index
# Run file contents within TLG-C project, with working directory set
# to tlg-catalog/book, to update the index

print_ref_templates <- function(fpath) {
title <- sub("title: ", "", readLines(fpath)[2], )
subtitle <- sub("subtitle: ", "", readLines(fpath)[3], )
subtitle <- gsub("^'|'$", "", sub("subtitle: ", "", readLines(fpath)[3], ))
temp_name <- paste(title, subtitle, sep = " -- ")
cat(
paste0(strrep("&nbsp;", 8), "[", temp_name, "]", "(", fpath, ")\n\n"),
Expand Down
7 changes: 5 additions & 2 deletions book/index.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: "TLG Catalog"
subtitle: "Tables, Listings, and Graphs Catalog"
title-block-style: none
format:
html:
code-tools:
source: false
---

{{< include README.md >}}
4 changes: 2 additions & 2 deletions book/tlg-index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ toc-depth: 4

#### ECG

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EGL01 -- 'Listing of ECG Data: Safety-Evaluable Patients'](./listings/ECG/egl01.qmd)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[EGL01 -- Listing of ECG Data: Safety-Evaluable Patients](./listings/ECG/egl01.qmd)


#### Exposure
Expand Down Expand Up @@ -322,7 +322,7 @@ toc-depth: 4

#### Vital Signs

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[VSL01 -- 'Listing of Vital Signs: Safety-Evaluable Patients'](./listings/vital-signs/vsl01.qmd)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[VSL01 -- Listing of Vital Signs: Safety-Evaluable Patients](./listings/vital-signs/vsl01.qmd)


------------------------------------------------------------------------
Expand Down

0 comments on commit 131cf88

Please sign in to comment.