Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Slate-based "Inertia Usage" documentation and build scripts * add `docs` and `run-docs` targets to Makefile * update `make clean` to remove docs_build * remove now redundant parts from README (since a lot of content is in the usage guide now) * add 'why use inertia' to README * add CNAME to point `inertia.ubclaunchpad.com` to GH-pages in `/docs` * add documentation issue template * add section on building documentation in CONTRIBUTING.md
- Loading branch information
Showing
30 changed files
with
2,213 additions
and
98 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
*.png binary | ||
*.jpg binary | ||
*.pdf binary | ||
|
||
# Mark docs as generated | ||
docs/* linguist-generated |
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: Documentation issue | ||
about: Let us know if something is wrong with our documentation! | ||
title: 'docs: ' | ||
labels: 'type: docs :book:' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the issue** | ||
A clear and concise description of what the issue is. | ||
|
||
**Additional context** | ||
Add any other context about the problem here, such as screenshots and links to | ||
relevant documentation. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,6 @@ public/ | |
|
||
# JetBrains | ||
.idea | ||
|
||
# Doc build | ||
docs_build |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#! /bin/bash | ||
|
||
set -e | ||
|
||
### | ||
# This script is a wonderful hack I made to get around the fact that Slate | ||
# (https://github.com/lord/slate) documentation recommends that you fork the | ||
# repository and then write your documentation inside it. | ||
# | ||
# To convert Slate into a pure "doc builder", this script does a few things: | ||
# * clone my (Robert's) fork of Slate into temporary /docs_build | ||
# * write and sed custom configuration into the repository | ||
# * symlink our doc assets (primarily in /docs_src, but also a few image assets | ||
# from .static) into the cloned Slate repository | ||
# * build the documentation into /docs, which is deployed by GH-pages | ||
# | ||
# The symlink + config hacks also allows live-reload local dev deployment (using | ||
# the 'make run-docs' target in /Makefile). | ||
### | ||
|
||
# Get Slate | ||
echo "[INFO] Getting Slate" | ||
mkdir -p docs_build | ||
cd docs_build | ||
if [ ! -d slate ]; then | ||
# Using Robert's fork for now, for extra swag and configuration options not | ||
# available in vanilla Slate | ||
git clone https://github.com/bobheadxi/slate.git | ||
else | ||
echo "[INFO] Slate already present in docs_build/slate" | ||
fi | ||
|
||
# Add custom config to Slate | ||
echo "[INFO] Hacking Slate configuration" | ||
TEMPLATE_FILES_WATCH="files.watch :source, path: File.join(root, '../../docs_src')" | ||
if ! grep -q "$TEMPLATE_FILES_WATCH" slate/config.rb ; then | ||
# We want to symlink our doc assets into the repo, so to retain live reload | ||
# functionality, we want the generator Slate uses (Middleman) to watch our | ||
# symlink sources for changes too | ||
echo "$TEMPLATE_FILES_WATCH" \ | ||
>> slate/config.rb | ||
fi | ||
if ! grep -q "<%= favicon_tag 'favicon.ico' %>" slate/source/layouts/layout.erb ; then | ||
# This inserts a favicon reference into the <head /> element of the | ||
# documentation layout | ||
sed -i '' '/<head>/a\ | ||
<%= favicon_tag '\''favicon\.ico'\'' %> | ||
' slate/source/layouts/layout.erb | ||
fi | ||
|
||
# Set up Slate for build | ||
echo "[INFO] Linking assets" | ||
ln -fs "$(dirname "$(pwd)")"/docs_src/index.html.md \ | ||
slate/source/index.html.md | ||
ln -fs "$(dirname "$(pwd)")"/docs_src/stylesheets/_variables.scss \ | ||
slate/source/stylesheets/_variables.scss | ||
ln -fs "$(dirname "$(pwd)")"/.static/inertia.png \ | ||
slate/source/images/logo.png | ||
ln -fs "$(dirname "$(pwd)")"/.static/favicon.ico \ | ||
slate/source/images/favicon.ico | ||
echo "[INFO] Installing Slate dependencies" | ||
cd slate | ||
bundle install | ||
|
||
# Execute build | ||
echo "[INFO] Building documentation" | ||
rm -rf docs | ||
bundle exec middleman build --clean --build-dir=../../docs |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
inertia.ubclaunchpad.com | ||
inertia.ubclaunchpad.com |
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
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
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
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.