sennetconsortium / documentation

SenNet Documentation
1 stars 0 forks source link

SenNet Docs

Usage

Contents

Working with submodule

This repository relies on the data_submission_guide as a submodule to function. The file .gitmodules contains the configuration for the URL and specific branch of the submodule that is to be used. Once you already have cloned this repository and switched to the target branch, to load the latest data_submission_guide submodule:

git submodule update --init --remote

Development

Only need to set this up if there is a need to add new functionality, features, styles to the templates. To view /docs as they'd appear on GitHub pages, see mimicking GitHub pages.

Install

cd documentation
npm i .

Run Dev Server

npm start

Open http://localhost:3005 with your browser to see the result.
Note: This is only for viewing the styles, layouts and JS functionality generated through /src changes, ideally should set up the docker server for mimicking of GitHub pages to test fully.
See Below: Mimicking GitHub Pages Locally

CSS

npm run css # builds CSS files to `/docs/css/main.css` and copies to `./docs/_site` GitHub build folder

JS

npm run js # builds Js files to `/docs/js/main.js` and copies to `./docs/_site` GitHub build folder

html

npm run html # builds the PUG layout and pages to `/docs[/_layouts]`

Build All

npm run build # builds all of the above

Serve docs folder locally.
Should have serve module installed after running npm i .
Note: This is only for viewing the styles, layouts and JS functionality generated through /src changes, ideally should set up the docker server for mimicking of GitHub pages to test fully.
See Below: Mimicking GitHub Pages Locally

serve ./docs 

Coding Conventions

Mimicking GitHub Pages Locally

The docker image built out of the /docker directory provides a local server to mimic the GitHub Pages server. This image has been built and pushed to DockerHub. To run it you must mount a local copy of the /documentation/ repo as a volume in the container as the volume /software-docs/ and expose port 4000 locally. The runlocal.sh script is provided to help with this. You must have docker installed and running.

To test this repository locally using the docker image execute the runlocal.sh script included in this directory like:

sh ./runlocal.sh /full/absolute/path/to/the/downloaded/repository When the container is running correctly you'll be able to navigate to https://localhost:4000/ in a local browser.