Step-by-step documentation how the website can be built and modified
The website is created from markdown files rendered to html by Jekyll
PATH
environment variable C:\Users\[Username]\Programs\Ruby21-x64
gem install jekyll
bundle exec install
bundle exec jekyll serve
rsync -h -v -P -t -u --recursive /cygdrive/c/Users/[Username]/path/to/_site/* //hqlprsws1.hq.un.fao.org/sws_r_share/fbsmodules
The contents of the website are created and updated using R scripts that are triggered by Makefiles
Makefile
in the root directory indicates subfolders that are checked for additional Makefiles
make
The website includes a number of diagrams that facilitate understanding the project structure
.graphml
files are located at /assets/diagram/
svg
formatpng
format is requiredThe heatmap visualization is using the R package highcharter that can only be used internally for licensing reasons
/extra/faostat_bulk.csv
specifies the datasets that are downloaded from FAOSTAT/downloadData/download_faostat_bulk.R
downloads the data from the internet/data/codebook/faostat_trade_crops_livestock_norm_codebook.csv
is the codebook for renaming variables/readMergeData/read_codebook_faostat_trade_crops_livestock_norm.R
loads the codebook/readMergeData/read_faostat_trade_crops_livestock_norm_csv.R
reads the downloaded CSV data and stores in RData format/readMergeData/clean_faostat_trade_crops_livestock_norm_csv.R
applies the renaming specified in the codebook/work/summary_faostat_trade_crops_livestock_norm_csv.R
subsets the data to selected commoditiesstanDim
list of objects contained in the stan
package: data(stanDim)
/fragments/fragment_faostat_trade_crops_livestock_csv.Rmd
creates the html fragment for time series published on FAOSTATOnce the changes have been completed in the dryworkflow routine(s), the compiled html fragments files are imported to the Jekyll site. The contents of the import-dryworkflow.bat
are shown below. In this example, fragments from two dryworkflow projects are integrated: one for all FBS, the other for trade-specific outputs.
set JEKYLLFAOCYG="/cygdrive/c/Users/[User]/path/to/jekyll/site"
set DRYFAOFBSCYG="/cygdrive/c/Users/[User]/path/to/dryworkflow/root"
set SWSDATA="/cygdrive/c/SWS-Data"
rsync -h -v -P -t --recursive %DRYFAOFBSCYG%/includes/* %JEKYLLFAOCYG%/_includes/dryworkflow/
rsync -h -v -P -t --recursive %DRYFAOFBSCYG%/figures/* %JEKYLLFAOCYG%/assets/dryworkflow/
rsync -h -v -P -t --recursive %DRYFAOFBSCYG%/fragments/*.html %JEKYLLFAOCYG%/_includes/rmarkdown_fragment/
rsync -h -v -P -t --recursive %SWSDATA%/faoswsTrade/fragments/*.html %JEKYLLFAOCYG%/_includes/rmarkdown_fragment/faoswsTrade/
rsync -h -v -P -t --recursive %SWSDATA%/faoswsTrade/figures/* %JEKYLLFAOCYG%/assets/dryworkflow/faoswsTrade/