Smoother navigation and changelog

This commit is contained in:
Kevin van Zonneveld 2016-06-21 11:20:59 +02:00
parent 7effd3c9d1
commit 26e282c37f
6 changed files with 74 additions and 34 deletions

View File

@ -1,8 +1,8 @@
<!--more-->
# Changelog
## master (Unreleased)
## master
Released: Unreleased. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v2.0.0...master)
- Add a simple documentation website
- Add best practice of using `__double_underscore_prefixed_vars` to indicate global variables that are solely controlled inside your script
@ -13,7 +13,9 @@
- Fix Travis OSX testing (before, it would silently pass failures) (#10)
- Enable dashes in long, GNU style options, as well as numbers (thanks @zbeekman)
## v2.0.0 (2016-02-17)
## v2.0.0
Released: 2016-02-17. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v1.2.1...v2.0.0)
- Add tests for `templater` and follow Library export best practices
- Add tests for `ini_val` and follow Library export best practices
@ -22,11 +24,15 @@
- Remove `bump` from `src` (BREAKING)
- Remove `semver` from `src` (BREAKING)
## v1.2.1 (2016-02-17)
## v1.2.1
Released: 2016-02-17. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v1.2.0...v1.2.1)
- Add Travis CI automated testing for OSX (thanks @zbeekman)
## v1.2.0 (2016-02-16)
## v1.2.0
Released: 2016-02-16. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v1.1.0...v1.2.0)
- Allow disabling colors via `NO_COLOR` environment variable
- Enable `errexit`, `nounset` and `pipefail` options at the top of the script already
@ -37,13 +43,17 @@
- Enable long, GNU style options (thanks @zbeekman)
- Add Travis CI automated testing for Linux
## v1.1.0 (2015-06-29)
## v1.1.0
Released: 2015-06-29. [Commit log](https://github.com/kvz/bash3boilerplate/compare/v1.0.3...v1.1.0)
- Add `ALLOW_REMAINDERS` configuration to templater
- Fix typo: 'debugmdoe' to 'debugmode' (thanks @jokajak)
- Use `${BASH_SOURCE[0]}` for `__file` instead of `${0}`
## v1.0.3 (2014-11-02)
## v1.0.3
Released: 2014-11-02. [Commit log](https://github.com/kvz/bash3boilerplate/compare/5db569125319a89b9561b434db84e4d91faefb63...v1.0.3)
- Add `ini_val`, `megamount`, `parse_url`
- Add re-usable libraries in `./src`

View File

@ -31,10 +31,11 @@ they are reusable as-is in most scripts.
## Goals
**Delete-key-friendly**. We propose using [`main.sh`](./main.sh) as a base and removing the
parts you don't need, rather than introducing packages, includes, compilers, etc.
Delete-Key-**Friendly**. We propose using [`main.sh`](https://github.com/kvz/bash3boilerplate/blob/master/main.sh)
as a base and removing the parts you don't need, rather than introducing packages, includes, compilers, etc.
This may feel a bit archaic at first, but that is exactly the strength of Bash scripts that we want to embrace.
**Portability**. We're targeting Bash 3 (OSX still ships
**Portable**. We're targeting Bash 3 (OSX still ships
with 3 for instance). If you're going to ask people to install
Bash 4 first, you might as well pick a more advanced language as a
dependency.
@ -46,23 +47,44 @@ We're automatically testing BASH3 Boilerplate and it's proven to work on:
## Features
- Structure
- Safe defaults (break on error, pipefail, etc)
- Conventions so that after a while, all your scripts will follow the same, battle-tested structure
- Safe by default (break on error, pipefail, etc)
- Configuration by environment variables
- Configuration by command-line arguments (definitions parsed from help info,
so no duplication needed)
- Magic variables like `__file`, `__dir`, and `__os`
- Logging that supports colors and is compatible with [Syslog Severity levels](http://en.wikipedia.org/wiki/Syslog#Severity_levels) as well as the [The twelve-factor app](http://12factor.net/)
- Simple command-line argument parsing that requires no external dependencies. Definitions are parsed from help info,
so there is no duplication
- Helpful magic variables like `__file`, `__dir`, and `__os`
- Logging that supports colors and is compatible with [Syslog Severity levels](http://en.wikipedia.org/wiki/Syslog#Severity_levels) as well as the [twelve-factor](http://12factor.net/) guidelines
## Installation
There are 3 ways you can install (parts of) b3bp:
There are 3 different ways you can install b3bp:
1. Just get the main template: `wget https://raw.githubusercontent.com/kvz/bash3boilerplate/master/main.sh`
2. Clone the entire project: `git clone git@github.com:kvz/bash3boilerplate.git`
3. As of `v1.0.3`, b3bp can be installed as a `package.json` dependency via: `npm install --save bash3boilerplate`
### option 1: Download the main template
Although *3* introduces a node.js dependency, this does allow for easy version pinning and distribution in environments that already have this prerequisite. But nothing prevents you from just using `curl` and keep your project or build system low on external dependencies.
Use curl or wget to download the source, save as your script, and start deleting the unwanted bits, and adding your own logic.
```bash
wget https://raw.githubusercontent.com/kvz/bash3boilerplate/master/main.sh
vim main.sh
```
### option 2: Clone the entire project
Besides `main.sh`, this will get you the entire b3bp repository including a few extra functions that we keep in the `./src` directory.
```bash
git clone git@github.com:kvz/bash3boilerplate.git
```
### option 3: Require via npm
As of `v1.0.3`, b3bp can also be installed as a node module so you define it as a dependency in `package.json` via:
```bash
npm init && npm install --save --save-exact bash3boilerplate
```
Although this last option introduces a Node.js dependency, this does allow for easy version pinning and distribution in environments that already have this prerequisite. But this is optional and nothing prevents you from just using `curl` and keep your project or build system low on external dependencies.
## Changelog

View File

@ -15,11 +15,13 @@ for doc in "README" "FAQ" "CHANGELOG"; do
permalink="/${targetName}/"
subtitle="$(tr '[:lower:]' '[:upper:]' <<< ${targetName:0:1})${targetName:1} | "
redirectFrom="/${doc}.md/"
backLink="\n\n<a href=\"/\">&laquo; Home</a>"
if [ "${doc}" = "README" ]; then
targetName="index"
permalink="/"
subtitle=""
redirectFrom="nothing"
backLink=""
fi
cat <<EOF > website/${targetName}.md
@ -32,7 +34,13 @@ warning: This page is generated by ${__base}.sh based on ${doc}.md, please don't
---
EOF
# http://stackoverflow.com/a/7104422/151666
cat ${doc}.md |sed -n -e '/<!--more-->/,$p' | tail -n +2 >> website/${targetName}.md
if grep '<!--more-->' ${doc}.md; then
cat ${doc}.md |sed -n -e '/<!--more-->/,$p' | tail -n +2 >> website/${targetName}.md
else
cat ${doc}.md >> website/${targetName}.md
fi
echo -e $backLink >> website/${targetName}.md
echo "written website/${targetName}.md"
done

View File

@ -13,7 +13,9 @@
<body>
<header>
<div id="header-overlay"></div>
<span id="logo"></span>
<a href="/">
<span id="logo"></span>
</a>
<div id="menu">
<i class="material-icons">menu</i>
<ul id="menu-items">
@ -25,9 +27,7 @@
</header>
<section id="content">
{{content}}
<p>
<br />
<small>
<hr />
Website design based on

View File

@ -42,11 +42,11 @@ function $all(selector) {
var container = $get('#menu-items')
if (location.pathname !== '/') {
var li = document.createElement('li');
li.innerHTML = '<a href="/">&laquo; Home</a>';
container.appendChild(li);
}
// if (location.pathname !== '/') {
// var li = document.createElement('li');
// li.innerHTML = '<a href="/">&laquo; Home</a>';
// container.appendChild(li);
// }
$all('#content h2').forEach(function(el) {
var li = document.createElement('li');

View File

@ -226,15 +226,15 @@ h5 { font-size: 0.83em; /* 0.83*16 = 13.28 */ }
h6 { font-size: 0.75em; /* 0.75*16 = 12 */ }
h1 {
margin-top: 75px;
/*margin-top: 75px;*/
}
h1::before {
display: block;
/*display: block;
content: ' ';
border-top: 1px dotted #eee;
width: 35%;
margin: 0 auto 75px auto;
margin: 0 auto 75px auto;*/
}
h2 {