The shinytutorials repository is used for creating the static site for the shinyAppTutorials project.
For working on the site, you will need to install a few tools and configure a few things. The following steps will help you get started.
Make sure Node and NPM are installed on your machine. You may also use Yarn. To test the installation or to see if these tools are already installed on your machine, run the following commands in the terminal.
node -v
npm -v
git clone https://github.com/davidruvolo51/shinytutorials
Next, install the npm packages that are required to run the app locally. I have decided to use pnpm to manage packages on my machine and across projects. To install pnpm
, run the following command.
npm install -g pnpm
Once install, install the dependencies locally.
pnpm install
If you prefer to use npm
, use the following.
npm install
When everything is installed, run the following command. This will start the site at locahost:8000
.
yarn dev
Note: If you are using npm
instead of yarn
, run npm dev
.
All tutorials are stored here: src/pages/tutorials
. Create a new folder in tutorials
and give it a name that resembles the tutorial you want to write. For example, data-editor
, rmarkdown-shiny
, using-x-in-shiny
, and so on. Make sure the name of new folders is lowercased and any space should be replaced with a dash (-
).
shinytutorials /
-src /
- pages /
- tutorials /
- my-tutorial /
In the new folder, create a markdown file. This must be named index.md
. If your post has images, stored them in the same folder as the markdown file, and then define the image tag as normal (
)
shinytutorials /
- src /
- pages /
- tutorials /
- my-tutorial /
index.md
my-image.png
Note: this site does not support gifs or movie files at this point.
To make things simple, I've created added the new post template as a vscode snippet (see .vscode/markdown.code-snippets
). If you are using vscode (recommended), the snippet will be automatically available when you open the vscode workspace. Open the index.md
file. In the command palette, type Snippet
, hit enter, and then type blog
.
The blog post template will also produce the required YAML markup for a new post.
---
title: ""
subtitle: ""
abstract: ""
date: ""
updated: ""
keywords:
---
title
: a name for the post (similar to the name of the folder)subtitle
: One sentence that describes the tutorialabstract
: a three sentance description about the tutorialdate
: the date the tutorial was publishedupdated
: the date the tutorial was updated (if it is a new post, make sure you write the same date as the publication date)keywords
: tags for the post in js array formatkeywords: ["some", "word"]
(enter 3 max)
This section is still in progress. It will change as I integrate GitHub Actions. For now, run the following steps.
- Cleanup: run
yarn clean
- Build the site: run
yarn build
- Prep for GitHub: run
yarn prep
- Commit changes and push to the dev branch.
- You can view the dev deployment at: https://modest-kowalevski-1a643c.netlify.app
- Open a pull request
Anyone is welcome to contribute to the site: edits, new posts, etc. Feel free to get in touch with me if you are interested. Use the dev
branch to build the site and then open a pull request.
Please see the shinyAppTutorials repository for ideas and open issues as this repo is mainly for the development of the site.