From 318a5082ea872131c74520a8d71c1b33bf28daa2 Mon Sep 17 00:00:00 2001 From: Tessa Pierce Ward Date: Wed, 19 May 2021 08:59:23 -0700 Subject: [PATCH] Rootstock 2021 05 19 (#2) * Webpage: refactor plugins & add scite plugin merges https://github.com/manubot/rootstock/pull/409 * moves repeated and shared/generic functions to separate "core" plugin * reorganizes html.yaml config into first and third party plugins * removes functionality to set plugin options from url * reformats plugins with Prettier (eg 4 space tabs to 2 space) * removes anonymizer wrapper. Just make + + diff --git a/build/plugins/analytics.html b/build/plugins/analytics.html index 0e641a1..cbab532 100644 --- a/build/plugins/analytics.html +++ b/build/plugins/analytics.html @@ -1,3 +1,5 @@ - - - + diff --git a/build/plugins/anchors.html b/build/plugins/anchors.html index 4f2e6ba..68f1225 100644 --- a/build/plugins/anchors.html +++ b/build/plugins/anchors.html @@ -1,144 +1,127 @@ - - - + + diff --git a/build/plugins/attributes.html b/build/plugins/attributes.html index b968198..7009782 100644 --- a/build/plugins/attributes.html +++ b/build/plugins/attributes.html @@ -1,130 +1,84 @@ - - - diff --git a/build/plugins/core.html b/build/plugins/core.html new file mode 100644 index 0000000..4c680a4 --- /dev/null +++ b/build/plugins/core.html @@ -0,0 +1,129 @@ + + + diff --git a/build/plugins/d3.html b/build/plugins/d3.html index 48c16d8..d04226e 100644 --- a/build/plugins/d3.html +++ b/build/plugins/d3.html @@ -1,16 +1,12 @@ - + + src="https://cdnjs.cloudflare.com/ajax/libs/d3/6.2.0/d3.min.js" + integrity="sha512-C2RveGuPIWqkaLAluvoxyiaN1XYNe5ss11urhZWZYBUA9Ydgj+hfGKPcxCzTwut1/fmjEZR7Ac35f2aycT8Ogw==" + crossorigin="anonymous" +> diff --git a/build/plugins/hypothesis.html b/build/plugins/hypothesis.html index 7bd1691..1986d36 100644 --- a/build/plugins/hypothesis.html +++ b/build/plugins/hypothesis.html @@ -1,104 +1,166 @@ - + + + diff --git a/build/plugins/inline-svg.html b/build/plugins/inline-svg.html index be40242..619a3a1 100644 --- a/build/plugins/inline-svg.html +++ b/build/plugins/inline-svg.html @@ -1,62 +1,53 @@ - - - diff --git a/build/plugins/jump-to-first.html b/build/plugins/jump-to-first.html index e8a8088..d205093 100644 --- a/build/plugins/jump-to-first.html +++ b/build/plugins/jump-to-first.html @@ -1,272 +1,102 @@ - - - + + diff --git a/build/plugins/lightbox.html b/build/plugins/lightbox.html index 6b9f2ae..1fbdf77 100644 --- a/build/plugins/lightbox.html +++ b/build/plugins/lightbox.html @@ -1,620 +1,660 @@ - - - + + diff --git a/build/plugins/link-highlight.html b/build/plugins/link-highlight.html index 4462f50..04263a8 100644 --- a/build/plugins/link-highlight.html +++ b/build/plugins/link-highlight.html @@ -1,184 +1,157 @@ - - - + + diff --git a/build/plugins/math.html b/build/plugins/math.html deleted file mode 100644 index f47b24d..0000000 --- a/build/plugins/math.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/build/plugins/mathjax.html b/build/plugins/mathjax.html new file mode 100644 index 0000000..14ba331 --- /dev/null +++ b/build/plugins/mathjax.html @@ -0,0 +1,53 @@ + + + + + + + diff --git a/build/plugins/scite.html b/build/plugins/scite.html new file mode 100644 index 0000000..4d62049 --- /dev/null +++ b/build/plugins/scite.html @@ -0,0 +1,62 @@ + + + + + + + diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html index e415945..ea24c97 100644 --- a/build/plugins/table-of-contents.html +++ b/build/plugins/table-of-contents.html @@ -1,315 +1,404 @@ - + + diff --git a/build/plugins/tooltips.html b/build/plugins/tooltips.html index f9cbc60..b6fc505 100644 --- a/build/plugins/tooltips.html +++ b/build/plugins/tooltips.html @@ -1,614 +1,507 @@ - - - + + diff --git a/build/themes/default.html b/build/themes/default.html index 4022f31..2396cc4 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -1,60 +1,525 @@ diff --git a/content/06.methods.md b/content/06.methods.md index a383de5..7ecbc50 100644 --- a/content/06.methods.md +++ b/content/06.methods.md @@ -52,7 +52,7 @@ We have already shown the utility of Containment for metagenome classification [ Blanca et al, 2021 [@doi:10.1101/2021.01.15.426881] presented a method to estimate the mutation rate between MinHash sketches while accounting for the non-independence of mutated k-mers. Using [@https://github.com/KoslickiLab/mutation-rate-ci-calculator], we estimate Sequence Identity from Scaled MinHash Containment. -Estimating sequence similarity from Scaled MinHash requires a good estimate of the number of unique k-mers in the sketched sequencing dataset [@https:https://github.com/dib-lab/sourmash/pull/1270]... +Estimating sequence similarity from Scaled MinHash requires a good estimate of the number of unique k-mers in the sketched sequencing dataset [@https://github.com/dib-lab/sourmash/pull/1270]... diff --git a/setup.bash b/setup.bash new file mode 100755 index 0000000..3d45a08 --- /dev/null +++ b/setup.bash @@ -0,0 +1,230 @@ +#!/bin/bash +# Setup Manubot +# Based on https://github.com/manubot/rootstock/blob/main/SETUP.md +# This is designed to be run from the bash terminal + +# Stop on first error. +set -e + +usage() { +echo "Usage: $0 [--owner text] [--repo text] [--yes]" +echo "Guides the user through the creation of a new Manubot repository for their manuscript." +echo +echo "If no options are supplied a fully interactive process is used." +echo "OWNER and REPO refer to the details of your manuscript repo location:" +echo "i.e. https://github.com/OWNER/REPO." +echo +echo "Options:" +echo " -o --owner GitHub user or organisation name." +echo " -r --repo Name of the repository for your new manuscript." +echo " -y --yes Non-interactive mode. Continue script without asking for confirmation that the repo exists." +echo " -s --ssh Use SSH to authenticate GitHub account. HTTPS is used by default." +echo " Option only effective if --yes is also set, otherwise answer given in user interaction takes precedence." +echo " -h --help Display usage information." +1>&2; exit 1; } + +# Check if to continue +check(){ +while true +do + echo "Once you have created your repo press enter to continue setup," + read -r -p "or type exit to quit now: " input + + case $input in + "") + echo + echo "Continuing Setup..." + echo + break + ;; + [eE][xX][iI][tT]) + exit 1 + ;; + *) + echo + echo "Invalid input, try again..." + echo + ;; + esac +done +} + +# Option strings +SHORT=o:r:hys +LONG=owner:,repo:,help,yes,ssh + +YES=0 # continue when prompted +AUTH=0 # used https or ssh auth + +# read the options +OPTS=$(getopt --options $SHORT --long $LONG --name "$0" -- "$@") + +if [ $? != 0 ] ; then echo "Failed to parse options...exiting." >&2 ; exit 1 ; fi + +eval set -- "$OPTS" + +# extract options and their arguments into variables. +while true ; do + case "$1" in + -o | --owner ) + shift; + OWNER=$1 + shift + ;; + -r | --repo ) + REPO="$2" + shift 2 + ;; + -y | --yes ) + YES=1 + shift + ;; + -s | --ssh ) + AUTH=1; + shift + ;; + -- ) + shift + break + ;; + -h | --help ) + shift + usage + exit 1 + ;; + *) + echo "Internal error!" + exit 1 + ;; + esac +done + +if [ -z "${OWNER}" ] || [ -z "${REPO}" ]; then + echo "This script will take you through the setup process for Manubot." + echo "First, we need to specify where to create the GitHub repo for your manuscript." + echo + echo "The URL will take this format: https://github.com/OWNER/REPO." + echo "OWNER is your username or organisation" + echo "REPO is the name of your repository" + echo + read -r -p "Type in the OWNER now:" input + OWNER=$input + read -r -p "Type in the REPO now:" input + REPO=$input +fi + +# If using interactive mode, check remote repo exists. +if [[ "$YES" == '0' ]]; then + while true + do + echo + read -r -p "Have you manually created https://github.com/${OWNER}/${REPO}? [y/n] " input + + case $input in + [yY][eE][sS]|[yY]) + + echo + echo "Continuing Setup..." + echo + break + ;; + [nN][oO]|[nN]) + echo + echo "Go to https://github.com/new and create https://github.com/${OWNER}/${REPO}" + echo "Note: the new repo must be completely empty or the script will fail." + echo + check + break + ;; + *) + echo + echo "Invalid input, try again..." + echo + ;; + esac + done +else + echo "Setting up https://github.com/${OWNER}/${REPO}" +fi + +# Clone manubot/rootstock +echo +echo "Cloning Rootstock..." +echo +git clone --single-branch https://github.com/manubot/rootstock.git ${REPO} +cd ${REPO} + +echo +echo "Setup tracking of remote..." + +# Configure remotes +git remote add rootstock https://github.com/manubot/rootstock.git + +# Check auth method +if [[ "$YES" == '0' ]]; then + while true + do + echo + read -r -p "Would you like to use SSH to authenticate your GitHub account? [y/n] " input + + case $input in + [yY][eE][sS]|[yY]) + AUTH=1 + break + ;; + [nN][oO]|[nN]) + AUTH=0 + break + ;; + *) + echo + echo "Invalid input, try again..." + echo + ;; + esac + done +fi + +case $AUTH in + 0) + echo + echo "Seting origin URL using its https web address" + echo + git remote set-url origin https://github.com/${OWNER}/${REPO}.git + ;; + 1) + echo + echo "Seting origin URL using SSH" + echo + git remote set-url origin git@github.com:$OWNER/$REPO.git + ;; +esac + +git push --set-upstream origin main + +# To use GitHub Actions only: +echo "Setup for GitHub Actions ONLY..." +# remove Travis CI config +git rm .travis.yml +# remove AppVeyor config +git rm .appveyor.yml +# remove ci/install.sh if using neither Travis CI nor AppVeyor +git rm ci/install.sh + +# Update README +echo "Updating README..." +# Perform substitutions +sed "s/manubot\/rootstock/${OWNER}\/${REPO}/g" README.md > tmp && mv -f tmp README.md +sed "s/manubot\.github\.io\/rootstock/${OWNER}\.github\.io\/${REPO}/g" README.md > tmp && mv -f tmp README.md + +echo "Committing rebrand..." +git add --update +git commit --message "Brand repo to $OWNER/$REPO" +git push origin main +echo +echo "Setup complete" +echo +echo "The new repo has been created at $(pwd)" +echo +echo "A good first step is to modify content/metadata.yaml with the relevant information for your manuscript." +echo