Skip to content

Commit

Permalink
Rootstock 2021 05 19 (#2)
Browse files Browse the repository at this point in the history
* Webpage: refactor plugins & add scite plugin

merges manubot/rootstock#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 <script> tag into module to keep scope local
  and avoid function name conflicts. this reduces the indent of the whole script by one level.
* moves plugin specific CSS to plugins themselves
* adds scite plugin (uncomment to enable)

* Update scite plugin

merges manubot/rootstock#415

* setup.bash: interactive script to guide setup

merges manubot/rootstock#417
closes manubot/rootstock#401

* Add "gh repo create" to SETUP.md

merges manubot/rootstock#419
closes manubot/rootstock#418

Co-authored-by: Daniel Himmelstein <[email protected]>
Co-authored-by: Anthony Gitter <[email protected]>

* fix link

Co-authored-by: Vincent Rubinetti <[email protected]>
Co-authored-by: nfry321 <[email protected]>
Co-authored-by: Tiago Lubiana <[email protected]>
Co-authored-by: Daniel Himmelstein <[email protected]>
Co-authored-by: Anthony Gitter <[email protected]>
  • Loading branch information
6 people authored May 19, 2021
1 parent a2d493d commit 318a508
Show file tree
Hide file tree
Showing 21 changed files with 3,474 additions and 3,905 deletions.
33 changes: 30 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Table of contents

- [Creating a new manuscript](#creating-a-new-manuscript)
* [Configuration](#configuration)
* [Using setup script](#using-setup-script)
* [Manual configuration](#manual-configuration)
* [Create repository](#create-repository)
* [Continuous integration](#continuous-integration)
+ [GitHub Actions](#github-actions)
Expand All @@ -27,8 +28,33 @@ These steps should be performed in a command-line shell (terminal), starting in
Setup is supported on Linux, macOS, and Windows.
Windows setup requires [Git Bash](https://gitforwindows.org/) or [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/faq).

## Configuration
## Using setup script
Creating a new manuscript using GitHub actions, the recommended default CI service (see below), can be achieved easily using the [setup script](https://github.com/manubot/rootstock/blob/main/setup.bash).
This simply runs the steps detailed below in the manual configuration.

Use the command below to copy `setup.bash` and run it.
You can check the code that will be executed [here](https://github.com/manubot/rootstock/blob/main/setup.bash).

````sh
bash <( curl --location https://github.com/manubot/rootstock/raw/main/setup.bash )
````
The script will then take you through the process of cloning the rootstock repo, make the changes required to use GitHub actions, edit the README to point to your repo and commit the changes.
Your new manuscript repo is then ready for you to start adding your own content.

This script does not not create the remote repo for you, so you will be prompted to manually create an empty GitHub repository at <https://github.com/new>.
Do not initialize the repository, other than optionally adding a description.

### CLI
There is also a command line interface for users who want to create manuscripts at scale and in an automated way.
See the help for details.

````sh
bash setup.bash --help
````

## Manual configuration

If you do not wish to use the above setup script to configure your new manuscript repository, you can instead execute the steps manually.
First, you must configure two environment variables (`OWNER` and `REPO`).
These variables specify the GitHub repository for the manuscript (i.e. `https://github.com/OWNER/REPO`).
Make sure that the case of `OWNER` matches how your username is displayed on GitHub.
Expand Down Expand Up @@ -63,7 +89,8 @@ git remote set-url origin https://github.com/$OWNER/$REPO.git
git remote set-url origin [email protected]:$OWNER/$REPO.git
```

Next, you must manually create an empty GitHub repository at <https://github.com/new>.
Then create an empty repository on GitHub.
You can do this at <https://github.com/new> or via the [GitHub command line interface](https://github.com/cli/cli) (if installed) with `gh repo create`.
Make sure to use the same "Owner" and "Repository name" specified above.
Do not initialize the repository, other than optionally adding a Description.
Next, push your cloned manuscript:
Expand Down
24 changes: 15 additions & 9 deletions build/pandoc/defaults/html.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
to: html5
output-file: output/manuscript.html
# include-before-body:
# - build/plugins/d3.html
### third-party plugins
#- build/plugins/d3.html
include-after-body:
### theme
- build/themes/default.html
# - build/plugins/inline-svg.html
- build/plugins/anchors.html
### first-party plugins
- build/plugins/core.html # needed for all first-party plugins
- build/plugins/accordion.html
- build/plugins/tooltips.html
- build/plugins/anchors.html
- build/plugins/attributes.html
#- build/plugins/inline-svg.html
- build/plugins/jump-to-first.html
- build/plugins/lightbox.html
- build/plugins/link-highlight.html
- build/plugins/table-of-contents.html
- build/plugins/lightbox.html
- build/plugins/attributes.html
- build/plugins/math.html
- build/plugins/hypothesis.html
- build/plugins/tooltips.html
### third-party plugins
- build/plugins/analytics.html
- build/plugins/hypothesis.html
- build/plugins/mathjax.html
#- build/plugins/scite.html
variables:
math: ''
math: ""
html-math-method:
method: mathjax
Loading

0 comments on commit 318a508

Please sign in to comment.