Skip to content

Commit

Permalink
docs: update schema section in readme (#48)
Browse files Browse the repository at this point in the history
* docs: update readme
  • Loading branch information
korikuzma authored Sep 4, 2024
1 parent 7ce59fb commit 0dfb0f2
Showing 1 changed file with 47 additions and 14 deletions.
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,51 @@

![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 [email protected]: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.)

0 comments on commit 0dfb0f2

Please sign in to comment.