Documentation for the Grain programming language at grain-lang.org.
This documentation site is a Hexo site. All of the docs are generated from Markdown files, and Hexo builds a static website that is hosted on Netlify.
Since this repo contains a git submodule, it's easiest to clone while including submodules:
git clone [email protected]:grain-lang/grain-lang.org.git --recurse-submodules
If you've already cloned the repo without the submodules, you can pull them like so:
git pull --recurse-submodules
To make a change to a document, edit the corresponding Markdown file in src. The file path matches the URL path after /docs
, but if you have trouble finding the page you're looking for, you can click the "Edit on GitHub" button at the top of page on the website.
Create your new Markdown file in src
. You'll also need to update docs_config.yml to include your new page in the sidebar. Each document starts with some front-matter, which is a bit of yml/json that is given to the renderer. For now, this only includes the title of the page. Since the title of the page is an h1
, headers in your document should begin at level 2:
---
title: Some Title of Some Topic
---
## Content Begins Here
Once a PR is created, Netlify will create a preview site and comment on the PR with a link. If you'd like to view your changes locally,
For the docs, run:
npm install
npm run start-docs
For the blog, run:
npm install
npm run start-blog
This will install all build dependencies and serve the website on port 3000.