diff --git a/.gitignore b/.gitignore index da8b52bf1..886ddc957 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,19 @@ src/ui/android/obj/ .cabal-sandbox cabal.sandbox.config DATA_DIR + +# Generated documentation (not exhaustive) +demos/index-numbers.html +demos/resourcegrammars.html +demos/translation.html +doc/tutorial/gf-tutorial.html +doc/gf-bibliography.html +doc/gf-developers.html +doc/gf-editor-modes.html +doc/gf-faq.html +doc/gf-reference.html +doc/gf-shell-reference.html +doc/icfp-2012.html +download/*.html +gf-book/index.html +src/www/gf-web-api.html diff --git a/bin/update_html b/bin/update_html index 07632317a..26dfc80fe 100755 --- a/bin/update_html +++ b/bin/update_html @@ -7,8 +7,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # Render txt2tags into html file # Arguments: # 1. txt2tags source file, e.g. download/index.t2t -# 2. html target filen, e.g. download/index.html -function render_html { +# 2. html target file, e.g. download/index.html +function render_t2t_html { t2t="$1" html="$2" tmp="$2.tmp" @@ -57,18 +57,58 @@ function render_html { fi } +# Render markdown into html file +# Arguments: +# 1. markdown source file, e.g. download/index.md +# 2. html target filen, e.g. download/index.html +function render_md_html { + md="$1" + html="$2" + relroot="$( dirname $md | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )" + + pandoc \ + --from=markdown \ + --to=html5 \ + --standalone \ + --template="$DIR/_template.html" \ + --variable="rel-root:$relroot" \ + "$md" \ + --output="$html" + + # Final post-processing + if [ -f "$html" ] ; then + sed -i.bak "s//
/" "$html" && rm "$html.bak" + echo "$html" + fi +} + if [ $# -gt 0 ] ; then # Render specific file(s) from args, ignoring dates - for t2t in "$@" ; do - html="${t2t%.t2t}.html" - render_html "$t2t" "$html" + for file in "$@" ; do + ext="${file##*.}" + html="${file%.$ext}.html" + case $ext in + "md") + render_md_html "$file" "$html" + ;; + "t2t") + render_t2t_html "$file" "$html" + ;; + esac done else - # Render all files found in cwd, and below, if source is newer - find . -name '*.t2t' | while read t2t ; do - html="${t2t%.t2t}.html" - if [ "$t2t" -nt "$html" ] ; then - render_html "$t2t" "$html" + # Render all files found in cwd and deeper if source is newer + find . -name '*.t2t' | while read file ; do + html="${file%.t2t}.html" + if [ "$file" -nt "$html" ] ; then + render_t2t_html "$file" "$html" + fi + done + find . -name '*.md' | while read file ; do + if [[ "$file" == *"README.md" ]] ; then continue ; fi + html="${file%.md}.html" + if [ "$file" -nt "$html" ] ; then + render_md_html "$file" "$html" fi done fi diff --git a/download/index.t2t b/download/index-3.9.t2t similarity index 100% rename from download/index.t2t rename to download/index-3.9.t2t diff --git a/download/index.md b/download/index.md new file mode 100644 index 000000000..a26096cc9 --- /dev/null +++ b/download/index.md @@ -0,0 +1,165 @@ +--- +title: Grammatical Framework Download and Installation +... + +**GF Bundle 18-12** was released on 28 November 2018. +It contains **GF v3.10** and **RGL snapshot 18-11-28**. + +What's new? See the [release notes](release-18-12.html). + +## Binary packages ("bundles") + +| Platform | Download | Features | How to install | +|:----------------|:---------------------------------------------------------------|:-----------|:------------------------------------------------------------| +| macOS | [gf-18-12.pkg](gf-18-12.pkg) | GF,S,C,J,P | Double-click on the package icon | +| macOS | [gf-18-12-bin-intel-mac.tar.gz](gf-18-12-bin-intel-mac.tar.gz) | GF,S,C,J,P | `sudo tar -C /usr/local -zxf gf-18-12-bin-intel-mac.tar.gz` | +| Raspian 9.1 | [gf\_18-12-1\_armhf.deb](gf_18-12-1_armhf.deb) | GF,S,C,J,P | `sudo dpkg -i gf_18-12-1_armhf.deb` | +| Ubuntu (32-bit) | [gf\_18-12-1\_i386.deb](gf_18-12-1_i386.deb) | GF,S,C,J,P | `sudo dpkg -i gf_18-12-1_i386.deb` | +| Ubuntu (64-bit) | [gf\_18-12-1\_amd64.deb](gf_18-12-1_amd64.deb) | GF,S,C,J,P | `sudo dpkg -i gf_18-12-1_amd64.deb` | +| Windows | [gf-18-12-bin-windows.zip](gf-18-12-bin-windows.zip) | GF,S | `unzip gf-18-12-bin-windows.zip` | + +**Features** + +- GF = GF shell and grammar compiler +- RGL = Resource Grammar Library +- S = `gf -server` mode +- C = C run-time system +- J/P = Java/Python binding to the C run-time system + +### Notes + +The Windows package is installed by just unpacking it anywhere. You will +probably need to set the `PATH` and `GF_LIB_PATH` environment variables, +see Inari's notes on [Installing GF on Windows](http://www.grammaticalframework.org/~inari/gf-windows.html#toc3). + +The Ubuntu `.deb` packages should work on Ubuntu 16.04 and 17.04 and +similar Linux distributions. + +The Raspian `.deb` package was created on a Raspberry Pi 3 and will +probably work on other ARM-based systems running Debian 9 (stretch) or +similar Linux distributions. + +The packages for macOS (Mac OS X) should work on at least 10.11 and +10.12 (El Capitan and Sierra). + +The Mac OS and Linux `.tar.gz` packages are designed to be installed in +`/usr/local`. You can install them in other locations, but then you need +to set the `GF_LIB_PATH` environment variable: + +``` +export GF_LIB_PATH=/usr/local/share/gf-3.9/lib +``` + +where `/usr/local` should be replaced with the path to the location +where you unpacked the package. + +## Installing the latest release from source + +[GF is on Hackage](http://hackage.haskell.org/package/gf), so under +normal circumstances the prodedure is fairly simple: + +1. Install a recent version of the [Haskell + Platform](http://hackage.haskell.org/platform), e.g. version 7.10.3 + (see note 2 below) +2. `cabal update` +3. On Linux: install some C libraries from your Linux distribution (see + note 1 below) +4. `cabal install gf` + +You can also download full source packages from GitHub: + +- [GF releases](https://github.com/GrammaticalFramework/gf-core/releases) +- [RGL releases](https://github.com/GrammaticalFramework/gf-rgl/releases) + +### Notes + +**Installation location** + +The above steps installs GF for a single user. The executables are put +in `$HOME/.cabal/bin` (or, with recent versions of the Haskell platform +on Mac OS X, in `$HOME/Library/Haskell/bin`), so it is a good idea to +put a line in your `.bash_profile` or `.profile` to add that directory +to you path: + +``` +PATH=$HOME/.cabal/bin:$PATH +``` + +or + +``` +PATH=$HOME/Library/Haskell/bin:$PATH +``` + +**Build tools** + +*TODO* Alex, Happy + +**Haskeline** + +GF uses [`haskeline`](http://hackage.haskell.org/package/haskeline), which +on Linux depends on some non-Haskell libraries that won't be installed +automatically by cabal, and therefore need to be installed manually. +Here is one way to do this: + +- On Ubuntu: `sudo apt-get install libghc-haskeline-dev` +- On Fedora: `sudo yum install ghc-haskeline-devel` + +**GHC version** + +The GF source code has been updated to compile with GHC +8.2.1. Using older versions of GHC (e.g. 8.0.x and 7.10.3) should still +work too. + +## Installing from the latest developer source code + +The first time: + +``` +git clone https://github.com/GrammaticalFramework/gf-core.git +cd gf-core +cabal install +``` + +and + +``` +git clone https://github.com/GrammaticalFramework/gf-rgl.git +cd gf-rgl +make +``` + +Subsequently: + +``` +cd gf-core +git pull +cabal install +``` + +and + +``` +cd gf-rgl +git pull +make +``` + +The above notes for installing from source apply also in these cases. +For more info on working with the GF source code, see the [GF Developers +Guide](../doc/gf-developers.html). + +## Older releases + +- [GF 3.9](index-3.9.html) (August 2017) +- [GF 3.8](index-3.8.html) (June 2016) +- [GF 3.7.1](index-3.7.1.html) (October 2015) +- [GF 3.7](index-3.7.html) (June 2015) +- [GF 3.6](index-3.6.html) (June 2014) +- [GF 3.5](index-3.5.html) (August 2013) +- [GF 3.4](index-3.4.html) (January 2013) +- [GF 3.3.3](index-3.3.3.html) (March 2012) +- [GF 3.3](index-3.3.html) (October 2011) +- [GF 3.2.9](index-3.2.9.html) source-only snapshot (September 2011) +- [GF 3.2](index-3.2.html) (December 2010) +- [GF 3.1.6](index-3.1.6.html) (April 2010) diff --git a/download/release-18-12.md b/download/release-18-12.md new file mode 100644 index 000000000..81dab5c7d --- /dev/null +++ b/download/release-18-12.md @@ -0,0 +1,16 @@ +--- +title: GF Bundle 18-12 Release Notes +date: 28 November 2018 +... + +## Installation + +See the [download page](index.html). + +## What's new + +- RGL split + +### GF v3.10 + +### RGL 18-12-28