diff --git a/.github/workflows/manubot.yaml b/.github/workflows/manubot.yaml index 42509c5..9a2b89b 100644 --- a/.github/workflows/manubot.yaml +++ b/.github/workflows/manubot.yaml @@ -17,8 +17,7 @@ jobs: - name: Set Environment Variables run: | TRIGGERING_SHA=${GITHUB_PULL_REQUEST_SHA:-$GITHUB_SHA} - TRIGGERING_SHA_7=${TRIGGERING_SHA::7} - echo "::set-env name=TRIGGERING_SHA_7::$TRIGGERING_SHA_7" + echo "TRIGGERING_SHA_7=${TRIGGERING_SHA::7}" >> $GITHUB_ENV echo "TRIGGERING_SHA: $TRIGGERING_SHA" - name: Checkout Repository uses: actions/checkout@v2 @@ -33,7 +32,7 @@ jobs: restore-keys: | ci-cache-refs/heads/master - name: Install Environment - uses: goanpeca/setup-miniconda@v1 + uses: conda-incubator/setup-miniconda@v2 with: activate-environment: manubot environment-file: build/environment.yml diff --git a/SETUP.md b/SETUP.md index 2faa250..136376c 100644 --- a/SETUP.md +++ b/SETUP.md @@ -35,7 +35,7 @@ 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 manubot) +# GitHub username or organization name (change from manubot) OWNER=manubot # Repository name (change from rootstock) REPO=rootstock @@ -115,7 +115,7 @@ git rm .appveyor.yml git rm ci/install.sh ``` -GitHub Actions is _usually_ able to deploy without any setup using the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) for authentication. +GitHub Actions is _usually_ able to deploy without any additional setup using the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) for authentication. GitHub Pages deployment using `GITHUB_TOKEN` recently started working on GitHub without an official announcement. If it does not work for you after completing this setup, try reselecting "gh-pages branch" as the Source for GitHub Pages in the repository Settings. GitHub Pages should now trigger on the next commit. diff --git a/USAGE.md b/USAGE.md index 06b7eaf..4323077 100644 --- a/USAGE.md +++ b/USAGE.md @@ -43,9 +43,11 @@ For easy creation of markdown tables, check out the [Tables Generator](https://w Figures can be included with the following markdown: ```md + ![Caption for the example figure.](url_or_path_to_figure){#fig:example-id} ``` +The blank line before the figure is required. Support for figure numbering and citation is provided by [`pandoc-fignos`](https://github.com/tomduck/pandoc-fignos). This figure can be cited in the text using `@fig:example-id`. In context, a figure citation may look like: `Figure {@fig:example-id}B shows …`. diff --git a/build/README.md b/build/README.md index 27bf76d..f6087cf 100644 --- a/build/README.md +++ b/build/README.md @@ -20,30 +20,32 @@ To change the options, either edit the YAML files directly or add additional `-- Note: currently, **Windows is not supported**. -Install the [conda](https://conda.io) environment specified in [`environment.yml`](environment.yml) by running the following commands from this directory: +Install the [conda](https://conda.io) environment specified in [`environment.yml`](environment.yml) by running the following commands +(from the repository's root directory): ```sh # Install the environment -conda env create --file environment.yml +conda env create --file build/environment.yml ``` If the `manubot` environment is already installed, but needs to be updated to reflect changes to `environment.yml`, use one of the following options: ```shell # option 1: update the existing environment. -conda env update --file environment.yml +conda env update --file build/environment.yml # option 2: remove and reinstall the manubot environment. # Slower than option 1, but guarantees a fresh environment. conda env remove --name manubot -conda env create --file environment.yml +conda env create --file build/environment.yml ``` Activate with `conda activate manubot` (assumes `conda` version of [at least](https://github.com/conda/conda/blob/9d759d8edeb86569c25f6eb82053f09581013a2a/CHANGELOG.md#440-2017-12-20) 4.4). The environment should successfully install on both Linux and macOS. However, it will fail on Windows due to the [`pango`](https://anaconda.org/conda-forge/pango) dependency. -Because the build process is dependent on having the appropriate version of the `manubot` Python package, it is necessary to use the version specified in `environment.yml`. +Because the build process is dependent on having the appropriate version of the `manubot` Python package, +it is necessary to use the version specified in `environment.yml`. The latest `manubot` release on PyPI may not be compatible with the latest version of this rootstock repository. ## Building PDFs diff --git a/build/build.sh b/build/build.sh index 155aa7c..5af4028 100755 --- a/build/build.sh +++ b/build/build.sh @@ -35,12 +35,12 @@ pandoc --verbose \ --defaults=common.yaml \ --defaults=html.yaml -# Return null if docker command is missing, otherwise return path to docker -DOCKER_EXISTS="$(command -v docker || true)" +# Set DOCKER_RUNNING to a non-empty string if docker is running, otherwise null. +DOCKER_RUNNING="$(docker info &> /dev/null && echo "yes" || true)" # Create PDF output (unless BUILD_PDF environment variable equals "false") # If Docker is not available, use WeasyPrint to create PDF -if [ "${BUILD_PDF:-}" != "false" ] && [ -z "$DOCKER_EXISTS" ]; then +if [ "${BUILD_PDF:-}" != "false" ] && [ -z "$DOCKER_RUNNING" ]; then echo >&2 "Exporting PDF manuscript using WeasyPrint" if [ -L images ]; then rm images; fi # if images is a symlink, remove it ln -s content/images @@ -53,7 +53,7 @@ if [ "${BUILD_PDF:-}" != "false" ] && [ -z "$DOCKER_EXISTS" ]; then fi # If Docker is available, use athenapdf to create PDF -if [ "${BUILD_PDF:-}" != "false" ] && [ -n "$DOCKER_EXISTS" ]; then +if [ "${BUILD_PDF:-}" != "false" ] && [ -n "$DOCKER_RUNNING" ]; then echo >&2 "Exporting PDF manuscript using Docker + Athena" if [ "${CI:-}" = "true" ]; then # Incease --delay for CI builds to ensure the webpage fully renders, even when the CI server is under high load. diff --git a/build/environment.yml b/build/environment.yml index b156d6c..df0319e 100644 --- a/build/environment.yml +++ b/build/environment.yml @@ -9,23 +9,26 @@ dependencies: - jinja2=2.11.2 - jsonschema=3.2.0 - pandoc=2.9.2 + - panflute=1.12.5 - pango=1.40.14 - - pip=20.0 - - psutil=5.7.0 - - python=3.7.6 + - pip=20.2 + - psutil=5.7.3 + - python=3.7.8 - pyyaml=5.3 - - requests=2.23.0 - - watchdog=0.10.2 - - yamllint=1.21.0 + - requests=2.24.0 + - toml=0.10.2 + - watchdog=0.10.3 + - yamllint=1.25.0 - pip: - errorhandler==2.0.1 - - git+https://github.com/manubot/manubot@31968197d1ccd96a46bf092cdba4b575764bb954 + - git+https://github.com/manubot/manubot@7c03b4a7d42506b3241e58cd5643a028443b9b9d + - isbnlib==3.10.3 - opentimestamps-client==0.7.0 - opentimestamps==0.4.1 - - pandoc-eqnos==2.1.1 - - pandoc-fignos==2.2.0 - - pandoc-tablenos==2.1.1 - - pandoc-xnos==2.2.0 + - pandoc-eqnos==2.3.0 + - pandoc-fignos==2.3.1 + - pandoc-tablenos==2.2.2 + - pandoc-xnos==2.4.3 - pybase62==0.4.3 - pysha3==1.0.2 - python-bitcoinlib==0.10.2 diff --git a/build/pandoc/defaults/html.yaml b/build/pandoc/defaults/html.yaml index be2a423..956bbbc 100644 --- a/build/pandoc/defaults/html.yaml +++ b/build/pandoc/defaults/html.yaml @@ -2,8 +2,11 @@ # Load on top of common defaults. to: html5 output-file: output/manuscript.html +# include-before-body: +# - build/plugins/d3.html include-after-body: - build/themes/default.html +# - build/plugins/inline-svg.html - build/plugins/anchors.html - build/plugins/accordion.html - build/plugins/tooltips.html diff --git a/build/plugins/d3.html b/build/plugins/d3.html new file mode 100644 index 0000000..48c16d8 --- /dev/null +++ b/build/plugins/d3.html @@ -0,0 +1,16 @@ + + + diff --git a/build/plugins/inline-svg.html b/build/plugins/inline-svg.html new file mode 100644 index 0000000..be40242 --- /dev/null +++ b/build/plugins/inline-svg.html @@ -0,0 +1,62 @@ + + + diff --git a/build/plugins/math.html b/build/plugins/math.html index d7bc6ed..f47b24d 100644 --- a/build/plugins/math.html +++ b/build/plugins/math.html @@ -1,4 +1,4 @@ - + - + -