This remote provides a collections of tools that support development of the Pathway Commons Guide which contains a Jekyll github pages site.
Briefly, the code for the Guide is nested as a subtree inside this repo. It is built and pushed directly to the gh-pages branch where it can be served by GitHub Pages. This repo contains a multitude of tools to support development including:
- R Markdown file processing and copying
- Watch for file changes
- CSS and JavaScript file processing
- Development server
This decription was created last using Mac OS: Sonoma 14.1.1. In this case, install or update Xcode (>=v15.3) through the App Store.
- Install the chruby version manager (v0.3.9)
- Follow instructions on Jekyll site to install Ruby v2.7.8
- Install Jekyll: 4.3.3
gem install jekyllcd guide && bundle install
- Install R (v4.3)
- Install dependencies
install.packages(c("httpuv", "evaluate","jsonlite","knitr","later","magrittr","promises","R6","Rcpp","rlang","servr","xfun", "ggplot2", "gridExtra", "ggplot"))
gulpfile.js- Point
rMarkdownFileHandlerat path to your R install (e.g./Library/Frameworks/R.framework/Versions/<the install ed version>/Resources/Rscript)
- Point
- Install dependencies
nvm usenpm i
- Run a local version
npm run dev
Open your browser to http://localhost:9090
-
Clone this remote using git
$ git clone https://github.com/jvwong/guide_development $ cd guide_development -
Install dependencies
$ npm install
-
Run the app using a NPM script
$ npm run dev
This should build the necessary files inside src and copy them over into the guide parent directory. It should open a browser to http://localhost:9090/ automatically when done where you should see the site.
There's a lot going on underneath the hood to get this site going but it breaks down into four categories:
- Collection content written in R Markdown is processed to regular markdown
- JavaScript is processed
- Styling (SASS) is processed
- Markdown is built by Jekyll into pure HTML
The raw files are placed in the src folder which is read in by the Gulp script and processed accordingly. Style and scripts are sent to the guide/public directory. Markdown for collections are house directly under guide and this is where Jekyll takes over to build the site.
The gulpfile.js contains tasks for building and watching all static assets including processing R Markdown files. Browser auto-reload on file changes is enabled via browserSync.
Use the wonderful Fabric instructions inside fabfile.py to deploy to GitHub Pages.
$ fab deploy:message="This is the latest git commit message"This will automatically commit any changes in the Guide repo subtree, trigger a Jekyll build, then push the built site directly to the GitHub origin branch gh-pages. In this way the site https://pathwaycommons.github.io/guide will be directly available for viewing.