Skip to content

Commit

Permalink
Setup documentation on GH pages
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-lindquist committed Jul 18, 2019
1 parent a017bfb commit f68dd7a
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 33 deletions.
22 changes: 18 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
- PATH=~/.roswell/bin:$PATH
- ROSWELL_INSTALL_DIR=$HOME/.roswell
matrix:
- LISP=sbcl-bin
- LISP=sbcl-bin DOCS=true
COVERALLS_TEST=:noncoveralls-tests
- LISP=sbcl-bin COVERALLS=true COVERAGE_EXCLUDE=t:test-launcher.txt
COVERALLS_TEST=:coveralls-tests
Expand All @@ -29,16 +29,30 @@ env:
- LISP=cmucl
COVERALLS_TEST=:noncoveralls-tests

matrix:
fast_finish: true

cache:
directories:
- $HOME/.roswell
- $HOME/.config/common-lisp

install:
- curl -L https://raw.githubusercontent.com/roswell/roswell/release/scripts/install-for-ci.sh | sh
- ros install neil-lindquist/doc-site-generator

script:
- roswell/run-fiveam.ros -l ci-utils/test :travis-tests $COVERALLS_TEST :base-tests


before_deploy:
- copy-site-base docs docs-bin
- echo "The documentation page for the CI-Utils Common Lisp library." | make-gh-page README.md docs-bin/index.md
- roswell/generate-API-docs.ros

deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: docs-bin
on:
branch: master
condition: $DOCS = true
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ If your are not using Roswell, copy the contents of this repository somewhere th

### Usage

See [neil-lindquist.github.io/CI-Utils/API](neil-lindquist.github.io/CI-Utils/API) for documentation of the API.

#### run-fiveam

The `run-fiveam` Roswell script is designed to make running Fiveam tests simple.
Expand Down Expand Up @@ -42,32 +44,3 @@ Finally, if the `COVERALLS` environmental variable is set, then `:COVERALLS` is
| Circle CI | `:CIRCLE-CI` |
| Appveyor | `:APPVEYOR` |
| GitLab CI | `:GITLAB-CI` |

### Lisp API

#### **Package** CI-UTILS

**Function** PLATFORM ()
Returns the keyword for the current platform (see table above).

**Function** BUILD-DIR ()
Returns the directory that the repository was copied into.

**Function** BRANCH ()
Returns the name of the branch the build is from.

**Function** IS-PR ()
Returns whether the build is for a pull/merge request.

**Function** LOAD-PROJECT-SYSTEMS (&KEY FORCE)
Loads the root project in each asd file in the build directory.
`FORCE` is passed to `ASDF:LOAD-SYSTEM`.

#### **Package** CI-UTILS/COVERALLS

**Macro** WITH-COVERALLS (EXCLUDED &BODY BODY)
If the `:COVERALLS` feature is present, wraps the body in `CL-COVERALLS:WITH-COVERALLS` with the excluded paths passed.
Otherwise, it loads the root systems for the project (like as is done in cl-coveralls) followed by the body.

**Function** COVERAGE-EXCLUDED ()
Gets the contents of the `COVERAGE-EXCLUDED` environmental variable as a list of strings.
71 changes: 71 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# --- General options --- #

baseurl: "/CI-Utils"

# Name of website
title: CI-Utils

# Short description of your site
description: Documentation for the CI-Utils Common Lisp library.

# --- Navigation bar options --- #

# List of links in the navigation bar
navbar-links:
API Documentation: "API"

# Image to show in the navigation bar - image must be a square (width = height)
# Remove this parameter if you don't want an image in the navbar
# avatar: "/img/avatar.png"

# If you want to have an image logo in the top-left corner instead of the title text,
# then specify the following parameter
# title-img: /path/to/image

# --- Footer options --- #

# Select your active Social Network Links.
# Uncomment the links you want to show in the footer and add your information to each link.
# You can reorder the items to define the link order.
# If you want to add a new link that isn't here, you'll need to also edit the file _data/SocialNetworks.yml
social-network-links:
email: "neillindquist5@gmail.com"
public-key: "/neil-lindquist-public-key.pgp"
github: neil-lindquist/ci-utils
# linkedin: neil-lindquist
# orcid: 0000-0001-9404-3121
# rss: true
# facebook: daattali
# twitter: daattali
# reddit: yourname
# xing: yourname
# stackoverflow: "3943160/daattali"
# snapchat: deanat78
# instagram: deanat78
# youtube: user/deanat78
# spotify: yourname
# telephone: +14159998888
# steam: deanat78
# twitch: yourname
# yelp: yourname


# Exclude these files from production site
exclude:

# Default YAML values (more information on Jekyll's site)
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
comments: false # add comments to all blog posts
social-share: false # add social media sharing buttons to all blog posts
-
scope:
path: "" # all files
values:
layout: "page"
show-avatar: false
26 changes: 26 additions & 0 deletions roswell/generate-API-docs.ros
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#

(ql:quickload '(:ci-utils/coveralls :doc-site-generator))
(use-package :doc-gen)

(defun main (&rest argv)
(declare (ignore argv))

(with-open-file (stream "docs-bin/API.md"
:direction :output
:external-format :utf-8)

(format stream "---~%~
layout: page~%~
title: API Documentation~%~
meta-description: The API Documentation for the CI-Utils~
Common Lisp library.~%~
---~%~%~%")


(print-package-documentation 'ci-utils stream)
(print-package-documentation 'ci-utils/coveralls stream)))

0 comments on commit f68dd7a

Please sign in to comment.