Skip to content

Commit a12b45e

Browse files
docs: Reorganize documentation for clarity and maintainability (#101)
This commit reorganizes the documentation to improve clarity, reduce duplication, and make it easier to maintain. The key changes are: - The main README.md has been simplified to provide a concise project overview, installation instructions, and a link to the full documentation. - Detailed CLI documentation has been moved from the README.md to a dedicated `docs/user_guide` section. - The `mkdocs.yml` file has been updated to reflect the new, nested documentation structure. - A new `docs/about.md` file has been created to provide information about the documentation's structure. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent a9e735c commit a12b45e

File tree

10 files changed

+44
-151
lines changed

10 files changed

+44
-151
lines changed

README.md

Lines changed: 6 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# Reproschema Python library and Command Line Interface (CLI)
44

5+
The `reproschema-py` library provides a Python interface and a command-line tool to work with ReproSchema, a YAML-based framework for creating and managing reproducible research protocols.
6+
7+
For more information, see the [full documentation](https://ReproNim.github.io/reproschema-py/).
8+
59
## Installation
610

711
reproschema requires Python 3.10+.
@@ -10,6 +14,8 @@ reproschema requires Python 3.10+.
1014
pip install reproschema
1115
```
1216

17+
## Developer Guide
18+
1319
### Developer installation
1420

1521
Fork this repo to your own GitHub account, then clone and install your forked repo in the developer mode:
@@ -32,136 +38,3 @@ This repo uses pre-commit to check styling.
3238
When pre-commit is used, you may have to run git commit twice,
3339
since pre-commit may make additional changes to your code for styling and will
3440
not commit these changes by default.
35-
36-
37-
## CLI usage
38-
39-
This package installs `reproschema` Command Line Interface (CLI).
40-
41-
```
42-
$ reproschema --help
43-
44-
$ A client to support interactions with ReproSchema
45-
46-
To see help for a specific command, run
47-
48-
reproschema COMMAND --help e.g. reproschema validate --help
49-
50-
Options:
51-
--version
52-
-l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
53-
Log level name [default: INFO]
54-
--help Show this message and exit.
55-
56-
Commands:
57-
convert Converts a path to a different format, jsonld,...
58-
create
59-
migrate Updates to a new reproschema version
60-
redcap2reproschema Converts REDCap CSV files to Reproschema format.
61-
reproschema2redcap Converts reproschema protocol to REDCap CSV format.
62-
serve
63-
validate Validates if the path has a valid reproschema format
64-
reproschema2fhir Generates FHIR questionnaire resources from reproschema activities
65-
output2redcap Generates redcap csv given the audio and survey data from reproschema ui
66-
```
67-
68-
## `reproschema2redcap`
69-
70-
### CLI Usage
71-
72-
You can use this feature directly from the command line. To convert ReproSchema protocol to REDCap CSV format, use the following command
73-
74-
```
75-
reproschema reproschema2redcap <input_dir_path> <output_csv_filename>
76-
```
77-
78-
- `<input_dir_path>`: The path to the root folder of a protocol. For example, to convert the reproschema-demo-protocol provided by ReproNim, you can use the following commands:
79-
```bash
80-
git clone https://github.com/ReproNim/reproschema-demo-protocol.git
81-
cd reproschema-demo-protocol
82-
pwd
83-
```
84-
In this case, the output from `pwd` (which shows your current directory path) should be your `<input_dir_path>`.
85-
- `<output_csv_filename>`: The name of the output CSV file where the converted data will be saved.
86-
87-
### Python Function Usage
88-
89-
You can also use the `reproschema2redcap` function from the `reproschema-py` package in your Python code.
90-
91-
```python
92-
from reproschema import reproschema2redcap
93-
94-
input_dir_path = "path-to/reproschema-demo-protocol"
95-
output_csv_filename = "output.csv"
96-
97-
reproschema2redcap(input_dir_path, output_csv_filename)
98-
```
99-
100-
## `redcap2reproschema`
101-
The `redcap2reproschema` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format.
102-
103-
### Prerequisites
104-
Before the conversion, ensure you have the following:
105-
106-
**YAML Configuration File**:
107-
- Download [templates/redcap2rs.yaml](templates/redcap2rs.yaml) and fill it out with your protocol details.
108-
109-
### YAML File Configuration
110-
In the `templates/redcap2rs.yaml` file, provide the following information:
111-
112-
- **protocol_name**: A unique identifier for your protocol. Use underscores for spaces and avoid special characters.
113-
- **protocol_display_name**: Name that will appear in the application.
114-
- **protocol_description**: A brief description of your protocol.
115-
- **redcap_version**: Version of your redcap file (you can customize it).
116-
117-
Example:
118-
```yaml
119-
protocol_name: "My_Protocol"
120-
protocol_display_name: "Assessment Protocol"
121-
protocol_description: "This protocol is for assessing cognitive skills."
122-
redcap_version: "X.XX.X"
123-
```
124-
### CLI Usage
125-
126-
The `redcap2reproschema` function has been integrated into a CLI tool, use the following command:
127-
```bash
128-
reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml
129-
```
130-
131-
Optionally you can provide a path to the output directory (default is the current directory) by adding the option: `--output-path PATH`
132-
### Python Function Usage
133-
134-
You can also use the `redcap2reproschema` function from the `reproschema-py` package in your Python code.
135-
136-
```python
137-
from reproschema import redcap2reproschema
138-
139-
csv_path = "path-to/your_redcap_data_dic.csv"
140-
yaml_path = "path-to/your_redcap2rs.yaml"
141-
output_path = "path-to/directory_you_want_to_save_output"
142-
143-
redcap2reproschema(csv_file, yaml_file, output_path)
144-
```
145-
146-
## `output2redcap`
147-
The `output2redcap` function is designed to process the output from reproschema-ui into a REDCap CSV file as seen [here](reproschema/example/redcap).
148-
149-
150-
### CLI Usage
151-
152-
The `output2redcap` function has been integrated into a CLI tool, use the following command:
153-
```bash
154-
reproschema output2redcap ./path/to/your_reproschema-ui_files ./path/to/directory_you_want_to_save_output
155-
```
156-
157-
## `reproschema2fhir`
158-
The `reproschema2fhir` function is designed to convert reproschema activities and items into a FHIR Questionnaire resource as seen [here](reproschema/example/fhir).
159-
160-
### CLI Usage
161-
162-
The `reproschema2fhir` function has been integrated into a CLI tool, use the following command:
163-
```bash
164-
reproschema reproschema2fhir ./path/to/your_reproschema_activities ./path/to/directory_you_want_to_save_output
165-
```
166-
### Notes
167-
1. The script requires an active internet connection to access the GitHub repository.

docs/about.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# About this documentation
2+
3+
This section provides information about the structure of this documentation site.
4+
5+
## Project layout
6+
7+
The documentation is organized as follows:
8+
9+
mkdocs.yml # The MkDocs configuration file.
10+
docs/
11+
index.md # The documentation homepage.
12+
installation.md # Installation instructions.
13+
about.md # Information about this documentation.
14+
user_guide/
15+
index.md # Introduction to the user guide.
16+
cli_usage.md # General CLI usage.
17+
reproschema2redcap.md # reproschema to REDCap conversion.
18+
redcap2reproschema.md # REDCap to reproschema conversion.
19+
output2redcap.md # output to REDCap conversion.
20+
reproschema2fhir.md # reproschema to FHIR conversion.

docs/index.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
# Welcome to Reproschema-py
22

3-
For full documentation visit [Reproschema-py](https://github.com/ReproNim/reproschema-py).
4-
reproschema requires Python 3.10+
5-
6-
## Project layout
7-
mkdocs.yml # The configuration file.
8-
docs/
9-
index.md # The documentation homepage.
10-
installation.md #A tutorial for installation.
11-
cli_usage.md #Notes on CLI usage
12-
reproschema2redcap.md #How to convert from reproschema to redcap
13-
redcap2reproschema.md #How to convert from redcap to reproschema
14-
output2redcap.md #How to convert the output into redcap
15-
reproschema2fhir.md #How to convert the reproschema into an FHIR Questionnaire Resource
3+
The `reproschema-py` library provides a Python interface and a command-line tool to work with ReproSchema, a YAML-based framework for creating and managing reproducible research protocols.
4+
5+
This documentation will guide you through the installation process, explain how to use the command-line interface, and provide information for developers who want to contribute to the project.
6+
7+
## Getting Started
8+
9+
If you are new to `reproschema-py`, we recommend starting with the **[Installation](installation.md)** guide, followed by the **[User Guide](user_guide/index.md)** to learn about the available commands.
File renamed without changes.

docs/user_guide/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# User Guide
2+
3+
This section provides a detailed guide to using the `reproschema` command-line interface (CLI).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

mkdocs.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ site_name: reproschema-py
22
nav:
33
- Home: index.md
44
- Installation: installation.md
5-
- CLI Usage: cli_usage.md
6-
- Converting from reproschema to redcap: reproschema2redcap.md
7-
- Converting from redcap to reproschema: redcap2reproschema.md
8-
- Converting the output into redcap: output2redcap.md
9-
- Converting the reproschema into an FHIR Questionnaire Resource: reproschema2fhir.md
5+
- User Guide:
6+
- Introduction: user_guide/index.md
7+
- CLI Usage: user_guide/cli_usage.md
8+
- Reproschema to REDCap: user_guide/reproschema2redcap.md
9+
- REDCap to Reproschema: user_guide/redcap2reproschema.md
10+
- Output to REDCap: user_guide/output2redcap.md
11+
- Reproschema to FHIR: user_guide/reproschema2fhir.md
12+
- About: about.md
1013

1114
theme: readthedocs

0 commit comments

Comments
 (0)