remove R code from html yml #250
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build html version of the ss3 user manual | |
on: | |
push: | |
paths: | |
- '**.tex' | |
- 'html_usermanual_snippets.html' | |
- '**.yml' | |
pull_request: | |
paths: | |
- '**.tex' | |
- 'html_usermanual_snippets.html' | |
- '**.yml' | |
workflow_call: | |
inputs: | |
ref: | |
default: ${{ github.ref }} | |
required: false | |
type: string | |
jobs: | |
build-html: | |
runs-on: ubuntu-20.04 | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref }} | |
- name: Update Ubuntu packages | |
run: sudo apt-get update | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'release' | |
- name: setup pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: '2.14.0.3' | |
- name: Convert tex to html | |
run: pandoc SS330_User_Manual.tex -s -o SS330_User_Manual.html --toc --self-contained --mathjax --default-image-extension=png --number-sections --citeproc --variable linkcolor=#0033CC | |
# Note: for the following R code, may be a single command to deal with the double header issue before rendering. | |
# Create user_manual_name.txt to user for the name of the html file | |
# (will not have release here but will for the release.yml) | |
- name: Create user_manual_name.txt | |
run: | | |
name_txt <- file("user_manual_name.txt") | |
writeLines("SS330_User_Manual.html", name_txt) | |
close(name_txt) | |
shell: Rscript {0} | |
- name: Run R script to create html | |
run: | | |
source("Rcode/edit_html_improve_formatting.R") | |
shell: Rscript {0} | |
- name: upload html file as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: SS330_User_Manual.html | |
path: SS330_User_Manual.html |