From f559600ff1965899b20874e71874794c05787087 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Wed, 6 Feb 2019 11:24:17 -0500 Subject: [PATCH 01/13] shortDOI support & update environment on 2019-02-06 Merges https://github.com/greenelab/manubot-rootstock/pull/174 * Environment update on 2019-02-06 Does not upgrade weasyprint or cairo, due to the following error during WeasyPrint execution: OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 Specify cairocffi dependency in environment.yml, since v0.9 from PyPI seemed to trigger the OSError. * Add shortDOI support & usage Update repo to https://github.com/manubot/manubot greenelab/manubot relocated to manubot/manubot as per https://github.com/manubot/manubot/issues/94. 02.delete-me.md still references greenelab/manubot, however it is not worth creating merge conflicts to update just this. --- .travis.yml | 4 ++-- USAGE.md | 6 +++++- build/environment.yml | 9 +++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 29420f4..f0d96b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,15 +5,15 @@ branches: only: - master before_install: - - wget https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh + - wget https://repo.continuum.io/miniconda/Miniconda3-4.5.12-Linux-x86_64.sh --output-document miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - source $HOME/miniconda/etc/profile.d/conda.sh - hash -r - conda config --set always_yes yes --set changeps1 no - - conda info --all install: - conda env create --quiet --file build/environment.yml + - conda list --name manubot - conda activate manubot script: - sh build/build.sh diff --git a/USAGE.md b/USAGE.md index 2379e7b..0b522b6 100644 --- a/USAGE.md +++ b/USAGE.md @@ -76,6 +76,10 @@ Therefore, citations must be of the following form: `@source:identifier`, where When choosing which source to use for a citation, we recommend the following order: 1. DOI (Digital Object Identifier), cite like `@doi:10.15363/thinklab.4`. + Shortened versions of DOIs can be created at [shortdoi.org](http://shortdoi.org/). + shortDOIs begin with `10/` rather than `10.` and can also be cited. + For example, Manubot will expand `@doi:10/993` to the DOI above. + We suggest using shortDOIs to cite DOIs containing forbidden characters, such as `(` or `)`. 2. PubMed Central ID, cite like `@pmcid:PMC4497619`. 3. PubMed ID, cite like `@pmid:26158728`. 4. _arXiv_ ID, cite like `@arxiv:1508.06576v2`. @@ -165,7 +169,7 @@ Note that `affiliations` should be a list to allow for multiple affiliations per ## Manubot feedback -If you experience any issues with the Manubot or would like to contribute to its source code, please visit [`greenelab/manubot`](https://github.com/greenelab/manubot) or [`greenelab/manubot-rootstock`](https://github.com/greenelab/manubot-rootstock). +If you experience any issues with the Manubot or would like to contribute to its source code, please visit [`manubot/manubot`](https://github.com/manubot/manubot) or [`greenelab/manubot-rootstock`](https://github.com/greenelab/manubot-rootstock). ## Examples diff --git a/build/environment.yml b/build/environment.yml index 60e6e73..aa43320 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -3,20 +3,21 @@ channels: - conda-forge dependencies: - conda-forge::cairo=1.14.12 + - conda-forge::cairocffi=0.8.0 - conda-forge::cffi=1.11.5 - conda-forge::ghp-import=0.5.5 - conda-forge::jinja2=2.10 - conda-forge::jsonschema=2.6.0 - - conda-forge::pandas=0.23.4 - - conda-forge::pandoc=2.5 + - conda-forge::pandas=0.24.0 + - conda-forge::pandoc=2.6 - conda-forge::pango=1.40.14 - - conda-forge::python=3.6.5 + - conda-forge::python=3.6.7 - conda-forge::pyyaml=3.13 - conda-forge::requests=2.21.0 - conda-forge::watchdog=0.8.3 - pip: - errorhandler==2.0.1 - - git+https://github.com/greenelab/manubot@552dd99aaa148365a29a87176fedd626d4642d3c + - git+https://github.com/manubot/manubot@4505db3fd8a9dc1ba26c36f3fea9accbf02d47d8 - jsonref==0.2 - opentimestamps-client==0.6.0 - opentimestamps==0.3.0 From 2a4c813179e0b4d51b8d4141a55684d206679e1d Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Tue, 12 Feb 2019 20:11:25 -0500 Subject: [PATCH 02/13] Relocate repository to manubot/rootstock Merges https://github.com/manubot/rootstock/pull/180 Closes https://github.com/greenelab/manubot-rootstock/issues/175 Closes https://github.com/greenelab/manubot-rootstock/pull/124 (supersedes) Relocate repository from https://github.com/greenelab/manubot-rootstock to https://github.com/manubot/rootstock. Relocate continuous integration from https://travis-ci.org/greenelab/manubot-rootstock to https://travis-ci.com/manubot/rootstock --- README.md | 22 +++++++++++----------- SETUP.md | 36 +++++++++++++++++++----------------- USAGE.md | 4 ++-- build/README.md | 2 +- build/assets/style.csl | 2 +- ci/README.md | 2 +- ci/deploy.key.enc | Bin 3248 -> 3248 bytes ci/deploy.key.pub | 2 +- ci/deploy.sh | 8 ++++---- 9 files changed, 40 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 7b55c40..7e83764 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ -[![HTML Manuscript](https://img.shields.io/badge/manuscript-HTML-blue.svg)](https://greenelab.github.io/manubot-rootstock/) -[![PDF Manuscript](https://img.shields.io/badge/manuscript-PDF-blue.svg)](https://greenelab.github.io/manubot-rootstock/manuscript.pdf) -[![Build Status](https://travis-ci.org/greenelab/manubot-rootstock.svg?branch=master)](https://travis-ci.org/greenelab/manubot-rootstock) +[![HTML Manuscript](https://img.shields.io/badge/manuscript-HTML-blue.svg)](https://manubot.github.io/rootstock/) +[![PDF Manuscript](https://img.shields.io/badge/manuscript-PDF-blue.svg)](https://manubot.github.io/rootstock/manuscript.pdf) +[![Build Status](https://travis-ci.com/manubot/rootstock.svg?branch=master)](https://travis-ci.com/manubot/rootstock) ## Manuscript description @@ -19,10 +19,10 @@ Actual manuscript instances will clone this repository (see [`SETUP.md`](SETUP.m Manubot is a system for writing scholarly manuscripts via GitHub. Manubot automates citations and references, versions manuscripts using git, and enables collaborative writing via GitHub. -The [Manubot Rootstock repository](https://git.io/vQSvo) is a general purpose template for creating new Manubot instances, as detailed in [`SETUP.md`](SETUP.md). +The [rootstock repository](https://git.io/fhQH1) is a general purpose template for creating new Manubot instances, as detailed in [`SETUP.md`](SETUP.md). See [`USAGE.md`](USAGE.md) for documentation how to write a manuscript. -Please open [an issue](https://github.com/greenelab/manubot-rootstock/issues) for questions related to Manubot usage, bug reports, or general inquiries. +Please open [an issue](https://git.io/fhQHM) for questions related to Manubot usage, bug reports, or general inquiries. ### Repository directories & files @@ -69,17 +69,17 @@ sh build/autobuild.sh ### Continuous Integration -[![Build Status](https://travis-ci.org/greenelab/manubot-rootstock.svg?branch=master)](https://travis-ci.org/greenelab/manubot-rootstock) +[![Build Status](https://travis-ci.com/manubot/rootstock.svg?branch=master)](https://travis-ci.com/manubot/rootstock) Whenever a pull request is opened, Travis CI will test whether the changes break the build process to generate a formatted manuscript. The build process aims to detect common errors, such as invalid citations. If your pull request build fails, see the Travis CI logs for the cause of failure and revise your pull request accordingly. -When a commit to the `master` branch occurs (for example, when a pull request is merged), Travis CI builds the manuscript and writes the results to the [`gh-pages`](https://github.com/greenelab/manubot-rootstock/tree/gh-pages) and [`output`](https://github.com/greenelab/manubot-rootstock/tree/output) branches. +When a commit to the `master` branch occurs (for example, when a pull request is merged), Travis CI builds the manuscript and writes the results to the [`gh-pages`](https://github.com/manubot/rootstock/tree/gh-pages) and [`output`](https://github.com/manubot/rootstock/tree/output) branches. The `gh-pages` branch uses [GitHub Pages](https://pages.github.com/) to host the following URLs: -+ **HTML manuscript** at https://greenelab.github.io/manubot-rootstock/ -+ **PDF manuscript** at https://greenelab.github.io/manubot-rootstock/manuscript.pdf ++ **HTML manuscript** at https://manubot.github.io/rootstock/ ++ **PDF manuscript** at https://manubot.github.io/rootstock/manuscript.pdf For continuous integration configuration details, see [`.travis.yml`](.travis.yml). @@ -94,7 +94,7 @@ We encourage users to openly license their manuscripts, which is the default as [![License: CC0 1.0](https://img.shields.io/badge/License%20Parts-CC0%201.0-lightgrey.svg)](https://creativecommons.org/publicdomain/zero/1.0/) Except when noted otherwise, the entirety of this repository is licensed under a CC BY 4.0 License ([`LICENSE.md`](LICENSE.md)), which allows reuse with attribution. -Please attribute by linking to https://github.com/greenelab/manubot-rootstock. +Please attribute by linking to https://github.com/manubot/rootstock. Since CC BY is not ideal for code and data, certain repository components are also released under the CC0 1.0 public domain dedication ([`LICENSE-CC0.md`](LICENSE-CC0.md)). All files matched by the following glob patterns are dual licensed under CC BY 4.0 and CC0 1.0: @@ -118,4 +118,4 @@ Except for the following files with different licenses: + `build/assets/anchors.js` which is [released](https://www.bryanbraun.com/anchorjs/) under an [MIT License](https://opensource.org/licenses/MIT) -Please open [an issue](https://github.com/greenelab/manubot-rootstock/issues) for any question related to licensing. +Please open [an issue](https://github.com/manubot/rootstock/issues) for any question related to licensing. diff --git a/SETUP.md b/SETUP.md index a32ae13..4f59302 100644 --- a/SETUP.md +++ b/SETUP.md @@ -1,9 +1,9 @@ -# Cloning manubot-rootstock to create a new manuscript +# Cloning the manubot/rootstock repository to create a new manuscript The process to create a new Manubot manuscript is a bit challenging, because it requires a few steps that are difficult to automate. However, you will only have to perform these steps once for each manuscript. These steps should be performed in a terminal, starting in the directory where you want the manuscript folder be created. -Setup is supported on Linux and macOS, but [**not on Windows**](https://github.com/greenelab/manubot-rootstock/issues/91). +Setup is supported on Linux and macOS, but [**not on Windows**](https://github.com/manubot/rootstock/issues/91). ## Configuration @@ -14,10 +14,10 @@ In general, assume that all commands in this setup are case-sensitive. **Edit the following commands with your manuscript's information:** ```sh -# GitHub username (change from greenelab) -OWNER=greenelab -# Repository name (change from manubot-rootstock) -REPO=manubot-rootstock +# GitHub username (change from manubot) +OWNER=manubot +# Repository name (change from rootstock) +REPO=rootstock ``` ## Create repository @@ -25,15 +25,15 @@ REPO=manubot-rootstock **Execute the remaining commands verbatim.** They do not need to be edited (if the setup works as intended). -Next you must clone `greenelab/manubot-rootstock` and configure its branches and remotes: +Next you must clone `manubot/rootstock` and configure its branches and remotes: ```sh -# Clone greenelab/manubot-rootstock -git clone https://github.com/greenelab/manubot-rootstock.git $REPO +# Clone manubot/rootstock +git clone https://github.com/manubot/rootstock.git $REPO cd $REPO # Configure remotes and branches -git remote add rootstock https://github.com/greenelab/manubot-rootstock.git +git remote add rootstock https://github.com/manubot/rootstock.git git checkout --orphan gh-pages git rm -r --force . git commit --allow-empty \ @@ -61,7 +61,7 @@ git push --set-upstream origin output ## Continuous integration -Now you must manually enable Travis CI for the new repository at https://travis-ci.org. +Now you must manually enable Travis CI for the new repository at https://travis-ci.com. Click the `+` sign to "Add New Repository". If you don't see your repository listed, push the "Sync account" button. Finally, flick the repository's switch to enable CI. @@ -89,10 +89,11 @@ Give the key a descriptive title, such as "Travis CI Manubot". For the next step, you need the [Travis command line client](https://github.com/travis-ci/travis.rb) installed. This program is a Ruby gem: install it with `gem install travis` (not `apt install travis`, which is a different program). -After the install, you will need to provide your credentials to login to travis with `travis login --org`. +After the install, you will need to provide your credentials to login to travis with `travis login`. ```sh travis encrypt-file \ + --com \ --repo=$OWNER/$REPO \ --force \ deploy.key > travis-encrypt-file.log @@ -119,6 +120,7 @@ Next, limit [concurrent](https://blog.travis-ci.com/2014-07-18-per-repository-co ```sh travis settings \ + --com \ --repo=$OWNER/$REPO \ maximum_number_of_builds --set 1 ``` @@ -141,8 +143,8 @@ Now update `README.md` files to reference the new repository: ```sh # Perform substitutions -sed "s/greenelab/$OWNER/g" README.md > tmp && mv -f tmp README.md -sed "s/manubot-rootstock/$REPO/g" README.md > tmp && mv -f tmp README.md +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 # Remove deletable content file git rm content/02.delete-me.md @@ -168,9 +170,9 @@ git push origin master You should be good to go now. A good first step is to modify `content/metadata.yaml` with the relevant information for your manuscript. -# Merging upstream manubot-rootstock changes +# Merging upstream rootstock changes -This section will describe how to incorporate changes to manubot-rootstock that occurred since initializing your manuscript. +This section will describe how to incorporate changes to rootstock that occurred since initializing your manuscript. You will want to do this if there are new enhancements or bugfixes that you want to incorporate. This process can be difficult, especially if conflicts have arisen, and is recommended only for advanced git users. @@ -182,7 +184,7 @@ First, checkout a new branch to use as the pull request head branch: git checkout -b rootstock-`date '+%Y-%m-%d'` ``` -Second, pull the new commits from manubot-rootstock, but do not automerge: +Second, pull the new commits from rootstock, but do not automerge: ```sh git pull --no-ff --no-commit rootstock master diff --git a/USAGE.md b/USAGE.md index 0b522b6..4447603 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,6 +1,6 @@ # Manubot usage guidelines -This repository uses [Manubot](https://github.com/greenelab/manubot-rootstock) to automatically produce a manuscript from the source in the [`content`](content) directory. +This repository uses [Manubot](https://manubot.org) to automatically produce a manuscript from the source in the [`content`](content) directory. ## Manubot markdown @@ -169,7 +169,7 @@ Note that `affiliations` should be a list to allow for multiple affiliations per ## Manubot feedback -If you experience any issues with the Manubot or would like to contribute to its source code, please visit [`manubot/manubot`](https://github.com/manubot/manubot) or [`greenelab/manubot-rootstock`](https://github.com/greenelab/manubot-rootstock). +If you experience any issues with the Manubot or would like to contribute to its source code, please visit [`manubot/manubot`](https://github.com/manubot/manubot) or [`manubot/rootstock`](https://github.com/manubot/rootstock). ## Examples diff --git a/build/README.md b/build/README.md index e79063b..3be7e94 100644 --- a/build/README.md +++ b/build/README.md @@ -11,7 +11,7 @@ For example, use the command `BUILD_DOCX=true sh build/build.sh`. To export DOCX for all Travis builds, set a [Travis environment variable](https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings). Currently, equation numbers via `pandoc-eqnos` are not supported for DOCX output. There is varying support for embedding images in DOCX output. -Please reference [Pull Request #40](https://github.com/greenelab/manubot-rootstock/pull/40) for possible solutions and continued discussion. +Please reference [Pull Request #40](https://github.com/manubot/rootstock/pull/40) for possible solutions and continued discussion. ## Environment diff --git a/build/assets/style.csl b/build/assets/style.csl index 07ba262..51b1f49 100644 --- a/build/assets/style.csl +++ b/build/assets/style.csl @@ -5,7 +5,7 @@ Manubot http://www.zotero.org/styles/manubot - + Daniel Himmelstein daniel.himmelstein@gmail.com diff --git a/ci/README.md b/ci/README.md index a8e0d1a..abfd2ed 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,6 +1,6 @@ # Continuous integration / analysis directory -[![Build Status](https://travis-ci.org/greenelab/manubot-rootstock.svg?branch=master)](https://travis-ci.org/greenelab/manubot-rootstock) +[![Build Status](https://travis-ci.com/manubot/rootstock.svg?branch=master)](https://travis-ci.com/manubot/rootstock) This repository uses [continuous analysis](https://doi.org/10.1101/056473 "Reproducible Computational Workflows with Continuous Analysis") to create the manuscript and commit it back to GitHub. [`deploy.sh`](deploy.sh) runs on successful `master` branch builds that are not pull requests. diff --git a/ci/deploy.key.enc b/ci/deploy.key.enc index 28adfa66e36e6801295509a555478e06e006332f..6518ffd1257daef81a40e890671bed46d9f2c8eb 100644 GIT binary patch literal 3248 zcmV;h3{Uf&qPa3&?mNq1IY>b20)tJ>;o?p%EU_<)8J5SmBfi+3b91D3Xya%cn1^M( zakF~JinPeESP$Zw}|0AQG#NKS$5yG4m%hfkfw1444 zimvot`3(cv9Oj`2@R?Z1q_$xpeP~iI8n>9dW_4t^Ej~wq7hf$A*b*nl_ux47$MA}j zjrZyR{CJ}E?g5yo!u2EY+*jr&DNO=|A)#Q;wDP2gX}f{ zQV1Ru;V$ZZP(@&aD_UfC)O47X)WOWcx!(!B*hs3qdzJ{|6MdxQ3AfZx-Z!!(U}Kz) zAq&h`wq3bI{7mxxq^|6mF85m1U}TX`<=+U=6k^E2UCpmuSelVDSnud6sWcx^`CWrz zND8sJ%maSeq>-u4K5Yqq{!wX5?qnWM+KqzP26{uxo8IK%-$My8aBa0m`qmku1?2KF4o@tehTVHsy0K$VhT_*7A zzDDIg13jvF$D@HMv;kFlaYp&UE5qN5xSJ!Gn~{rcS)KZPioH6PuKc|Xd@%Fd9ZGo9 zA)%%i6xLr&kt7a;dnaY`A{zOtS(A{dmN~LEriv{xS78KYQR^v8d)vdX?l1kQ{S`>P zRgKf1F9Sj&TM5jt_$a7=aDIyty*o5AcuDZbxi|9({f_X2c3l)nb3 zem;d7Gf{yl^6_rRS&O~h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zDM>43^V|0eTLPo5w(0F7W`*`?#Pmf0j~)*H#V*fd^%mt95=;w!Yxu8`t(Zme9kWti z2SJ~8iimQ<-m&ONwzK49-pl^;Hm;?MFbwuV>1t3|0uCB<3)q}wYkP-ehZQ039rffP zBh(MVQP#ZP6B~j#j7`|qaafXwmB=>*YS^Rbi}aeV4mVEr_@y-t%ZG58JL)bL6%bcn z&z<;!_;?f`t<1I_>}kLyk`X+Id3otR+4o09*x?DRV8h-af;6u!+G!t2S!a>;mbB){ zThU1BU_EAR6shM0xVcC5PZrE84G^EM1U&8ZxFe$_`iTwk^!;C-AwC){hkt^t37NK@ z*|6jlKt;s?c!@eZI^iTmDo=-!x=+xP;|r#tyH#odJQ(Aw#?~>4_1p4Zz!I&(lNgq_ zcwM%WyxgLpKyWVLe9YghyKgA@!v*4B|8d?QsO0+2;gv<_Wj-x-`Zu#T1w%A{KbW$t zEHFeu=0qc#C3)L@K(QdcU>={ZXY6bGs}T;<-nAfG`H^%PKTI$nchWFA3rc}5FnYs;GJwnTu7G0(G@?n)#nuGh^@vT6dE zJt2=>yS({>zqVgTZj7>}w&uNd2dOAT*=e63daLyi=zDf;A|JFDJ6W^?@k6+ZH?GNh zFF*ryc6S}LV!j{;$j^+XFr!fNEen`~Zih8!AH9?3wU(eQWH&y>R<#?OK80BS{q6?C zQA1U|kBpL$YG;ST%qWJTQ;TQnWDF|(BH6Bx@+GtXxTYx+KqHBS9300by;{ Date: Thu, 28 Feb 2019 01:16:32 -0800 Subject: [PATCH 03/13] Fix SETUP.md random string & psutil install Merges https://github.com/manubot/rootstock/pull/182 Update SETUP.md to replace the correct random string Fix missing x86_64-conda_cos6-linux-gnu-gcc in psutil install by installing psutil using conda. .travis.yml: one configuration option per line (non-functional whitespace change) --- .travis.yml | 4 +++- SETUP.md | 2 +- build/environment.yml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0d96b3..7f4cd22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,9 @@ before_install: - bash miniconda.sh -b -p $HOME/miniconda - source $HOME/miniconda/etc/profile.d/conda.sh - hash -r - - conda config --set always_yes yes --set changeps1 no + - conda config + --set always_yes yes + --set changeps1 no install: - conda env create --quiet --file build/environment.yml - conda list --name manubot diff --git a/SETUP.md b/SETUP.md index 4f59302..5d366f2 100644 --- a/SETUP.md +++ b/SETUP.md @@ -113,7 +113,7 @@ The following command automates this substitution. TRAVIS_ENCRYPT_ID=`python -c "import re; \ text = open('travis-encrypt-file.log').read(); \ print(re.search('encrypted_([a-f0-9]+)_key', text).group(1))"` -sed "s/f2f00aaf6402/$TRAVIS_ENCRYPT_ID/g" deploy.sh > tmp && mv -f tmp deploy.sh +sed "s/9befd6eddffe/$TRAVIS_ENCRYPT_ID/g" deploy.sh > tmp && mv -f tmp deploy.sh ``` Next, limit [concurrent](https://blog.travis-ci.com/2014-07-18-per-repository-concurrency-setting/) Travis CI jobs to ensure previous builds deploy before subsequent ones begin: diff --git a/build/environment.yml b/build/environment.yml index aa43320..553a5db 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -11,6 +11,7 @@ dependencies: - conda-forge::pandas=0.24.0 - conda-forge::pandoc=2.6 - conda-forge::pango=1.40.14 + - conda-forge::psutil=5.5.1 - conda-forge::python=3.6.7 - conda-forge::pyyaml=3.13 - conda-forge::requests=2.21.0 From 720febe2e48805035e4b5c7862c63b353e3cf65e Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Sat, 2 Mar 2019 07:37:29 -0500 Subject: [PATCH 04/13] CI: only deploy on push TRAVIS_EVENT_TYPE Merges https://github.com/manubot/rootstock/pull/184 Previously, ci/deploy.sh could be run for push, api, or cron builds, but not for pull_request builds. This commit further restricts when deployment is run to just push builds. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7f4cd22..34b14d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,5 +24,5 @@ cache: - ci/cache after_success: - test $TRAVIS_BRANCH = "master" && - test $TRAVIS_PULL_REQUEST = "false" && + test $TRAVIS_EVENT_TYPE = "push" && sh ci/deploy.sh From e5ab24a6e02728273b470e7adf46eeb20aebb4d2 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 8 Mar 2019 18:05:00 -0500 Subject: [PATCH 05/13] HTML: default theme updates Merges https://github.com/manubot/rootstock/pull/178 Various aesthetic updates, refactoring, edits for plugins, and additional comments --- build/themes/default.html | 365 +++++++++++++++++++++++++------------- 1 file changed, 245 insertions(+), 120 deletions(-) diff --git a/build/themes/default.html b/build/themes/default.html index 77fde56..9d69734 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -1,6 +1,6 @@ - From 6303fcfbac952c2fab8b6fff2cf82f18949fd9bb Mon Sep 17 00:00:00 2001 From: Anthony Gitter Date: Tue, 12 Mar 2019 08:28:23 -0500 Subject: [PATCH 06/13] Update rootstock manual JSON CSL in example reference Merges https://github.com/manubot/rootstock/pull/186 --- content/manual-references.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/content/manual-references.json b/content/manual-references.json index be37a81..dda7f5b 100644 --- a/content/manual-references.json +++ b/content/manual-references.json @@ -1,14 +1,14 @@ [ { "type": "webpage", - "standard_citation": "url:https://github.com/greenelab/manubot-rootstock", - "URL": "https://github.com/greenelab/manubot-rootstock", - "title": "greenelab/manubot-rootstock GitHub repository", + "standard_citation": "url:https://github.com/manubot/rootstock", + "URL": "https://github.com/manubot/rootstock", + "title": "manubot/rootstock GitHub repository", "container-title": "GitHub", "issued": { "date-parts": [ [ - 2017 + 2019 ] ] }, @@ -19,4 +19,4 @@ } ] } -] \ No newline at end of file +] From af1d47a0ec5f33d8fc99deab2ac23b697983b673 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Tue, 12 Mar 2019 10:21:45 -0400 Subject: [PATCH 07/13] HTML: add modular plugins for webpage interactivity Merges https://github.com/manubot/rootstock/pull/179 Closes https://github.com/manubot/rootstock/issues/185 Improves https://github.com/manubot/rootstock/issues/165 Adds plugins that can be included in the pandoc build commands to enable various interactive frontend features. Plugins are located in `build/plugins/` and consist of: - accordion (new) - analytics (modified) - anchors (replaced) - hypothesis (modified) - jump-to-first (new) - lightbox (new) - link-highlight (new) - math (modifies how MathJax is loaded) - table-of-contents (new) - table-scroll (new) - tooltips (new) --- README.md | 4 - build/build.sh | 13 +- build/plugins/accordion.html | 273 ++++++++++++ build/plugins/analytics.html | 7 +- build/plugins/anchors.html | 159 ++++++- build/plugins/hypothesis.html | 31 +- build/plugins/jump-to-first.html | 273 ++++++++++++ build/plugins/lightbox.html | 592 +++++++++++++++++++++++++ build/plugins/link-highlight.html | 192 ++++++++ build/plugins/math.html | 22 + build/plugins/table-of-contents.html | 282 ++++++++++++ build/plugins/table-scroll.html | 68 +++ build/plugins/tooltips.html | 627 +++++++++++++++++++++++++++ build/themes/default.html | 549 +++++++++++++++++++++++ 14 files changed, 3067 insertions(+), 25 deletions(-) create mode 100644 build/plugins/accordion.html create mode 100644 build/plugins/jump-to-first.html create mode 100644 build/plugins/lightbox.html create mode 100644 build/plugins/link-highlight.html create mode 100644 build/plugins/math.html create mode 100644 build/plugins/table-of-contents.html create mode 100644 build/plugins/table-scroll.html create mode 100644 build/plugins/tooltips.html diff --git a/README.md b/README.md index 7e83764..dcd0975 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,4 @@ All other files are only available under CC BY 4.0, including: + `*.pdf` + `*.docx` -Except for the following files with different licenses: - -+ `build/assets/anchors.js` which is [released](https://www.bryanbraun.com/anchorjs/) under an [MIT License](https://opensource.org/licenses/MIT) - Please open [an issue](https://github.com/manubot/rootstock/issues) for any question related to licensing. diff --git a/build/build.sh b/build/build.sh index 69f6735..01f9284 100644 --- a/build/build.sh +++ b/build/build.sh @@ -33,11 +33,20 @@ pandoc --verbose \ --bibliography=$BIBLIOGRAPHY_PATH \ --csl=$CSL_PATH \ --metadata link-citations=true \ - --mathjax \ --include-after-body=build/themes/default.html \ - --include-after-body=build/plugins/analytics.html \ + --include-after-body=build/plugins/table-scroll.html \ --include-after-body=build/plugins/anchors.html \ + --include-after-body=build/plugins/accordion.html \ + --include-after-body=build/plugins/tooltips.html \ + --include-after-body=build/plugins/jump-to-first.html \ + --include-after-body=build/plugins/link-highlight.html \ + --include-after-body=build/plugins/table-of-contents.html \ + --include-after-body=build/plugins/lightbox.html \ + --mathjax \ + --variable math="" \ + --include-after-body=build/plugins/math.html \ --include-after-body=build/plugins/hypothesis.html \ + --include-after-body=build/plugins/analytics.html \ --output=output/manuscript.html \ $INPUT_PATH diff --git a/build/plugins/accordion.html b/build/plugins/accordion.html new file mode 100644 index 0000000..c47ae45 --- /dev/null +++ b/build/plugins/accordion.html @@ -0,0 +1,273 @@ + + + + + + + diff --git a/build/plugins/analytics.html b/build/plugins/analytics.html index 5264bbd..0e641a1 100644 --- a/build/plugins/analytics.html +++ b/build/plugins/analytics.html @@ -1,4 +1,3 @@ - - - \ No newline at end of file + + + diff --git a/build/plugins/anchors.html b/build/plugins/anchors.html index 5f4777b..92015d1 100644 --- a/build/plugins/anchors.html +++ b/build/plugins/anchors.html @@ -1,15 +1,148 @@ + + + + + + diff --git a/build/plugins/hypothesis.html b/build/plugins/hypothesis.html index bbc90f7..b38888e 100644 --- a/build/plugins/hypothesis.html +++ b/build/plugins/hypothesis.html @@ -1,2 +1,29 @@ - - + + + + + + + diff --git a/build/plugins/jump-to-first.html b/build/plugins/jump-to-first.html new file mode 100644 index 0000000..487ddae --- /dev/null +++ b/build/plugins/jump-to-first.html @@ -0,0 +1,273 @@ + + + + + + + diff --git a/build/plugins/lightbox.html b/build/plugins/lightbox.html new file mode 100644 index 0000000..ec90566 --- /dev/null +++ b/build/plugins/lightbox.html @@ -0,0 +1,592 @@ + + + + + + + + + + + diff --git a/build/plugins/link-highlight.html b/build/plugins/link-highlight.html new file mode 100644 index 0000000..f9a8469 --- /dev/null +++ b/build/plugins/link-highlight.html @@ -0,0 +1,192 @@ + + + diff --git a/build/plugins/math.html b/build/plugins/math.html new file mode 100644 index 0000000..f1a3861 --- /dev/null +++ b/build/plugins/math.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html new file mode 100644 index 0000000..d33d6e2 --- /dev/null +++ b/build/plugins/table-of-contents.html @@ -0,0 +1,282 @@ + + + + + + + diff --git a/build/plugins/table-scroll.html b/build/plugins/table-scroll.html new file mode 100644 index 0000000..2a4473a --- /dev/null +++ b/build/plugins/table-scroll.html @@ -0,0 +1,68 @@ + + + diff --git a/build/plugins/tooltips.html b/build/plugins/tooltips.html new file mode 100644 index 0000000..82390b6 --- /dev/null +++ b/build/plugins/tooltips.html @@ -0,0 +1,627 @@ + + + + + + + + + + + diff --git a/build/themes/default.html b/build/themes/default.html index 9d69734..b65d6fe 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -542,4 +542,553 @@ /* nudge to make room for equation auto-number */ margin-right: 40px !important; } + + /* -------------------------------------------------- */ + /* table scroll plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* table wrapper */ + .table_wrapper { + /* show scrollbar on tables if necessary to prevent overflow */ + overflow: auto; + width: 100%; + margin: 20px 0; + } + + /* table within table wrapper */ + .table_wrapper table, + .table_wrapper table * { + /* don't break table words */ + word-break: normal !important; + } + + .table_wrapper > table { + /* move margins from table to table_wrapper to allow margin collapsing */ + margin: 0; + } + } + + /* -------------------------------------------------- */ + /* anchors plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* anchor button */ + .anchor { + opacity: 0; + margin-left: 5px; + } + + /* anchor buttons within

's */ + h2 .anchor { + margin-left: 10px; + } + + /* anchor buttons when hovered/focused and anything containing an anchor button when hovered */ + *:hover > .anchor, + .anchor:hover, + .anchor:focus { + opacity: 1; + } + + /* anchor button when hovered */ + .anchor:hover { + cursor: pointer; + } + } + + /* always show anchor button on devices with no mouse/hover ability */ + @media (hover: none) { + .anchor { + opacity: 1; + } + } + + /* always hide anchor button on print */ + @media only print { + .anchor { + display: none; + } + } + + /* -------------------------------------------------- */ + /* accordion plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* accordion arrow button */ + .accordion_arrow { + margin-right: 10px; + } + + /* arrow icon when

data-collapsed attribute true */ + h2[data-collapsed="true"] > .accordion_arrow > svg { + transform: rotate(-90deg); + } + + /* all elements (except

's) when data-collapsed attribute true */ + *:not(h2)[data-collapsed="true"] { + display: none; + } + + /* accordion arrow button when hovered and

's when hovered */ + .accordion_arrow:hover, + h2[data-collapsed="true"]:hover, + h2[data-collapsed="false"]:hover { + cursor: pointer; + } + } + + /* always hide accordion arrow button on print */ + @media only print { + .accordion_arrow { + display: none; + } + } + + /* -------------------------------------------------- */ + /* tooltips plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* tooltip container */ + #tooltip { + position: absolute; + width: 50%; + min-width: 240px; + z-index: 1; + } + + /* tooltip content */ + #tooltip_content { + margin: 10px 0; + padding: 20px; + border-radius: 5px; + border: solid 1px #bdbdbd; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.05); + background: #ffffff; + word-break: all; + word-break: break-word; + } + + /* tooltip copy of paragraphs and figures */ + #tooltip_content > p, + #tooltip_content > figure { + margin: 0; + } + + /* tooltip copy of figure captions */ + #tooltip_content > figure > figcaption { + margin: 0; + margin-top: 20px; + padding: 0; + } + + /* navigation bar */ + #tooltip_nav_bar { + margin-top: 10px; + text-align: center; + } + + /* navigation bar previous/next buton */ + #tooltip_nav_bar > .icon_button { + position: relative; + top: 3px; + } + + /* navigation bar previous button */ + #tooltip_nav_bar > .icon_button:first-of-type { + margin-right: 5px; + } + + /* navigation bar next button */ + #tooltip_nav_bar > .icon_button:last-of-type { + margin-left: 5px; + } + } + + /* always hide tooltip on print */ + @media only print { + #tooltip { + display: none; + } + } + + /* -------------------------------------------------- */ + /* jump to first plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* jump button */ + .jump_arrow { + position: relative; + top: 0.125em; + margin-right: 5px; + } + } + + /* always hide jump button on print */ + @media only print { + .jump_arrow { + display: none; + } + } + + /* -------------------------------------------------- */ + /* link highlight plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* anything with data-highlighted attribute true */ + [data-highlighted="true"] { + background: #ffeb3b; + } + + /* anything with data-selected attribute true */ + [data-selected="true"] { + background: #ff8a65 !important; + } + + /* animation definition for glow */ + @keyframes highlight_glow { + 0% { + background: none; + } + 10% { + background: #bbdefb; + } + 100% { + background: none; + } + } + + /* anything with data-glow attribute true */ + [data-glow="true"] { + animation: highlight_glow 2s; + } + } + + /* -------------------------------------------------- */ + /* table of contents plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* toc panel when open */ + #toc_panel { + box-sizing: border-box; + position: fixed; + top: 0; + left: 0; + min-width: 260px; + max-width: 480px; + /* keep panel edge consistent distance away from "page" edge */ + width: calc(((100vw - 8.5in) / 2) - 30px - 40px); + bottom: 0; + background: #ffffff; + border-right: solid 1px #bdbdbd; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.05); + z-index: 2; + } + + /* toc panel when closed */ + #toc_panel[data-open="false"] { + min-width: 60px; + width: 60px; + height: 60px; + border-bottom: solid 1px #bdbdbd; + } + + /* toc panel header */ + #toc_panel > h3 { + box-sizing: border-box; + height: 60px; + margin: 0; + padding: 20px; + border-bottom: solid 1px #bdbdbd; + } + + /* toc panel when hovered */ + #toc_panel > h3:hover { + cursor: pointer; + } + + /* toc open/close header button */ + #toc_button { + margin-right: 20px; + vertical-align: top; + } + + /* toc header text */ + #toc_header_text { + vertical-align: top; + font-weight: 600; + position: relative; + top: -4px; + } + + /* hide toc list and header text when closed */ + #toc_panel[data-open="false"] #toc_header_text, + #toc_panel[data-open="false"] > #toc_list { + display: none; + } + + /* toc list of entries */ + #toc_list { + box-sizing: border-box; + width: 100%; + padding: 20px; + position: absolute; + top: calc(60px + 1px); + bottom: 0; + overflow: auto; + } + + /* toc entry, link to section in document */ + .toc_link { + display: block; + padding: 5px; + position: relative; + font-weight: 600; + text-decoration: none; + } + + /* toc entry when hovered or when "viewed" */ + .toc_link:hover, + .toc_link[data-viewing="true"] { + background: #f5f5f5; + } + + /* toc entry, level 1 indentation */ + .toc_link[data-level="1"] { + margin-left: 0; + } + + /* toc entry, level 2 indentation */ + .toc_link[data-level="2"] { + margin-left: 20px; + } + + /* toc entry, level 3 indentation */ + .toc_link[data-level="3"] { + margin-left: 40px; + } + + /* toc entry, level 4 indentation */ + .toc_link[data-level="4"] { + margin-left: 60px; + } + + /* toc entry bullets */ + #toc_panel[data-bullets="true"] .toc_link[data-level]:before { + position: absolute; + left: -15px; + top: -1px; + font-size: 1.5em; + } + + /* toc entry, level 2 bullet */ + #toc_panel[data-bullets="true"] .toc_link[data-level="2"]:before { + content: "\2022"; + } + + /* toc entry, level 3 bullet */ + #toc_panel[data-bullets="true"] .toc_link[data-level="3"]:before { + content: "\25AB"; + } + + /* toc entry, level 4 bullet */ + #toc_panel[data-bullets="true"] .toc_link[data-level="4"]:before { + content: "-"; + } + } + + /* when on screen < 8.5in wide */ + @media only screen and (max-width: 8.5in) { + /* push ("page") element down to make room for toc icon */ + .toc_body_nudge { + padding-top: 60px; + } + + /* toc icon when panel closed and not hovered */ + #toc_panel[data-open="false"]:not(:hover) { + background: rgba(255, 255, 255, 0.75); + } + } + + /* always hide toc panel on print */ + @media only print { + #toc_panel { + display: none; + } + } + + /* -------------------------------------------------- */ + /* lightbox plugin */ + /* -------------------------------------------------- */ + + @media only screen { + /* regular in document when hovered */ + .lightbox_img:hover { + cursor: pointer; + } + + .body_no_scroll { + overflow: hidden !important; + } + + /* screen overlay */ + #lightbox_overlay { + display: flex; + flex-direction: column; + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.75); + z-index: 3; + } + + /* middle area containing lightbox image */ + #lightbox_image_container { + flex-grow: 1; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + position: relative; + padding: 20px; + } + + /* bottom area containing caption */ + #lightbox_bottom_container { + display: flex; + justify-content: center; + align-items: center; + height: 100px; + min-height: 100px; + max-height: 100px; + background: rgba(0, 0, 0, 0.5); + } + + /* image number info text box */ + #lightbox_number_info { + position: absolute; + color: #ffffff; + font-weight: 600; + left: 2px; + top: 0; + z-index: 4; + } + + /* zoom info text box */ + #lightbox_zoom_info { + position: absolute; + color: #ffffff; + font-weight: 600; + right: 2px; + top: 0; + z-index: 4; + } + + /* copy of image caption */ + #lightbox_caption { + box-sizing: border-box; + display: inline-block; + width: 100%; + max-height: 100%; + padding: 10px 0; + text-align: center; + overflow-y: auto; + color: #ffffff; + } + + /* navigation previous/next button */ + .lightbox_button { + width: 100px; + height: 100%; + min-width: 100px; + min-height: 100%; + color: #ffffff; + } + + /* navigation previous/next button when hovered */ + .lightbox_button:hover { + background: none !important; + } + + /* navigation button icon */ + .lightbox_button > svg { + height: 25px; + } + + /* figure auto-number */ + #lightbox_caption > span:first-of-type { + font-weight: bold; + margin-right: 5px; + } + + /* lightbox image when hovered */ + #lightbox_img:hover { + cursor: grab; + } + + /* lightbox image when grabbed */ + #lightbox_img:active { + cursor: grabbing; + } + } + + /* when on screen < 480px wide */ + @media only screen and (max-width: 480px) { + /* make navigation buttons skinnier on small screens to make more room for caption text */ + .lightbox_button { + width: 50px; + min-width: 50px; + } + } + + /* always hide lightbox on print */ + @media only print { + #lightbox_overlay { + display: none; + } + } + + /* -------------------------------------------------- */ + /* hypothesis (annotations) plugin */ + /* -------------------------------------------------- */ + + /* side panel */ + .annotator-frame { + width: 280px !important; + z-index: 0 !important; + } + + /* match highlight color to rest of theme */ + .annotator-highlights-always-on .annotator-hl { + background-color: #ffeb3b !important; + } + + /* match focused color to rest of theme */ + .annotator-hl.annotator-hl-focused { + background-color: #ff8a65 !important; + } + + /* match bucket bar color to rest of theme */ + .annotator-bucket-bar { + background: #f5f5f5 !important; + } + + /* always hide toolbar and tooltip on print */ + @media only print { + .annotator-frame { + display: none !important; + } + + hypothesis-adder { + display: none !important; + } + } From 3b5bf5c3c937a61ce08d7c8bfa8bf08a4b1af231 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Wed, 13 Mar 2019 17:41:01 -0400 Subject: [PATCH 08/13] Update content/02.delete-me.md to show formatting Merges https://github.com/manubot/rootstock/pull/169 --- content/02.delete-me.md | 264 ++++++++++++++++++++++++++++++++++++-- content/citation-tags.tsv | 2 +- content/metadata.yaml | 2 +- 3 files changed, 256 insertions(+), 12 deletions(-) diff --git a/content/02.delete-me.md b/content/02.delete-me.md index 9f0e403..bf51fa9 100644 --- a/content/02.delete-me.md +++ b/content/02.delete-me.md @@ -1,15 +1,259 @@ -## Manubot Rootstock Information +This manuscript is a template (aka "rootstock") for [Manubot](https://manubot.org/ "Manubot"), a tool for writing scholarly manuscripts. +Use this template as a starting point for your manuscript. -**Note: Manubot instances should delete this file.** +The rest of this document is a full list of formatting elements/features supported by Manubot. +Compare the input (`.md` files in the `/content` directory) to the output you see below. -The Manubot is a system for automating scholarly publishing. -Content is written in [Pandoc Markdown](http://pandoc.org/MANUAL.html#pandocs-markdown) source files. -See [`USAGE.md`](https://github.com/greenelab/manubot-rootstock/blob/master/USAGE.md) for more information on how to use the Manubot. +## Basic formatting -The Manubot project began with the [Deep Review](https://github.com/greenelab/deep-review), where it was used to compose a highly-collaborative review article [@doi:10.1098/rsif.2017.0387]. -Another example manuscript that was created with Manubot is: +**Bold** __text__ -+ The Sci-Hub Coverage Study ([GitHub](https://github.com/greenelab/scihub-manuscript), [HTML manuscript](https://greenelab.github.io/scihub-manuscript/)) [@doi:10.7554/eLife.32822] +[Semi-bold text]{.semibold} -If you notice a problem with Manubot, it's best to submit an upstream fix to the appropriate repository: -[`greenelab/manubot-rootstock`](https://github.com/greenelab/manubot-rootstock) for the git repository stub or [`greenelab/manubot`](https://github.com/greenelab/manubot) for the Python package. +[Centered text]{.center} + +[Right-aligned text]{.right} + +*Italic* _text_ + +Combined *italics and __bold__* + +~~Strikethrough~~ + +1. Ordered list item +2. Ordered list item + a. Sub-item + b. Sub-item + i. Sub-sub-item +3. Ordered list item + a. Sub-item + +- List item +- List item +- List item + +superscript2 + +subscript2n+1 + +[unicode superscripts](https://www.google.com/search?q=superscript+generator)⁰¹²³⁴⁵⁶⁷⁸⁹ + +[unicode subscripts](https://www.google.com/search?q=superscript+generator)₀₁₂₃₄₅₆₇₈₉ + +A long paragraph of text. +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + +Putting each sentence on its own line has numerous benefits with regard to [editing](https://asciidoctor.org/docs/asciidoc-recommended-practices/#one-sentence-per-line) and [version control](https://rhodesmill.org/brandon/2012/one-sentence-per-line/). + +Line break without starting a new paragraph by putting +two spaces at end of line. + +## Document organization + +Document section headings: + +# Heading 1 + +## Heading 2 + +### Heading 3 + +#### Heading 4 + +### A heading centered on its own printed page{.center .page_center} + + + +Horizontal rule: + +--- + +`Heading 1`'s are recommended to be reserved for the title of the manuscript. + +`Heading 2`'s are recommended for broad sections such as *Abstract*, *Methods*, *Conclusion*, etc. + +`Heading 3`'s and `Heading 4`'s are recommended for sub-sections. + +## Links + +Bare URL link: + +[Link with text](https://manubot.org) + +[Link with hover text](https://manubot.org "Manubot Homepage") + +[Link by reference][manubot homepage] + +[Manubot Homepage]: https://manubot.org + +## Citations + +Citation by DOI [@doi:10.7554/eLife.32822]. + +Citation by PubMed Central ID [@pmcid:PMC6103790]. + +Citation by PubMed ID [@pmid:30718888]. + +Citation by Wikidata ID [@wikidata:Q56458321]. + +Citation by ISBN [@isbn:9780262517638]. + +Citation by URL [@url:https://github.com/manubot/rootstock]. + +Citation by tag [@tag:deep-review]. + +Multiple citations can be put inside the same set of brackets [@doi:10.7554/eLife.32822; @tag:deep-review; @isbn:9780262517638]. +Manubot plugins provide easier, more convenient visualization of and navigation between citations [@url:https://greenelab.github.io/meta-review; @pmid:30718888; @pmcid:PMC6103790; @tag:deep-review]. + +## Referencing figures, tables, equations + +Figure @fig:square-image + +Figure @fig:wide-image + +Figure @fig:tall-image + +Figure @fig:vector-image + +Table @tbl:bowling-scores + +Equation @eq:regular-equation + +Equation @eq:long-equation + +## Quotes and code + +> Quoted text + + +> Quoted block of text +> +> Two roads diverged in a wood, and I— +> I took the one less traveled by, +> And that has made all the difference. + + +Code `in the middle` of normal text, aka `inline code`. + +Code block with Python syntax highlighting: + +```python +from manubot.cite.doi import expand_short_doi + +def test_expand_short_doi(): + doi = expand_short_doi("10/c3bp") + # a string too long to fit within page: + assert doi == "10.25313/2524-2695-2018-3-vliyanie-enhansera-copia-i-insulyatora-gypsy-na-sintez-ernk-modifikatsii-hromatina-i-svyazyvanie-insulyatornyh-belkov-vtransfetsirovannyh-geneticheskih-konstruktsiyah" +``` + +Code block with no syntax highlighting: + +``` +Exporting HTML manuscript +Exporting DOCX manuscript +Exporting PDF manuscript +``` + +## Figures + +![ +**A square image at actual size and with a bottom caption.** +Loaded from the latest version of image on GitHub. +](https://raw.githubusercontent.com/greenelab/manubot-resources/master/test/square.png "Square image"){#fig:square-image} + +![ +**An image too wide to fit within page at full size.** +Loaded from a specific (hashed) version of the image on GitHub. +](https://raw.githubusercontent.com/manubot/resources/bfd6afcd9f47d7da34362e62a005d86e85aef25a/test/wide.png "Wide image"){#fig:wide-image} + +![ +**A tall image with a specified height.** +Loaded from a specific (hashed) version of the image on GitHub. +](https://raw.githubusercontent.com/manubot/resources/bfd6afcd9f47d7da34362e62a005d86e85aef25a/test/tall.png "Tall image"){#fig:tall-image height=3in} + +![ +**A vector `.svg` image loaded from GitHub.** +The parameter `sanitize=true` is necessary to properly load SVGs hosted via GitHub URLs. +White background specified to serve as a backdrop for transparent sections of the image. +](https://raw.githubusercontent.com/manubot/resources/master/test/vector.svg?sanitize=true "Vector image"){#fig:vector-image height=2.5in .white} + +## Tables + +| *Bowling Scores* | Jane | John | Alice | Bob | +|:-----------------|:-------------:|:-------------:|:-------------:|:-------------:| +| Game 1 | 150 | 187 | 210 | 105 | +| Game 2 | 98 | 202 | 197 | 102 | +| Game 3 | 123 | 180 | 238 | 134 | + +Table: A table with a top caption and specified relative column widths. +{#tbl:bowling-scores} + +| | Digits 1-33 | Digits 34-66 | Digits 67-99 | Ref. | +|:--------|:-----------------------------------|:----------------------------------|:----------------------------------|:----------------------------| +| pi | 3.14159265358979323846264338327950 | 288419716939937510582097494459230 | 781640628620899862803482534211706 | [`piday.org`](https://www.piday.org/million/) | +| e | 2.71828182845904523536028747135266 | 249775724709369995957496696762772 | 407663035354759457138217852516642 | [`nasa.gov`](https://apod.nasa.gov/htmltest/gifcity/e.2mil) | + +Table: A table too wide to fit within page. +{#tbl:constant-digits} + +## Equations + +A LaTeX equation: + +$$\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}$$ {#eq:regular-equation} + +An equation too long to fit within page: + +$$x = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r + s + t + u + v + w + x + y + z + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9$$ {#eq:long-equation} + +## Special + + [WARNING]{.semibold} _The following features are only supported and intended for `.html` and `.pdf` exports._ +_Journals are not likely to support them, and they may not display correctly when converted to other formats such as `.docx`._ + +[Link styled as a button](https://manubot.org "Manubot Homepage"){.button} + +Available background colors for text, images, code, banners, etc: + +`white`{.white} +`lightgrey`{.lightgrey} +`grey`{.grey} +`darkgrey`{.darkgrey} +`black`{.black} +`lightred`{.lightred} +`lightyellow`{.lightyellow} +`lightgreen`{.lightgreen} +`lightblue`{.lightblue} +`lightpurple`{.lightpurple} +`red`{.red} +`orange`{.orange} +`yellow`{.yellow} +`green`{.green} +`blue`{.blue} +`purple`{.purple} + +Using the [Font Awesome](https://fontawesome.com/) icon set: + + + + + + +[ + **Light Grey Banner**
+useful for *general information* - [manubot.org](https://manubot.org/) +]{.banner .lightgrey} + +[ + **Blue Banner**
+useful for *important information* - [manubot.org](https://manubot.org/) +]{.banner .lightblue} + +[ + **Light Red Banner**
+useful for *warnings* - [manubot.org](https://manubot.org/) +]{.banner .lightred} diff --git a/content/citation-tags.tsv b/content/citation-tags.tsv index 6de0742..94fd8ee 100644 --- a/content/citation-tags.tsv +++ b/content/citation-tags.tsv @@ -1,2 +1,2 @@ tag citation -deep_review doi:10.1101/142760 +deep-review doi:10.1098/rsif.2017.0387 diff --git a/content/metadata.yaml b/content/metadata.yaml index 31e6adb..553de29 100644 --- a/content/metadata.yaml +++ b/content/metadata.yaml @@ -1,5 +1,5 @@ --- -title: "Manubot Rootstock: Manuscript Title" +title: "Manuscript Title" keywords: - markdown - publishing From b422130eb46ea5d188779910772192730d79b172 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Wed, 13 Mar 2019 17:51:46 -0400 Subject: [PATCH 09/13] CSS: background colors, alignment classes, print control Merges https://github.com/manubot/rootstock/pull/188 Miscellaneous changes to default.html style including background colors, text/page alignment classes, print control styles. Switch margins to 0.75 inches to reduce pages needed to print manuscript. --- build/themes/default.html | 109 ++++++++++++++++++++++++++++---------- 1 file changed, 81 insertions(+), 28 deletions(-) diff --git a/build/themes/default.html b/build/themes/default.html index b65d6fe..a4adf6b 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -27,7 +27,7 @@ position: relative; box-sizing: border-box; max-width: 8.5in; - font-size: 16px; + font-size: 12pt; line-height: 1.5; margin: 20px auto; padding: 40px; @@ -53,20 +53,6 @@ } } - @media only print { - /* "page" element */ - body { - margin: 0; - padding: 0; - font-size: 12px; - } - } - - @page { - /* suggested printing margin */ - margin: 0.5in; - } - /* -------------------------------------------------- */ /* headings */ /* -------------------------------------------------- */ @@ -139,6 +125,33 @@ font-weight: 600; } + /* class for styling elements horizontally left aligned */ + .left { + display: block; + text-align: left; + margin-left: auto; + margin-right: 0; + justify-content: left; + } + + /* class for styling elements horizontally centered */ + .center { + display: block; + text-align: center; + margin-left: auto; + margin-right: auto; + justify-content: center; + } + + /* class for styling elements horizontally right aligned */ + .right { + display: block; + text-align: right; + margin-left: 0; + margin-right: auto; + justify-content: right; + } + /* -------------------------------------------------- */ /* section elements */ /* -------------------------------------------------- */ @@ -310,9 +323,21 @@ /* highlight colors */ /* -------------------------------------------------- */ + .white { + background: #ffffff; + } .lightgrey { background: #eeeeee; } + .grey { + background: #757575; + } + .darkgrey { + background: #424242; + } + .black { + background: #000000; + } .lightred { background: #ffcdd2; } @@ -328,9 +353,6 @@ .lightpurple { background: #f3e5f5; } - .grey { - background: #757575; - } .red { background: #f44336; } @@ -349,6 +371,7 @@ .purple { background: #9c27b0; } + .white, .lightgrey, .lightred, .lightyellow, @@ -357,6 +380,7 @@ .lightpurple, .orange, .yellow, + .white a, .lightgrey a, .lightred a, .lightyellow a, @@ -368,10 +392,15 @@ color: #000000; } .grey, + .darkgrey, + .black, .red, .green, .blue, .purple, + .grey a, + .darkgrey a, + .black a, .red a, .green a, .blue a, @@ -449,39 +478,63 @@ } /* -------------------------------------------------- */ - /* page break control */ + /* print control */ /* -------------------------------------------------- */ @media print { - /* all

headings except the first */ - h2:not(:first-of-type) { - /* force page break */ - break-before: always !important; + @page { + /* suggested printing margin */ + margin: 0.75in; + } + + /* document and "page" elements */ + html, body { + margin: 0; + padding: 0; + width: 100%; + height: 100%; + } + + /* class for centering an element vertically on its own page */ + .page_center { + margin: auto; + width: 100%; + height: 100%; + display: flex; + align-items: center; + vertical-align: middle; + break-before: page; + break-after: page; + } + + /*

heading */ + h2 { + margin-top: 0; } /* always insert a page break before the element */ .page_break_before { - break-before: always !important; + break-before: page; } /* always insert a page break after the element */ .page_break_after { - break-after: always !important; + break-after: page; } /* avoid page break before the element */ .page_break_before_avoid { - break-before: avoid !important; + break-before: avoid; } /* avoid page break after the element */ .page_break_after_avoid { - break-after: avoid !important; + break-after: avoid; } /* avoid page break inside the element */ .page_break_inside_avoid { - break-inside: avoid !important; + break-inside: avoid; } } From 40a6de3fb844e822e0d1da8fc510b6a02f84bccc Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Thu, 14 Mar 2019 17:59:08 -0400 Subject: [PATCH 10/13] HTML plugins: lightbox, tooltips, toc tweaks Merges https://github.com/manubot/rootstock/pull/191 --- build/plugins/accordion.html | 4 +-- build/plugins/jump-to-first.html | 4 +-- build/plugins/lightbox.html | 24 +++++++++---- build/plugins/link-highlight.html | 2 +- build/plugins/table-of-contents.html | 26 ++++++++++---- build/plugins/tooltips.html | 51 ++++++++++++---------------- build/themes/default.html | 18 +++++----- 7 files changed, 75 insertions(+), 54 deletions(-) diff --git a/build/plugins/accordion.html b/build/plugins/accordion.html index c47ae45..48cc018 100644 --- a/build/plugins/accordion.html +++ b/build/plugins/accordion.html @@ -165,8 +165,8 @@ let rect = {}; rect.left = 0; rect.top = 0; - rect.right = window.innerWidth; - rect.bottom = window.innerHeight; + rect.right = document.documentElement.clientWidth; + rect.bottom = document.documentElement.clientHeight; let style = {}; if (element instanceof HTMLElement) { diff --git a/build/plugins/jump-to-first.html b/build/plugins/jump-to-first.html index 487ddae..326a642 100644 --- a/build/plugins/jump-to-first.html +++ b/build/plugins/jump-to-first.html @@ -177,8 +177,8 @@ let rect = {}; rect.left = 0; rect.top = 0; - rect.right = window.innerWidth; - rect.bottom = window.innerHeight; + rect.right = document.documentElement.clientWidth; + rect.bottom = document.documentElement.clientHeight; let style = {}; if (element instanceof HTMLElement) { diff --git a/build/plugins/lightbox.html b/build/plugins/lightbox.html index ec90566..ce1486d 100644 --- a/build/plugins/lightbox.html +++ b/build/plugins/lightbox.html @@ -25,7 +25,7 @@ '1.25, 1.5, 1.75, 2, 2.5, 3, 3.5, 4, 5, 6, 7, 8', // whether to fit image to view ('fit'), display at 100% and shrink // if necessary ('shrink'), or always display at 100% ('100') - defaultZoom: 'shrink', + defaultZoom: 'fit', // whether plugin is on or not enabled: 'true' }; @@ -43,7 +43,7 @@ const imgs = document.querySelectorAll('figure > img'); let count = 1; for (const img of imgs) { - img.classList.add('lightbox_img'); + img.classList.add('lightbox_document_img'); img.dataset.number = count; img.dataset.total = imgs.length; img.addEventListener('click', openLightbox); @@ -148,8 +148,20 @@ zoomInfoBox ) { // create copy of source - const img = document.createElement('img'); - img.src = sourceImg.src; + const img = sourceImg.cloneNode(true); + img.classList.remove('lightbox_document_img'); + img.removeAttribute('id'); + img.removeAttribute('width'); + img.removeAttribute('height'); + img.style.position = 'unset'; + img.style.margin = '0'; + img.style.padding = '0'; + img.style.width = ''; + img.style.height = ''; + img.style.minWidth = ''; + img.style.minHeight = ''; + img.style.maxWidth = ''; + img.style.maxHeight = ''; img.id = 'lightbox_img'; // build sorted list of unique zoomSteps, always including a 100% @@ -485,7 +497,7 @@ // get previous image in document function getPrevImg(img) { - const imgs = document.querySelectorAll('.lightbox_img'); + const imgs = document.querySelectorAll('.lightbox_document_img'); // find index of provided img let index; @@ -505,7 +517,7 @@ // get next image in document function getNextImg(img) { - const imgs = document.querySelectorAll('.lightbox_img'); + const imgs = document.querySelectorAll('.lightbox_document_img'); // find index of provided img let index; diff --git a/build/plugins/link-highlight.html b/build/plugins/link-highlight.html index f9a8469..bc8e6fe 100644 --- a/build/plugins/link-highlight.html +++ b/build/plugins/link-highlight.html @@ -27,7 +27,7 @@ // un-hovering clickUnhighlight: 'false', // whether to also highlight links that are unique - highlightUnique: 'false', + highlightUnique: 'true', // whether plugin is on or not enabled: 'true' }; diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html index d33d6e2..77ba025 100644 --- a/build/plugins/table-of-contents.html +++ b/build/plugins/table-of-contents.html @@ -61,7 +61,9 @@ else closePanel(); - // attach scroll and hash change listeners to window + // attach click, scroll, and hash change listeners to window + window.addEventListener('click', onClick); + window.addEventListener('touchstart', onClick); window.addEventListener('scroll', onScroll); window.addEventListener('hashchange', onScroll); onScroll(); @@ -78,6 +80,11 @@ return window.innerWidth < width + 320; } + // when mouse is clicked anywhere in window + function onClick() { + closePanel(); + } + // when window is scrolled or hash changed function onScroll() { highlightViewed(); @@ -154,7 +161,8 @@ const list = document.createElement('div'); list.id = 'toc_list'; - // attach click listeners to header and button + // attach click listeners + panel.addEventListener('click', onPanelClick); header.addEventListener('click', onHeaderClick); button.addEventListener('click', onButtonClick); @@ -205,10 +213,10 @@ } } - // when link is clicked - function onLinkClick() { - if (isSmallScreen()) - closePanel(); + // when panel is clicked + function onPanelClick(event) { + // stop click from propagating to window/document and closing panel + event.stopPropagation(); } // when header itself is clicked @@ -223,6 +231,12 @@ event.stopPropagation(); } + // when link is clicked + function onLinkClick() { + if (isSmallScreen()) + closePanel(); + } + // open panel if closed, close if opened function togglePanel() { const panel = document.getElementById('toc_panel'); diff --git a/build/plugins/tooltips.html b/build/plugins/tooltips.html index 82390b6..bf95eb1 100644 --- a/build/plugins/tooltips.html +++ b/build/plugins/tooltips.html @@ -23,8 +23,8 @@ // whether user must click off to close tooltip instead of just // un-hovering clickClose: 'false', - // whether to keep tooltip horizontal position when clicking - // prev/next buttons + // whether to keep tooltip horizontal position when moving between + // prev/next occurrences keepHorizontal: 'true', // delay (in ms) between opening and closing tooltip delay: '100', @@ -97,16 +97,7 @@ // when link is focused (tabbed to) function onLinkFocus(event) { - // if focus change happened due to prev/next nav button click, - // pass that info along to openTooltip() - if ( - event && - event.relatedTarget && - event.relatedTarget.matches('#tooltip_nav_bar > .icon_button') - ) - openTooltip(this, true); - else - openTooltip(this); + openTooltip(this); } // when link is touched on touch screen @@ -189,17 +180,12 @@ } // open tooltip - function openTooltip(link, prevNextButtonClick) { + function openTooltip(link) { + // if setting is on and already-open tooltip can be found, store + // original x position of tooltip let prevX; - // if setting is on, tooltip opened because of prev/next buttons, - // and already-open tooltip can be found, store original x - // position of tooltip const prevTooltip = document.getElementById('tooltip'); - if ( - options.keepHorizontal === 'true' && - prevNextButtonClick && - prevTooltip - ) + if (options.keepHorizontal === 'true' && prevTooltip) prevX = getRectInPage(prevTooltip).left; // make tooltip element @@ -219,10 +205,7 @@ // position tooltip const position = function() { - if (prevX) - positionTooltip(link, prevX); - else - positionTooltip(link); + positionTooltip(link, prevX); }; position(); @@ -324,8 +307,18 @@ // when tooltip is unhovered function onTooltipUnhover(event) { - if (options.clickClose !== 'true') - closeTooltip(); + if (options.clickClose === 'true') + return; + + // make sure new mouse/touch/focus no longer over tooltip or any + // element within it + const tooltip = document.getElementById('tooltip'); + if (!tooltip) + return; + if (this.contains(event.relatedTarget)) + return; + + closeTooltip(); } // make nav bar to go betwen prev/next instances of same reference @@ -501,8 +494,8 @@ let rect = {}; rect.left = 0; rect.top = 0; - rect.right = window.innerWidth; - rect.bottom = window.innerHeight; + rect.right = document.documentElement.clientWidth; + rect.bottom = document.documentElement.clientHeight; let style = {}; if (element instanceof HTMLElement) { diff --git a/build/themes/default.html b/build/themes/default.html index a4adf6b..84272f6 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -105,6 +105,7 @@ /* links */ a { color: #2196f3; + word-break: break-all; } /* superscripts and subscripts */ @@ -484,7 +485,7 @@ @media print { @page { /* suggested printing margin */ - margin: 0.75in; + margin: 1in; } /* document and "page" elements */ @@ -710,12 +711,13 @@ position: absolute; width: 50%; min-width: 240px; + max-width: 75%; z-index: 1; } /* tooltip content */ #tooltip_content { - margin: 10px 0; + margin-bottom: 5px; padding: 20px; border-radius: 5px; border: solid 1px #bdbdbd; @@ -729,13 +731,13 @@ #tooltip_content > p, #tooltip_content > figure { margin: 0; + max-height: 320px; + overflow-y: auto; } - /* tooltip copy of figure captions */ - #tooltip_content > figure > figcaption { - margin: 0; - margin-top: 20px; - padding: 0; + /* tooltip copy of */ + #tooltip_content > figure > img { + max-height: 260px; } /* navigation bar */ @@ -982,7 +984,7 @@ @media only screen { /* regular in document when hovered */ - .lightbox_img:hover { + .lightbox_document_img:hover { cursor: pointer; } From 723319f07d44198ee9baad2fff518fe533c03c3a Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 15 Mar 2019 16:53:33 -0400 Subject: [PATCH 11/13] HTML: fix auto setting for TOC plugin, revert margin to 0.75in Merges https://github.com/manubot/rootstock/pull/193 --- build/plugins/table-of-contents.html | 2 +- build/themes/default.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html index 77ba025..4b78a43 100644 --- a/build/plugins/table-of-contents.html +++ b/build/plugins/table-of-contents.html @@ -77,7 +77,7 @@ const page = window.getComputedStyle(document.body); const width = parseInt(page.width) || parseInt(page.maxWidth) || 816; - return window.innerWidth < width + 320; + return width + 320 < window.innerWidth; } // when mouse is clicked anywhere in window diff --git a/build/themes/default.html b/build/themes/default.html index 84272f6..dbbd68f 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -485,7 +485,7 @@ @media print { @page { /* suggested printing margin */ - margin: 1in; + margin: 0.75in; } /* document and "page" elements */ From 4d27314fb32191bd2a23ea1494ebafd70eabb787 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Wed, 20 Mar 2019 14:01:21 -0400 Subject: [PATCH 12/13] images: specify explicit size for icon SVGs Merges https://github.com/manubot/rootstock/pull/195 Sometimes you can see a 'flash' of a very large svg image while the page is loading. This is because the svg has loaded before the css specifying its size has. To fix, specify a reasonable size explicitly in the svg (so it will load at that size by default and then been overridden by whatever size the css tells it to be). --- content/images/github.svg | 4 ++-- content/images/orcid.svg | 4 ++-- content/images/twitter.svg | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/images/github.svg b/content/images/github.svg index 54bbd93..2c77c4c 100644 --- a/content/images/github.svg +++ b/content/images/github.svg @@ -1,4 +1,4 @@ - - + + diff --git a/content/images/orcid.svg b/content/images/orcid.svg index 15d082c..efc939b 100644 --- a/content/images/orcid.svg +++ b/content/images/orcid.svg @@ -1,4 +1,4 @@ - - + + diff --git a/content/images/twitter.svg b/content/images/twitter.svg index 1b590e2..7f676e3 100644 --- a/content/images/twitter.svg +++ b/content/images/twitter.svg @@ -1,4 +1,4 @@ - - + + From fea9eb80af4ca9d5a116f6c28a6b740272e3c0b9 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 22 Mar 2019 11:49:28 -0400 Subject: [PATCH 13/13] webpage TOC plugin: fix open/close option issues Merges https://github.com/manubot/rootstock/pull/194 --- build/plugins/table-of-contents.html | 47 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html index 4b78a43..63e8b45 100644 --- a/build/plugins/table-of-contents.html +++ b/build/plugins/table-of-contents.html @@ -27,10 +27,10 @@ charLimit: '50', // whether or not to show bullets next to each toc item bullets: 'false', - // whether to always start closed ('false'), always start opened - // ('true'), or start open when screen wide enough to fit panel + // whether default behavior is to be closed ('false'), open + // ('true'), or only open when screen wide enough to fit panel // ('auto') - startOpen: 'false', + open: 'false', // whether plugin is on or not enabled: 'true' }; @@ -52,14 +52,7 @@ makeEntries(panel); document.body.insertBefore(panel, document.body.firstChild); - // start panel open/closed based on option - if ( - options.startOpen === 'true' || - (options.startOpen === 'auto' && isSmallScreen()) - ) - openPanel(); - else - closePanel(); + openOrClosePanel(); // attach click, scroll, and hash change listeners to window window.addEventListener('click', onClick); @@ -72,17 +65,33 @@ document.body.classList.add('toc_body_nudge'); } - // determine if on mobile-like device with small screen + // determine if screen wide enough to fit toc panel function isSmallScreen() { - const page = window.getComputedStyle(document.body); - const width = - parseInt(page.width) || parseInt(page.maxWidth) || 816; - return width + 320 < window.innerWidth; + // in default theme: + // 816px = 8.5in = width of "page" () element + // 260px = min width of toc panel (*2 for both sides of ) + return window.innerWidth < 816 + 260 * 2; + } + + // open/close panel based on option and screen size + function openOrClosePanel() { + if ( + options.open === 'true' || + (options.open === 'auto' && !isSmallScreen()) + ) + openPanel(); + else + closePanel(); } // when mouse is clicked anywhere in window function onClick() { - closePanel(); + const panel = document.getElementById('toc_panel'); + if (!panel) + return; + + if (panel.dataset.open === 'true') + openOrClosePanel(); } // when window is scrolled or hash changed @@ -117,6 +126,7 @@ elementsWithIds.push(element); } + // get first or previous element in top half of view for (let i = 0; i < elementsWithIds.length; i++) { const element = elementsWithIds[i]; @@ -233,8 +243,7 @@ // when link is clicked function onLinkClick() { - if (isSmallScreen()) - closePanel(); + openOrClosePanel(); } // open panel if closed, close if opened