Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update schema section in readme (#48) #51

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,51 @@ Categorical variant classes intended to be covered by this specification can be

![image](docs/source/images/cat-vrs-transparent-bg.png)

## Using the schema

# How to set up a venv and update the schemata from the source.yaml files: (Guide for VSCode)

1. Use the following code to install the venv in the root directory that contains the requirements.txt file. Note that requirements.txt may be hidden and not show up with `ls`, but it should show up if you ise `ls -a` to list hidden files.
> `python3 -m venv venv`
>
> `source venv/bin/activate`
>
> `pip install -U setuptools pip`
>
> `pip install -r .requirements.txt`
2. Then run the following code to pull in all of the submodule content:
> `git submodule update --init --recursive`
3. The venv should be all set up to update the `.rst` files as they are updated. `.rst` files inside the `docs/source` directory are static and can be edited directly. (you will need to install aan `.rst`-compatible extension to view the outputs inside the editor, however. I currently have both reStructuredText and RST Preview installed.) The `.rst` and `.json` files for the schemata are generated by making edits to the `-source.yaml` files, and thenrunning the `Makefile`. To run the `Makefile`, `cd` into the `cat-vrs/schema` directory which contains it and run the following line of code to update everything:
> `make all`
The schema is available in the [schema/](./schema/) directory, in both yaml and json versions.
It conforms to JSON Schema Draft 2020-12. For a list of
libraries that support JSON schema, see
[JSONSchema>Tools](https://json-schema.org/tools).

## Installing for development

Fork the repo at <https://github.com/ga4gh/cat-vrs>.

git clone --recurse-submodules git@github.com:YOUR_GITHUB_ID/cat-vrs.git
cd cat-vrs
make devready
source venv/3.12/bin/activate

If you already cloned the repo, but forgot to include `--recurse-submodules` you can run:

git submodule update --init --recursive

## Contributing to the schema

Cat-VRS uses [cat-vrs-source.yaml](./schema/cat-vrs/cat-vrs-source.yaml) as the source
document for JSON Schema.

To create the corresponding def and json files after making changes to the source
document, from the root directory:

cd schema
make all

## Contributing to the docs

The Cat-VRS specification documentation is written in reStructuredText and located in
[docs/source](docs/source/). Commits to this repo are built automatically at
<https://vrsatile.readthedocs.io/en/latest/catvars/index.html#>.

To build documentation locally, you must install [entr](https://eradman.com/entrproject/):

brew install entr

Then from the root directory:

cd docs
make clean watch &

Then, open [docs/build/html/index.html](./docs/build/html/index.html). The above make
command should build docs when source changes. (Some types of changes require recleaning and building.)
Loading