From 690aac113b4ee7dbb32a0af10a3d36c51a207025 Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Thu, 10 Dec 2020 19:39:31 -0500 Subject: [PATCH 01/29] Switch default branch from master to main merges https://github.com/manubot/rootstock/pull/399 closes https://github.com/manubot/rootstock/issues/349 Co-authored-by: Anthony Gitter --- .appveyor.yml | 3 ++- .github/workflows/manubot.yaml | 20 +++++++++++++------- .travis.yml | 2 ++ README.md | 4 ++-- SETUP.md | 24 ++++++++++++++++++++---- USAGE.md | 2 +- build/environment.yml | 2 +- ci/README.md | 2 +- ci/deploy.sh | 3 ++- content/02.delete-me.md | 2 +- output/README.md | 4 ++-- webpage/README.md | 2 +- 12 files changed, 48 insertions(+), 22 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d57e0cb8..69d6e6c6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -8,10 +8,11 @@ skip_branch_with_pr: true # to only build commits from pull requests branches: only: + - main - master # Only run AppVeyor on commits that modify at least one of the following files -# Delete these lines to run AppVeyor on all master branch commits +# Delete these lines to run AppVeyor on all main/master branch commits only_commits: files: - .appveyor.yml diff --git a/.github/workflows/manubot.yaml b/.github/workflows/manubot.yaml index 9a2b89b2..9a7d5766 100644 --- a/.github/workflows/manubot.yaml +++ b/.github/workflows/manubot.yaml @@ -2,9 +2,11 @@ name: Manubot on: push: branches: + - main - master pull_request: branches: + - main - master jobs: manubot: @@ -14,23 +16,27 @@ jobs: GITHUB_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }} SPELLCHECK: true steps: - - name: Set Environment Variables - run: | - TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA} - echo "TRIGGERING_SHA_7=${TRIGGERING_SHA::7}" >> $GITHUB_ENV - echo "TRIGGERING_SHA: $TRIGGERING_SHA" - name: Checkout Repository uses: actions/checkout@v2 with: # fetch entire commit history to support get_rootstock_commit fetch-depth: 0 + - name: Set Environment Variables + run: | + TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA} + echo "TRIGGERING_SHA_7=${TRIGGERING_SHA::7}" >> $GITHUB_ENV + echo "TRIGGERING_SHA: $TRIGGERING_SHA" + DEFAULT_BRANCH=$(git remote show origin | grep --perl-regexp --only-matching "(?<=HEAD branch: ).+") + echo "DEFAULT_BRANCH=${DEFAULT_BRANCH}" >> $GITHUB_ENV + echo "DEFAULT_BRANCH_REF=refs/heads/$DEFAULT_BRANCH" >> $GITHUB_ENV + echo "DEFAULT_BRANCH=$DEFAULT_BRANCH" - name: Cache uses: actions/cache@v1 with: path: ci/cache key: ci-cache-${{ github.ref }} restore-keys: | - ci-cache-refs/heads/master + ci-cache-${{ env.DEFAULT_BRANCH_REF }} - name: Install Environment uses: conda-incubator/setup-miniconda@v2 with: @@ -53,7 +59,7 @@ jobs: name: manuscript-${{ github.run_id }}-${{ env.TRIGGERING_SHA_7 }} path: output - name: Deploy Manuscript - if: github.ref == 'refs/heads/master' && github.event_name == 'push' && !github.event.repository.fork + if: github.ref == env.DEFAULT_BRANCH_REF && github.event_name == 'push' && !github.event.repository.fork env: MANUBOT_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} MANUBOT_SSH_PRIVATE_KEY: ${{ secrets.MANUBOT_SSH_PRIVATE_KEY }} diff --git a/.travis.yml b/.travis.yml index a8421383..cf4cbb61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ services: - docker branches: only: + - main - master env: - SPELLCHECK=true @@ -20,5 +21,6 @@ deploy: script: bash ci/deploy.sh skip_cleanup: true on: + # branch kept as master since travis deployment is legacy. branch: master condition: $TRAVIS_EVENT_TYPE = "push" && (-v MANUBOT_SSH_PRIVATE_KEY || "${!encrypted_*}" != "") diff --git a/README.md b/README.md index d806e795..51fca30f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![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) [![GitHub Actions Status](https://github.com/manubot/rootstock/workflows/Manubot/badge.svg)](https://github.com/manubot/rootstock/actions) -[![Travis Build Status](https://travis-ci.com/manubot/rootstock.svg?branch=master)](https://travis-ci.com/manubot/rootstock) +[![Travis Build Status](https://travis-ci.com/manubot/rootstock.svg?branch=main)](https://travis-ci.com/manubot/rootstock) ## Manuscript description @@ -79,7 +79,7 @@ Whenever a pull request is opened, CI (continuous integration) will test whether The build process aims to detect common errors, such as invalid citations. If your pull request build fails, see the 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), 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. +When a commit to the `main` branch occurs (for example, when a pull request is merged), 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://manubot.github.io/rootstock/ diff --git a/SETUP.md b/SETUP.md index 136376c1..fa83e0b2 100644 --- a/SETUP.md +++ b/SETUP.md @@ -13,6 +13,7 @@ * [README updates](#readme-updates) * [Finalize](#finalize) - [Merging upstream rootstock changes](#merging-upstream-rootstock-changes) + * [Default branch](#default-branch) _generated with [markdown-toc](https://ecotrust-canada.github.io/markdown-toc/)_ @@ -68,7 +69,7 @@ Do not initialize the repository, other than optionally adding a Description. Next, push your cloned manuscript: ```sh -git push --set-upstream origin master +git push --set-upstream origin main ``` ## Continuous integration @@ -263,7 +264,7 @@ If the changes look okay, commit and push: ```shell git add --update git commit --message "Brand repo to $OWNER/$REPO" -git push origin master +git push origin main ``` You should be good to go now. @@ -290,7 +291,7 @@ Second, pull the new commits from rootstock, but do not automerge: git config remote.rootstock.url || git remote add rootstock https://github.com/manubot/rootstock.git # pull the new commits from rootstock -git pull --no-ff --no-rebase --no-commit rootstock master +git pull --no-ff --no-rebase --no-commit rootstock main ``` If all goes well, there won't be any conflicts. @@ -302,7 +303,7 @@ You may notice changes that affect how items in `content` are processed. If so, you should edit and stage `content` files as needed. When there are no longer any unstaged changes, then do `git commit`. -If updating `master` via a pull request, proceed to push the commit to GitHub and open a pull request. +If updating your default branch (i.e. `main` or `master`) via a pull request, proceed to push the commit to GitHub and open a pull request. Once the pull request is ready to merge, use GitHub's "Create a merge commit" option rather than "Squash and merge" or "Rebase and merge" to preserve the rootstock commit hashes. The environment for local builds does not automatically update when [`build/environment.yml`](build/environment.yml) changes. @@ -312,3 +313,18 @@ To update your local conda `manubot` environment with new changes, run: # update a local conda environment conda env update --file build/environment.yml ``` + +## Default branch + +On 2020-10-01, GitHub [changed](https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main/) the default branch name for new repositories from `master` to `main`. +More information on GitHub's migration is available at [github/renaming](https://github.com/github/renaming). + +On 2020-12-10, Manubot [updated](https://github.com/manubot/rootstock/pull/399) the Rootstock default branch to `main`. +For existing manuscripts, the default branch will remain `master`, +unless manually switched to `main`. +Rootstock has been configured to run continuous integration on both `main` and `master`, +so existing manuscripts can, but are not required, to switch their default branch to `main`. + +Upgrading to the latest Rootstock will change several READMEs links to `main`. +For manuscripts that do not plan to switch their default branch, +do not include these changes in the upgrade merge commit. diff --git a/USAGE.md b/USAGE.md index 43230773..a7e446b9 100644 --- a/USAGE.md +++ b/USAGE.md @@ -13,7 +13,7 @@ For basic formatting, check out the [CommonMark Help](https://commonmark.org/hel In addition, Manubot supports an extended version of markdown, tailored for scholarly writing, which includes [Pandoc's Markdown](https://pandoc.org/MANUAL.html#pandocs-markdown) and the extensions discussed below. The `content/02.delete-me.md` file in the Rootstock repository shows many of the elements and formatting options supported by Manubot. -See the [raw markdown](https://gitlab.com/manubot/rootstock/blob/master/content/02.delete-me.md#L) in this file and compare it to the [rendered manuscript](https://manubot.github.io/rootstock/). +See the [raw markdown](https://gitlab.com/manubot/rootstock/blob/main/content/02.delete-me.md#L) in this file and compare it to the [rendered manuscript](https://manubot.github.io/rootstock/). Within a paragraph in markdown, single newlines are interpreted as whitespace (same as a space). A paragraph's source does not need to contain newlines. diff --git a/build/environment.yml b/build/environment.yml index df0319e8..f81dfc80 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -21,7 +21,7 @@ dependencies: - yamllint=1.25.0 - pip: - errorhandler==2.0.1 - - git+https://github.com/manubot/manubot@7c03b4a7d42506b3241e58cd5643a028443b9b9d + - git+https://github.com/manubot/manubot@55c5e1e526261ebadd2aefed2c2757792d8d2ebf - isbnlib==3.10.3 - opentimestamps-client==0.7.0 - opentimestamps==0.4.1 diff --git a/ci/README.md b/ci/README.md index db6ccca3..3e89fc2b 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,7 +1,7 @@ # Continuous integration tools This directory contains tools and files for continuous integration (CI). -Specifically, [`deploy.sh`](deploy.sh) runs on successful `master` branch builds that are not pull requests. +Specifically, [`deploy.sh`](deploy.sh) runs on successful `main` branch builds that are not pull requests. The contents of `../webpage` are committed to the `gh-pages` branch. The contents of `../output` are committed to the `output` branch. diff --git a/ci/deploy.sh b/ci/deploy.sh index ed3d8a89..3c6d44db 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -12,7 +12,8 @@ REPO_SLUG=${TRAVIS_REPO_SLUG:-$GITHUB_REPOSITORY} COMMIT=${TRAVIS_COMMIT:-$GITHUB_SHA} CI_BUILD_WEB_URL=${CI_BUILD_WEB_URL:-$TRAVIS_BUILD_WEB_URL} CI_JOB_WEB_URL=${CI_JOB_WEB_URL:-$TRAVIS_JOB_WEB_URL} -BRANCH=${TRAVIS_BRANCH:-master} +BRANCH=${TRAVIS_BRANCH:-$DEFAULT_BRANCH} +BRANCH=${BRANCH:-main} # Add commit hash to the README OWNER_NAME="$(dirname "$REPO_SLUG")" diff --git a/content/02.delete-me.md b/content/02.delete-me.md index 78d9c7ed..c2b1fd0c 100644 --- a/content/02.delete-me.md +++ b/content/02.delete-me.md @@ -186,7 +186,7 @@ Loaded from a specific (hashed) version of the image on GitHub. **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} +](https://raw.githubusercontent.com/manubot/resources/main/test/vector.svg?sanitize=true "Vector image"){#fig:vector-image height=2.5in .white} ## Tables diff --git a/output/README.md b/output/README.md index fbdc3a6d..12d8f517 100644 --- a/output/README.md +++ b/output/README.md @@ -1,8 +1,8 @@ # Generated citation / reference files The `output` branch contains files automatically generated by the manuscript build process. -It consists of the contents of the `output` directory of the `master` branch. -These files are not tracked in `master`, but instead written to the `output` branch by continuous integration builds. +It consists of the contents of the `output` directory of the `main` branch. +These files are not tracked in `main`, but instead written to the `output` branch by continuous integration builds. ## Files diff --git a/webpage/README.md b/webpage/README.md index 9e22c56d..739f4977 100644 --- a/webpage/README.md +++ b/webpage/README.md @@ -6,7 +6,7 @@ To redirect to the permalink for the latest manuscript version at anytime, use t ## Files -This directory contains the following files, which are mostly ignored on the `master` branch: +This directory contains the following files, which are mostly ignored on the `main` branch: + [`index.html`](index.html) is an HTML manuscript. + [`manuscript.pdf`](manuscript.pdf) is a PDF manuscript. From 2191d929a12a233347ee79c673b8f2971c10e6dd Mon Sep 17 00:00:00 2001 From: Daniel Himmelstein Date: Sun, 27 Dec 2020 18:12:42 -0500 Subject: [PATCH 02/29] enable citekey prefix inference merges https://github.com/manubot/rootstock/pull/404 refs https://github.com/manubot/manubot/issues/123 --- USAGE.md | 15 ++++++++++++++- build/environment.yml | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/USAGE.md b/USAGE.md index a7e446b9..5bd004a1 100644 --- a/USAGE.md +++ b/USAGE.md @@ -110,6 +110,19 @@ When choosing which source to use for a citation, we recommend the following ord 9. For references that do not have any of the above persistent identifiers, the citation key does not need to include a prefix. Citing `@old-manuscript` will work, but only if reference metadata is [provided manually](#reference-metadata). +Manubot is able to infer certain prefixes, +such some citations can be formatted like `@accession` (without a prefix). +Examples includes DOIs like `@10.15363/thinklab.4` or `@10/993`, +PMC / PubMed identifiers like `@PMC4497619` or `@26158728`, +arXiv identifier like `@1508.06576v2`, +and Wikidata identifiers like `@Q50051684`. +To disable citekey prefix inference, add the following to `metadata.yaml`: + +```yaml +pandoc: + manubot-infer-citekey-prefixes: false +``` + Cite multiple items at once like: ```md @@ -136,7 +149,7 @@ By default, `pandoc-manubot-cite` does not fail upon invalid citations, although ```yaml pandoc: - manubot-fail-on-errors: True + manubot-fail-on-errors: true ``` #### Citation aliases diff --git a/build/environment.yml b/build/environment.yml index f81dfc80..abee7fb1 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -21,7 +21,7 @@ dependencies: - yamllint=1.25.0 - pip: - errorhandler==2.0.1 - - git+https://github.com/manubot/manubot@55c5e1e526261ebadd2aefed2c2757792d8d2ebf + - git+https://github.com/manubot/manubot@553090a16ac24a9fdc3f8df241a91b790c140865 - isbnlib==3.10.3 - opentimestamps-client==0.7.0 - opentimestamps==0.4.1 From 87c11957cf69b73ebed5518f7928b99adb1dc5d6 Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 5 Feb 2021 12:43:51 -0500 Subject: [PATCH 03/29] 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 0e641a12..cbab5326 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 4f2e6ba3..68f1225b 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 b968198c..70097829 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 00000000..4c680a4d --- /dev/null +++ b/build/plugins/core.html @@ -0,0 +1,129 @@ + + + diff --git a/build/plugins/d3.html b/build/plugins/d3.html index 48c16d80..d04226e2 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 7bd1691e..1986d365 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 be402422..619a3a18 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 e8a8088f..d2050933 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 6b9f2ae6..1fbdf771 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 4462f509..04263a83 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 f47b24d5..00000000 --- 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 00000000..14ba331f --- /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 00000000..d01fe51a --- /dev/null +++ b/build/plugins/scite.html @@ -0,0 +1,61 @@ + + + + + + + + diff --git a/build/plugins/table-of-contents.html b/build/plugins/table-of-contents.html index e4159457..ea24c97e 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 f9cbc60e..b6fc5057 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 4022f31a..2396cc4d 100644 --- a/build/themes/default.html +++ b/build/themes/default.html @@ -1,60 +1,525 @@ From 52ab9dc8bba4d0c6cee348fa9d7b0b764a89ffcf Mon Sep 17 00:00:00 2001 From: Vincent Rubinetti Date: Fri, 12 Feb 2021 10:49:07 -0500 Subject: [PATCH 04/29] Update scite plugin merges https://github.com/manubot/rootstock/pull/415 --- build/plugins/scite.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build/plugins/scite.html b/build/plugins/scite.html index d01fe51a..4d62049b 100644 --- a/build/plugins/scite.html +++ b/build/plugins/scite.html @@ -5,11 +5,6 @@ See https://scite.ai/. --> - diff --git a/build/plugins/hypothesis.html b/build/plugins/hypothesis.html index 1986d365..3cd5e108 100644 --- a/build/plugins/hypothesis.html +++ b/build/plugins/hypothesis.html @@ -4,7 +4,7 @@ Allows public annotation of the manuscript. See https://web.hypothes.is/. --> - -