Skip to content

Commit

Permalink
Readme (#212)
Browse files Browse the repository at this point in the history
Let me summon

@telepath37 @khatril @lcd2yyz for awareness - this aims to lower the
entry bar to sell this more efficiently to our end user base and beyond.
Feel free to give feedback. You might find it easier to see from GH
preview (as opposed to PR changes):
https://github.com/insightsengineering/tlg-catalog/tree/readme

@cicdguy asking for overall review
@vedhav (only if you have bandwidth) - asking for review of
package/README.md file. You were somewhat included in the prior
discussion and I ask you to check if the instructions are correct and
clear.
And maybe @chlebowa (only if you have bandwidth) - for review of
package/README.md in particular. I assume you were not yet included in
the prior discussion and I want you to check whether the instructions
are clear from the perspective of the new developer.
For both of you, the expectation is a ~_basic_~ actually one level more
than _basic_ awareness of what's happening - not necessarily _complete_
understanding. This is not meant to be complete manual - just a README
file.

Closes #111

---------

Signed-off-by: Aleksander Chlebowski <[email protected]>
Signed-off-by: Pawel Rucki <[email protected]>
Co-authored-by: Aleksander Chlebowski <[email protected]>
  • Loading branch information
pawelru and chlebowa authored Feb 23, 2024
1 parent e3cb74f commit a772b12
Show file tree
Hide file tree
Showing 14 changed files with 396 additions and 49 deletions.
133 changes: 133 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
136 changes: 136 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Contribution Guidelines

🙏 Thank you for taking the time to contribute!

Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.

## Table of contents

[👶 Getting started](#getting-started)

[📔 Code of Conduct](#code-of-conduct)

[🗃 License](#license)

[📜 Issues](#issues)

[🚩 Pull requests](#pull-requests)

[💻 Coding guidelines](#coding-guidelines)

[🏆 Recognition model](#recognition-model)

[❓ Questions](#questions)

## Getting started

Please familiarize yourself with the specific [project structure][proj_readme] and the book content. Please make sure you read the "Development" section in the [README][book_readme] file.

## Code of Conduct

A [Code of Conduct](CODE_OF_CONDUCT.md) governs this project. Participants and contributors are expected to follow the rules outlined therein.

## License

All your contributions will be covered by this project's [license][license].

## Issues

We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.

For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.

## Pull requests

### GitHub Flow

This repository uses the [GitHub Flow](https://docs.github.com/en/get-started/quickstart/github-flow) model for collaboration. To submit a pull request:

1. Create a branch

Please see the [branch naming convention](#branch-naming-convention) below. If you don't have write access to this repository, please fork it.

2. Make changes

Make sure your code
* passes all checks imposed by GitHub Actions
* is well documented
* is well tested with unit tests sufficiently covering the changes introduced

3. Create a pull request (PR)

In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.

4. Address review comments, if any

5. Post approval

Merge your PR if you have write access. Otherwise, the reviewer will merge the PR on your behalf.

6. Pat yourself on the back

Congratulations! 🎉
You are now an official contributor to this project! We are grateful for your contribution.

### Branch naming convention

Suppose your changes are related to a current issue in the current project; please name your branch as follows: `<issue_id>_<short_description>`. Please use underscore (`_`) as a delimiter for word separation. For example, `420_fix_ui_bug` would be a suitable branch name if your change is resolving and UI-related bug reported in issue number `420` in the current project.

If your change affects multiple repositories, please name your branches as follows: `<issue_id>_<issue_repo>_<short description>`. For example, `69_awesomeproject_fix_spelling_error` would reference issue `69` reported in project `awesomeproject` and aims to resolve one or more spelling errors in multiple (likely related) repositories.

### `monorepo` and `staged.dependencies`

Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using [`staged.dependencies`](https://github.com/openpharma/staged.dependencies) functionality to simulate a `monorepo` behavior. The dependency configuration is already specified in this project's `staged_dependencies.yaml` file. You need to name the feature branches appropriately. _This is the only exception from the branch naming convention described above_.

Please refer to the [staged.dependencies package documentation](https://openpharma.github.io/staged.dependencies/) for more details.

## Coding guidelines

This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.

### Style guide

This repository follows the standard [`tidyverse` style guide](https://style.tidyverse.org/) and uses [`lintr`](https://github.com/r-lib/lintr) for lint checks. Customized lint configurations are available in this repository's `.lintr` file.

### Dependency management

Lightweight is the right weight. This repository follows [tinyverse](https://www.tinyverse.org/) recommedations of limiting dependencies to minimum.

### Dependency version management

If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the `DESCRIPTION` file. In particular: if the development version requires (imports) the development version of another package - it is required to put `abc (>= 1.2.3.9000)`.

### Recommended development environment & tools

#### R & package versions

We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the `R CMD check` GitHub Action execution log - there is a step that prints out the R `sessionInfo()`.

If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.

#### `pre-commit`

We highly recommend that you use the [`pre-commit`](https://pre-commit.com/) tool combined with [`R hooks for pre-commit`](https://github.com/lorenzwalthert/precommit) to execute some of the checks before committing and pushing your changes.

Pre-commit hooks are already available in this repository's `.pre-commit-config.yaml` file.

## Recognition model

As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the [repository insights][insights], to recognize a _significant_ contribution and hence add the contributor to the package authors list, the following rules are enforced:

* Minimum 5% of lines of code authored* (determined by `git blame` query) OR
* Being at the top 5 contributors in terms of number of commits OR lines added OR lines removed*

*Excluding auto-generated code, including but not limited to `roxygen` comments or `renv.lock` files.

The package maintainer also reserves the right to adjust the criteria to recognize contributions.

## Questions

If you have further questions regarding the contribution guidelines, please contact the package/repository maintainer.

<!-- urls -->
[proj_readme]: https://github.com/insightsengineering/tlg-catalog/tree/main#readme
[book_readme]: https://github.com/insightsengineering/tlg-catalog/tree/main/book#readme
[license]: https://raw.githubusercontent.com/insightsengineering/tlg-catalog/main/LICENSE
[insights]: https://github.com/insightsengineering/tlg-catalog/pulse
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TLG Catalog <a href='https://insightsengineering.github.io/tlg-catalog/'><img src="book/assets/img/logo.png" align="right" height="139" style="max-width: 100%; max-height: 139px;"/></a>

This repository consists of two main components:

* [Book](https://github.com/insightsengineering/tlg-catalog/tree/main/book): A collection of Tables, Listings, and Graphs. Please navigate there to access source files.
* [Package](https://github.com/insightsengineering/tlg-catalog/tree/main/package): Used internally for testing purposes. Most likely you don't have to worry about this.
1 change: 1 addition & 0 deletions book/CODE_OF_CONDUCT.md
1 change: 1 addition & 0 deletions book/CONTRIBUTING.md
75 changes: 40 additions & 35 deletions book/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
# TLG Catalog
# 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>

Catalog for tables, listings, and graphs generated from NEST R packages.
The catalog for (T)ables, (L)istings, and (G)raphs for clinical trials generated using NEST packages.

## Architecture
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.

This repository follows a very straightforward architecture.
## Usage

``` mermaid
sequenceDiagram
autonumber
Author->>github.com: Creates content + pushes updates
github.com->>Github Pages: Builds and publishes
Analyst->>Github Pages: Refers to catalog
```
Each output is generated in a separate article and this usually consists of:

## Technology
* Data setup using synthetic data.
* The output itself (many variants if applicable).
* The output embedded in an interactive application.
* Reproducibility information.

- Dependency management: [`staged.dependencies`](https://openpharma.github.io/staged.dependencies/) for installing dependencies
- Building and rendering: [`quarto`](https://quarto.org/)
- Publishing: [`Github Pages`](https://pages.github.com/) hosted at <https://insightsengineering.github.io/tlg-catalog>
See the full list of available TLGs in [Index page](tlg-index.qmd).

## Development
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.

![artice code copy](assets/img/article-code-copy.gif)

Source code of an individual output can also be copied.

![chunk code copy](assets/img/chunk-code-copy.gif)

The Reproducibility tab contains session information and allows one to install the packages required to properly run the code.

This repository is based on the [quarto websites](https://quarto.org/docs/websites/) framework.
![download lockfile](assets/img/article-lock-download.gif)

As a pre-requisite, you need to [install quarto](https://quarto.org/docs/get-started/) and also [install and configure staged.dependencies](https://github.com/openpharma/staged.dependencies#usage).
## 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.

## Development

You can install dependencies simply by running the following in an R session:
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.

``` r
# Assuming:
# 1. Your current working directory is the same as the project directory
# 2. You have set up your GITHUB_PAT environment variable
options(
staged.dependencies.token_mapping = c(
"https://github.com" = "GITHUB_PAT"
)
)
library(staged.dependencies)
x <- dependency_table(project = ".", verbose = 1)
install_deps(x, verbose = 1, install_project = FALSE)
```
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.

You'll see that files under [tables](tables), [listings](listings), and [graphs](graphs) are in a `.qmd` file format, which translates to a **q**uarto **m**ark**d**own format.
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).

If you are adding a new table, listing, or graph in the form a 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 [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.
Loading

0 comments on commit a772b12

Please sign in to comment.