From 7867c8c8287c4430d6fd5c8aed2e581ca4a9186d Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 31 Oct 2018 15:47:12 +0100 Subject: pre and post HTML templates for all txt2tags conversions Remaining: cleaning of t2t files (remove unnecessary options) --- bin/clean_html | 8 ++++++++ bin/update_html | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 bin/clean_html (limited to 'bin') diff --git a/bin/clean_html b/bin/clean_html new file mode 100755 index 000000000..e2bf0e799 --- /dev/null +++ b/bin/clean_html @@ -0,0 +1,8 @@ +#!/bin/bash + +### This script finds all .t2t (txt2tags) files and deletes the corresponding html file + +find . -name '*.t2t' | while read t2t ; do + html="${t2t%.t2t}.html" + rm -f "$html" +done diff --git a/bin/update_html b/bin/update_html index 75f54b13e..7777c7895 100755 --- a/bin/update_html +++ b/bin/update_html @@ -3,9 +3,38 @@ ### This script finds all .t2t (txt2tags) files and updates the corresponding ### .html file, if it is out-of-date. +config=".txt2tagsrc" +pre="_pre.html" +post="_post.html" +tmp="tmp.html" + find . -name '*.t2t' | while read t2t ; do html="${t2t%.t2t}.html" if [ "$t2t" -nt "$html" ] ; then - txt2tags -thtml "$t2t" + txt2tags --config-file="$config" --target=html "$t2t" + cat $pre $html $post > $tmp + mv $tmp $html + head1=$(head -n 1 "$t2t") + head2=$(tail -n+2 "$t2t" | head -n 1) + head3=$(tail -n+3 "$t2t" | head -n 1) + + # Replace "headers" from t2t in final HTML + # Documentation here: https://txt2tags.org/userguide/headerarea + if [ -n "$head1" ] ; then + sed -i.bak "s/{{HEAD1}}/$head1/" "$html" && rm "$html.bak" + else + sed -i.bak -E "s/<.+{{HEAD1}}.+>//" "$html" && rm "$html.bak" + continue # empty headers + fi + if [ -n "$head2" ] ; then + sed -i.bak "s/{{HEAD2}}/$head2/" "$html" && rm "$html.bak" + else + sed -i.bak -E "s/<.+{{HEAD2}}.+>//" "$html" && rm "$html.bak" + fi + if [ -n "$head3" ] ; then + sed -i.bak "s/{{HEAD3}}/$head3/" "$html" && rm "$html.bak" + else + sed -i.bak -E "s/<.+{{HEAD3}}.+>//" "$html" && rm "$html.bak" + fi fi -done \ No newline at end of file +done -- cgit v1.2.3 From 99dad489619ffb44301205975a8b2acac39939e9 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 4 Nov 2018 15:11:35 +0100 Subject: Use Pandoc instead of txt2tags binary, much more configurable --- .txt2tagsrc | 4 --- _post.html | 24 -------------- _pre.html | 16 ---------- bin/_template.html | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++ bin/update_html | 45 +++++++++++--------------- doc/gf-reference.t2t | 81 +++++++++++++++++++++++----------------------- download/index.t2t | 1 + 7 files changed, 149 insertions(+), 112 deletions(-) delete mode 100644 .txt2tagsrc delete mode 100644 _post.html delete mode 100644 _pre.html create mode 100644 bin/_template.html (limited to 'bin') diff --git a/.txt2tagsrc b/.txt2tagsrc deleted file mode 100644 index dd4b9503f..000000000 --- a/.txt2tagsrc +++ /dev/null @@ -1,4 +0,0 @@ -%!target: html -%!options: --no-headers -%!encoding: UTF-8 -%!postproc(html): '' '
' diff --git a/_post.html b/_post.html deleted file mode 100644 index 4973d2578..000000000 --- a/_post.html +++ /dev/null @@ -1,24 +0,0 @@ - - -
-
-
-
- Home -
-
-
-
- - - - - - diff --git a/_pre.html b/_pre.html deleted file mode 100644 index f9336e6f8..000000000 --- a/_pre.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {{HEAD1}} - - - - -
-
- GF Logo -

{{HEAD1}}

-

{{HEAD2}}

-

{{HEAD3}}

-
diff --git a/bin/_template.html b/bin/_template.html new file mode 100644 index 000000000..fc100e1c4 --- /dev/null +++ b/bin/_template.html @@ -0,0 +1,90 @@ + + + + + + +$for(author-meta)$ + +$endfor$ +$if(date-meta)$ + +$endif$ +$if(keywords)$ + +$endif$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + +$if(highlighting-css)$ + +$endif$ +$for(css)$ + +$endfor$ +$if(math)$ + $math$ +$endif$ + +$for(header-includes)$ + $header-includes$ +$endfor$ + + +
+ +$if(title)$ +
+ GF Logo +

$title$

+$if(subtitle)$ +

$subtitle$

+$endif$ +$for(author)$ +

$author$

+$endfor$ +$if(date)$ +

$date$

+$endif$ +
+$endif$ +$if(toc)$ + +$endif$ +$body$ +
+ +
+
+
+
+ Home +
+
+
+
+ + + + + diff --git a/bin/update_html b/bin/update_html index 7777c7895..f7c0ad727 100755 --- a/bin/update_html +++ b/bin/update_html @@ -3,38 +3,29 @@ ### This script finds all .t2t (txt2tags) files and updates the corresponding ### .html file, if it is out-of-date. -config=".txt2tagsrc" -pre="_pre.html" -post="_post.html" -tmp="tmp.html" +# Path to this directory (not CWD) +# https://stackoverflow.com/a/246128/98600 +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" find . -name '*.t2t' | while read t2t ; do html="${t2t%.t2t}.html" if [ "$t2t" -nt "$html" ] ; then - txt2tags --config-file="$config" --target=html "$t2t" - cat $pre $html $post > $tmp - mv $tmp $html - head1=$(head -n 1 "$t2t") - head2=$(tail -n+2 "$t2t" | head -n 1) - head3=$(tail -n+3 "$t2t" | head -n 1) - - # Replace "headers" from t2t in final HTML - # Documentation here: https://txt2tags.org/userguide/headerarea - if [ -n "$head1" ] ; then - sed -i.bak "s/{{HEAD1}}/$head1/" "$html" && rm "$html.bak" - else - sed -i.bak -E "s/<.+{{HEAD1}}.+>//" "$html" && rm "$html.bak" - continue # empty headers - fi - if [ -n "$head2" ] ; then - sed -i.bak "s/{{HEAD2}}/$head2/" "$html" && rm "$html.bak" - else - sed -i.bak -E "s/<.+{{HEAD2}}.+>//" "$html" && rm "$html.bak" - fi - if [ -n "$head3" ] ; then - sed -i.bak "s/{{HEAD3}}/$head3/" "$html" && rm "$html.bak" + echo "$t2t" + relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )" + pandoc \ + --from=t2t \ + --to=html5 \ + --standalone \ + --template="$DIR/_template.html" \ + --css="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" \ + --variable="rel-root:$relroot" \ + "$t2t" \ + --output="$html" + if [ -f "$html" ]; then + sed -i.bak "s/
/
/" "$html" && rm "$html.bak" + sed -i.bak -E "s/\`\`(.+)\`\`/\1<\/code>/g" "$html" && rm "$html.bak" else - sed -i.bak -E "s/<.+{{HEAD3}}.+>//" "$html" && rm "$html.bak" + echo "Error creating $html" fi fi done diff --git a/doc/gf-reference.t2t b/doc/gf-reference.t2t index aab828f0a..676a2088d 100644 --- a/doc/gf-reference.t2t +++ b/doc/gf-reference.t2t @@ -15,11 +15,11 @@ April 4, 2006 This is a quick reference on GF grammars. It aims to cover all forms of expression available when writing grammars. It assumes basic knowledge of GF, which -can be acquired from the +can be acquired from the [GF Tutorial http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html]. Help on GF commands is obtained on line by the -help command (``help``), and help on invoking -GF with (``gf -help``). +help command with ``help``, and help on invoking +GF with ``gf -help``. ===A complete example=== @@ -31,10 +31,10 @@ phrases //one pizza// and //two pizzas//. File ``Order.gf``: ``` abstract Order = { -cat - Order ; +cat + Order ; Item ; -fun +fun One, Two : Item -> Order ; Pizza : Item ; } @@ -42,13 +42,13 @@ fun File ``OrderEng.gf`` (the top file): ``` --# -path=.:prelude -concrete OrderEng of Order = +concrete OrderEng of Order = open Res, Prelude in { flags startcat=Order ; -lincat - Order = SS ; +lincat + Order = SS ; Item = {s : Num => Str} ; -lin +lin One it = ss ("one" ++ it.s ! Sg) ; Two it = ss ("two" ++ it.s ! Pl) ; Pizza = regNoun "pizza" ; @@ -84,10 +84,10 @@ File named ``Foo.gf`` contains module named Each module has the structure ``` -moduletypename = +moduletypename = Inherits ** -- optional open Opens in -- optional - { Judgements } + { Judgements } ``` Inherits are names of modules of the same type. Inheritance can be restricted: @@ -112,15 +112,15 @@ interface I -- like resource, but can have oper f : T without definition instance J of I -- like resource, defines opers that I leaves undefined -incomplete -- functor: concrete that opens +incomplete -- functor: concrete that opens concrete CI of A = one or more interfaces open I in ... concrete CJ of A = -- completion: concrete that CI with instantiates a functor by (I = J) instances of open interfaces -``` -The forms -``param``, ``oper`` +``` +The forms +``param``, ``oper`` may appear in ``concrete`` as well, but are then not inherited to extensions. @@ -134,11 +134,11 @@ Comments have the forms A ``concrete`` can be opened like a ``resource``. It is translated as follows: ``` -cat C ---> oper C : Type = +cat C ---> oper C : Type = lincat C = T T ** {lock_C : {}} -fun f : G -> C ---> oper f : A* -> C* = \g -> -lin f = t t g ** {lock_C = <>} +fun f : G -> C ---> oper f : A* -> C* = \g -> +lin f = t t g ** {lock_C = <>} ``` An ``abstract`` can be opened like an ``interface``. Any ``concrete`` of it then works as an ``instance``. @@ -155,7 +155,7 @@ fun f : T -- declare function f of type T def f = t -- define f as t def f p q = t -- define f by pattern matching data C = f | g -- set f,g as constructors of C -data f : A -> C -- same as +data f : A -> C -- same as fun f : A -> C; data C=f lincat C = T -- define lin.type of cat C @@ -166,7 +166,7 @@ printname fun f = s -- printname shown in menus printname cat C = s -- printname shown in menus printname f = s -- same as printname fun f = s -param P = C | D Q R -- define parameter type P +param P = C | D Q R -- define parameter type P with constructors C : P, D : Q -> R -> P oper h : T = t -- define oper h of type T @@ -207,14 +207,14 @@ P -- parameter type, if param P P => B -- table type, if P param. type {s : Str ; p : P}-- record type {s,t : Str} -- same as {s : Str ; t : Str} -{a : A} **{b : B}-- record type extension, same as +{a : A} **{b : B}-- record type extension, same as {a : A ; b : B} A * B * C -- tuple type, same as {p1 : A ; p2 : B ; p3 : C} Ints n -- type of n first integers ``` Resource (in ``oper``): all those of concrete, plus -``` +``` Tok -- tokens (subtype of Str) A -> B -- functions from A to B Int -- integers @@ -239,7 +239,7 @@ f a b -- : C if fun f : A -> B -> C ``` Higher-Order Abstract syntax (HOAS): functions as arguments: ``` -F a (\x -> c) -- : C if a : A, c : C (x : B), +F a (\x -> c) -- : C if a : A, c : C (x : B), fun F : A -> (B -> C) -> C ``` Tokens and token lists @@ -266,16 +266,16 @@ table { -- by pattern matching Pl => "mice" ; _ => "mouse" -- wildcard pattern } -table { - n => regn n "cat" -- variable pattern +table { + n => regn n "cat" -- variable pattern } table Num {...} -- table given with arg. type table ["ox"; "oxen"] -- table as course of values -\\_ => "fish" -- same as table {_ => "fish"} +\\_ => "fish" -- same as table {_ => "fish"} \\p,q => t -- same as \\p => \\q => t t ! p -- select p from table t -case e of {...} -- same as table {...} ! e +case e of {...} -- same as table {...} ! e ``` Records ``` @@ -296,7 +296,7 @@ Local definitions ``` let x : A = d in t -- let definition let x = d in t -- let defin, type inferred -let x=d ; y=e in t -- same as +let x=d ; y=e in t -- same as let x=d in let y=e in t let {...} in t -- same as let ... in t @@ -316,10 +316,10 @@ Typed expression ``` -- same as t, to help type inference ``` -Accessing bound variables in ``lin``: use fields ``$1, $2, $3,...``. +Accessing bound variables in ``lin``: use fields ``$1, $2, $3,...``. Example: ``` -fun F : (A : Set) -> (El A -> Prop) -> Prop ; +fun F : (A : Set) -> (El A -> Prop) -> Prop ; lin F A B = {s = ["for all"] ++ A.s ++ B.$1 ++ B.s} ``` @@ -367,7 +367,7 @@ oper cc2 : (_,_ : SS) -> SS -- concat SS's optStr : Str -> Str -- string or empty strOpt : Str -> Str -- empty or string - bothWays : Str -> Str -> Str -- X++Y or Y++X + bothWays : Str -> Str -> Str -- X++Y or Y++X init : Tok -> Tok -- all but last char last : Tok -> Tok -- last char prefixSS : Str -> SS -> SS @@ -388,7 +388,7 @@ Flags can appear, with growing priority, Some common flags used in grammars: ``` -startcat=cat use this category as default +startcat=cat use this category as default lexer=literals int and string literals recognized lexer=code like program code @@ -407,7 +407,7 @@ optimize=values good for lexicon concrete optimize=all usually good for resource optimize=noexpand for resource, if =all too big ``` -For the full set of values for ``FLAG``, +For the full set of values for ``FLAG``, use on-line ``h -FLAG``. @@ -415,7 +415,7 @@ use on-line ``h -FLAG``. ===File import search paths=== Colon-separated list of directories searched in the -given order: +given order: ``` --# -path=.:../abstract:../common:prelude ``` @@ -443,17 +443,17 @@ directories, colon-separated, in ``GF_LIB_PATH``. ===Alternative grammar formats=== -**Old GF** (before GF 2.0): +**Old GF** (before GF 2.0): all judgements in any kinds of modules, division into files uses ``include``s. A file ``Foo.gf`` is recognized as the old format -if it lacks a module header. +if it lacks a module header. **Context-free** (file ``foo.cf``). The form of rules is e.g. ``` Fun. S ::= NP "is" AP ; ``` -If ``Fun`` is omitted, it is generated automatically. +If ``Fun`` is omitted, it is generated automatically. Rules must be one per line. The RHS can be empty. **Extended BNF** (file ``foo.ebnf``). The form of rules is e.g. @@ -477,7 +477,7 @@ on command line. This file can be the grammar file itself. ``` in Cat "example string" ``` -are preprocessed by using a parser given by the flag +are preprocessed by using a parser given by the flag ``` --# -resource=File ``` @@ -489,5 +489,4 @@ and the result is written to ``foo.gf``. [GF Homepage http://www.grammaticalframework.org/] A. Ranta, Grammatical Framework: A Type-Theoretical Grammar Formalism. -//The Journal of Functional Programming//, vol. 14:2. 2004, pp. 145-189. - +//The Journal of Functional Programming//, vol. 14:2. 2004, pp. 145-189. diff --git a/download/index.t2t b/download/index.t2t index 1f89d9f78..da96f238c 100644 --- a/download/index.t2t +++ b/download/index.t2t @@ -16,6 +16,7 @@ What's new? See the [Release notes release-3.9.html]. | Ubuntu (32-bit) | [gf_3.9-1_i386.deb gf_3.9-1_i386.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_i386.deb`` | Ubuntu (64-bit) | [gf_3.9-1_amd64.deb gf_3.9-1_amd64.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_amd64.deb`` | Windows | [gf-3.9-bin-windows.zip gf-3.9-bin-windows.zip] | //GF+S// | ``unzip gf-3.9-bin-windows.zip`` + %| MINGW | [gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz] | //GF+S+C// | ``tar -C / gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz`` %| ... | ... | ... | ... -- cgit v1.2.3 From aea8548930fd58d5302aa6381376adbb8a2be2d4 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 4 Nov 2018 19:27:14 +0100 Subject: update_html also takes individual arguments --- bin/update_html | 57 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to 'bin') diff --git a/bin/update_html b/bin/update_html index f7c0ad727..126072e44 100755 --- a/bin/update_html +++ b/bin/update_html @@ -7,25 +7,40 @@ # https://stackoverflow.com/a/246128/98600 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" -find . -name '*.t2t' | while read t2t ; do - html="${t2t%.t2t}.html" - if [ "$t2t" -nt "$html" ] ; then - echo "$t2t" - relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )" - pandoc \ - --from=t2t \ - --to=html5 \ - --standalone \ - --template="$DIR/_template.html" \ - --css="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" \ - --variable="rel-root:$relroot" \ - "$t2t" \ - --output="$html" - if [ -f "$html" ]; then - sed -i.bak "s/
/
/" "$html" && rm "$html.bak" - sed -i.bak -E "s/\`\`(.+)\`\`/\1<\/code>/g" "$html" && rm "$html.bak" - else - echo "Error creating $html" - fi +function render_html { + t2t=$1 + html=$2 + relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )" + pandoc \ + --from=t2t \ + --to=html5 \ + --standalone \ + --template="$DIR/_template.html" \ + --css="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" \ + --variable="rel-root:$relroot" \ + "$t2t" \ + --output="$html" + if [ -f "$html" ] ; then + sed -i.bak "s/
/
/" "$html" && rm "$html.bak" + sed -i.bak -E "s/\`\`(.+)\`\`/\1<\/code>/g" "$html" && rm "$html.bak" + echo "$html" + else + echo "Error creating $html" fi -done +} + +if [ $# -gt 0 ] ; then + # Render spcific file(s) from args, ignoring dates + for t2t in "$@" ; do + html="${t2t%.t2t}.html" + render_html "$t2t" "$html" + done +else + # Render all files found from cwd, if source is newer + find . -name '*.t2t' | while read t2t ; do + html="${t2t%.t2t}.html" + if [ "$t2t" -nt "$html" ] ; then + render_html "$t2t" "$html" + fi + done +fi -- cgit v1.2.3 From 914d54255fe81301773adfab1a2d8c0319afcd9a Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 4 Nov 2018 19:29:56 +0100 Subject: Comments in update_html script --- bin/update_html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/update_html b/bin/update_html index 126072e44..a5194bbdd 100755 --- a/bin/update_html +++ b/bin/update_html @@ -1,12 +1,13 @@ #!/bin/bash -### This script finds all .t2t (txt2tags) files and updates the corresponding -### .html file, if it is out-of-date. - -# Path to this directory (not CWD) +# Path to directory where this script is # https://stackoverflow.com/a/246128/98600 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 { t2t=$1 html=$2 @@ -30,13 +31,13 @@ function render_html { } if [ $# -gt 0 ] ; then - # Render spcific file(s) from args, ignoring dates + # Render specific file(s) from args, ignoring dates for t2t in "$@" ; do html="${t2t%.t2t}.html" render_html "$t2t" "$html" done else - # Render all files found from cwd, if source is newer + # 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 -- cgit v1.2.3 From 9a7862ea9eaab6b17c1547a411421ee10e831c18 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 4 Nov 2018 19:58:18 +0100 Subject: Links in footer --- bin/_template.html | 46 ++++++++++++++++++++++++++++++++++++++++++---- bin/update_html | 1 - index.html | 17 +++++++++-------- 3 files changed, 51 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index fc100e1c4..a51f92378 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -31,6 +31,8 @@ $endif$ $for(css)$ $endfor$ + + $if(math)$ $math$ $endif$ @@ -46,7 +48,7 @@ $endfor$ $if(title)$
- GF Logo + GF Logo

$title$

$if(subtitle)$

$subtitle$

@@ -68,10 +70,46 @@ $body$ -- cgit v1.2.3 From 390a6a04a13c0bc143193b017f1892579e737a88 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Sun, 4 Nov 2018 21:17:20 +0100 Subject: New update_html runx txt2tags followed by pandoc TODO: handle txt2tags macros in date, e.g. `%%mtime(%F)` in download/encoding-change.t2t --- bin/update_html | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/update_html b/bin/update_html index 7b214314f..07632317a 100755 --- a/bin/update_html +++ b/bin/update_html @@ -9,23 +9,51 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" # 1. txt2tags source file, e.g. download/index.t2t # 2. html target filen, e.g. download/index.html function render_html { - t2t=$1 - html=$2 + t2t="$1" + html="$2" + tmp="$2.tmp" relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )" + + # First render with txt2tags to handle pre/post processing + txt2tags \ + --target=html \ + --no-headers \ + --quiet \ + --outfile="$tmp" \ + --infile="$t2t" + + # Capture first 3 lines of t2t file: title, author, date + # Documentation here: https://txt2tags.org/userguide/headerarea + l1=$(head -n 1 "$t2t") + l2=$(tail -n+2 "$t2t" | head -n 1) + l3=$(tail -n+3 "$t2t" | head -n 1) + title= + author= + date= + if [ -n "$l1" ] ; then + title="$l1" + if [ -n "$l2" ] ; then author="$l2" ; fi + if [ -n "$l3" ] ; then date="$l3" ; fi + fi + + # Run txt2tag's HTML through Pandoc for cleanup pandoc \ - --from=t2t \ + --from=html \ --to=html5 \ --standalone \ --template="$DIR/_template.html" \ --variable="rel-root:$relroot" \ - "$t2t" \ + --metadata="title:$title" \ + --metadata="author:$author" \ + --metadata="date:$date" \ + "$tmp" \ --output="$html" + rm -f "$tmp" + + # Final post-processing if [ -f "$html" ] ; then sed -i.bak "s/
/
/" "$html" && rm "$html.bak" - sed -i.bak -E "s/\`\`(.+)\`\`/\1<\/code>/g" "$html" && rm "$html.bak" echo "$html" - else - echo "Error creating $html" fi } -- cgit v1.2.3 From 2f1ee094d23b661b8147b395e5fd7d5c058a46d2 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 8 Nov 2018 22:46:30 +0100 Subject: Add download/index.md as demo of working Markdown rendering to HTML Archive 3.9 pages and mark current ones for 18-12 --- .gitignore | 16 ++++ bin/update_html | 60 ++++++++++++--- download/index-3.9.t2t | 187 ++++++++++++++++++++++++++++++++++++++++++++++ download/index.md | 165 ++++++++++++++++++++++++++++++++++++++++ download/index.t2t | 187 ---------------------------------------------- download/release-18-12.md | 16 ++++ 6 files changed, 434 insertions(+), 197 deletions(-) create mode 100644 download/index-3.9.t2t create mode 100644 download/index.md delete mode 100644 download/index.t2t create mode 100644 download/release-18-12.md (limited to 'bin') 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-3.9.t2t b/download/index-3.9.t2t new file mode 100644 index 000000000..da96f238c --- /dev/null +++ b/download/index-3.9.t2t @@ -0,0 +1,187 @@ +Grammatical Framework Download and Installation + + +**GF 3.9** was released on 11 August 2017. + +What's new? See the [Release notes release-3.9.html]. + + +== Binary packages == + +|| Platform | Download | Features | How to install +| macOS | [gf-3.9.pkg gf-3.9.pkg] | //GF+S+C+J+P// | Double-click on the package icon +| macOS | [gf-3.9-bin-intel-mac.tar.gz gf-3.9-bin-intel-mac.tar.gz] | //GF+S+C+J+P// | ``sudo tar -C /usr/local -zxf gf-3.9-bin-intel-mac.tar.gz`` +%| Fedora (32-bit) | [Fedora RPMs /~hallgren/tmp/Fedora/] | //GF+S+C+J+P// | ``sudo rpm -i ...`` +| Raspian 9.1 | [gf_3.9-1_armhf.deb gf_3.9-1_armhf.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_armhf.deb`` +| Ubuntu (32-bit) | [gf_3.9-1_i386.deb gf_3.9-1_i386.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_i386.deb`` +| Ubuntu (64-bit) | [gf_3.9-1_amd64.deb gf_3.9-1_amd64.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_amd64.deb`` +| Windows | [gf-3.9-bin-windows.zip gf-3.9-bin-windows.zip] | //GF+S// | ``unzip gf-3.9-bin-windows.zip`` + +%| MINGW | [gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz] | //GF+S+C// | ``tar -C / gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz`` +%| ... | ... | ... | ... + +Features: GF = GF shell and grammar compiler and the Resource Grammar Library, +S = ``gf -server`` mode, +C = C run-time system, +J/P = Java/Python binding to the C run-time system + +%More binary packages might be added later. + +===Notes=== + +The Windows package is installed by just unpacking it anywhere. +%It finds the libraries relative to the ``.exe`` file. +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 new experimental MINGW package is for use in the +%[MINGW http://www.mingw.org] environment in Windows. Unpack it in the MSYS shell +%(which is started with ``C:\MinGW\msys\1.0\msys.bat``). +%It should work out of the box without any additional settings. + +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). + +%(*) **Note** that for compatibility with OS X 10.11 and newer, +%``gf-3.9.pkg`` will install the ``gf`` executable in ``/usr/local/bin`` +%instead of ``/usr/bin``, so make sure ``/usr/local/bin`` is in your ``$PATH``. +%Also, if you still have an older version of GF installed in ``/usr/bin``, +%remove it and/or make sure ``/usr/local/bin`` comes before ``/usr/bin`` +%in your ``$PATH`` so you don't accidentally run the old version. + +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: + ++ Install a recent version of the + [Haskell Platform http://hackage.haskell.org/platform], + e.g. version 7.10.3 (see note 2 below) ++ ``cabal update`` ++ On Linux: install some C libraries from your Linux distribution + (see note 1 below) ++ ``cabal install gf`` + + +You can also download the full source package from here: +[``gf-3.9.tar.gz`` gf-3.9.tar.gz]. + +=== Notes === + +The above steps installs GF for a single user. +% and does not require root privileges. +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 +``` + +**Note 1**. +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`` + + +**Note 2**. +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. + +%=== Known problems === +% +%There seems to be a bug in some versions of Cabal that can cause +% +%``` +% Distribution/Simple/PackageIndex.hs:124:8-13: Assertion failed +%``` +% +%if the same version of GF is +%already installed. If you encounter this, you can use ``ghc-pkg unregister gf`` +%to remove the installed version of GF and ``ghc-pkg list gf`` to verify that +%it is gone. + +==Installing from the latest developer source code== + +The first time: +%, assuming you already have the Haskell Platform and darcs + +``` + 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.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). +- [GF 3.1 old-index.html] (December 2009). 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/index.t2t b/download/index.t2t deleted file mode 100644 index da96f238c..000000000 --- a/download/index.t2t +++ /dev/null @@ -1,187 +0,0 @@ -Grammatical Framework Download and Installation - - -**GF 3.9** was released on 11 August 2017. - -What's new? See the [Release notes release-3.9.html]. - - -== Binary packages == - -|| Platform | Download | Features | How to install -| macOS | [gf-3.9.pkg gf-3.9.pkg] | //GF+S+C+J+P// | Double-click on the package icon -| macOS | [gf-3.9-bin-intel-mac.tar.gz gf-3.9-bin-intel-mac.tar.gz] | //GF+S+C+J+P// | ``sudo tar -C /usr/local -zxf gf-3.9-bin-intel-mac.tar.gz`` -%| Fedora (32-bit) | [Fedora RPMs /~hallgren/tmp/Fedora/] | //GF+S+C+J+P// | ``sudo rpm -i ...`` -| Raspian 9.1 | [gf_3.9-1_armhf.deb gf_3.9-1_armhf.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_armhf.deb`` -| Ubuntu (32-bit) | [gf_3.9-1_i386.deb gf_3.9-1_i386.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_i386.deb`` -| Ubuntu (64-bit) | [gf_3.9-1_amd64.deb gf_3.9-1_amd64.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_amd64.deb`` -| Windows | [gf-3.9-bin-windows.zip gf-3.9-bin-windows.zip] | //GF+S// | ``unzip gf-3.9-bin-windows.zip`` - -%| MINGW | [gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz] | //GF+S+C// | ``tar -C / gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz`` -%| ... | ... | ... | ... - -Features: GF = GF shell and grammar compiler and the Resource Grammar Library, -S = ``gf -server`` mode, -C = C run-time system, -J/P = Java/Python binding to the C run-time system - -%More binary packages might be added later. - -===Notes=== - -The Windows package is installed by just unpacking it anywhere. -%It finds the libraries relative to the ``.exe`` file. -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 new experimental MINGW package is for use in the -%[MINGW http://www.mingw.org] environment in Windows. Unpack it in the MSYS shell -%(which is started with ``C:\MinGW\msys\1.0\msys.bat``). -%It should work out of the box without any additional settings. - -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). - -%(*) **Note** that for compatibility with OS X 10.11 and newer, -%``gf-3.9.pkg`` will install the ``gf`` executable in ``/usr/local/bin`` -%instead of ``/usr/bin``, so make sure ``/usr/local/bin`` is in your ``$PATH``. -%Also, if you still have an older version of GF installed in ``/usr/bin``, -%remove it and/or make sure ``/usr/local/bin`` comes before ``/usr/bin`` -%in your ``$PATH`` so you don't accidentally run the old version. - -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: - -+ Install a recent version of the - [Haskell Platform http://hackage.haskell.org/platform], - e.g. version 7.10.3 (see note 2 below) -+ ``cabal update`` -+ On Linux: install some C libraries from your Linux distribution - (see note 1 below) -+ ``cabal install gf`` - - -You can also download the full source package from here: -[``gf-3.9.tar.gz`` gf-3.9.tar.gz]. - -=== Notes === - -The above steps installs GF for a single user. -% and does not require root privileges. -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 -``` - -**Note 1**. -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`` - - -**Note 2**. -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. - -%=== Known problems === -% -%There seems to be a bug in some versions of Cabal that can cause -% -%``` -% Distribution/Simple/PackageIndex.hs:124:8-13: Assertion failed -%``` -% -%if the same version of GF is -%already installed. If you encounter this, you can use ``ghc-pkg unregister gf`` -%to remove the installed version of GF and ``ghc-pkg list gf`` to verify that -%it is gone. - -==Installing from the latest developer source code== - -The first time: -%, assuming you already have the Haskell Platform and darcs - -``` - 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.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). -- [GF 3.1 old-index.html] (December 2009). 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 -- cgit v1.2.3 From 406eec6690a900187ae8fcafb0470c63dfb3b615 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Thu, 8 Nov 2018 22:52:08 +0100 Subject: GF logo links to home; remove "other demos" --- bin/_template.html | 2 ++ index.html | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index 2853fb394..f35432eec 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -48,7 +48,9 @@ $endfor$ $if(title)$
+ GF Logo +

$title$

$if(subtitle)$

$subtitle$

diff --git a/index.html b/index.html index fe45c85cb..34b5793fb 100644 --- a/index.html +++ b/index.html @@ -26,14 +26,14 @@

Use

- Download GF +

Community

    -- cgit v1.2.3 From d1a435ad9d548e4594c8c9397afbf8b6aef79082 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 9 Nov 2018 09:08:59 +0100 Subject: Remove unnecessary CSS from template --- bin/_template.html | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index f35432eec..c8a9108ad 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -14,20 +14,6 @@ $if(keywords)$ $endif$ $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ - -$if(highlighting-css)$ - -$endif$ $for(css)$ $endfor$ -- cgit v1.2.3 From cb0e919bf57163aa6d5b5314b94a49d50f1e2fef Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Tue, 13 Nov 2018 21:22:54 +0100 Subject: Link to new synopsis page --- bin/_template.html | 5 ++--- index.html | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index c8a9108ad..3cf10ba47 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -2,8 +2,7 @@ - - + $for(author-meta)$ $endfor$ @@ -75,7 +74,7 @@ $body$
    Documentation
    • GF Shell Reference
    • -
    • RGL Library Synopsis
    • +
    • RGL Library Synopsis
    • The GF Book
    • Reference Manual
    • Tutorial
    • diff --git a/index.html b/index.html index ee8e4074d..990bdc21f 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,7 @@

      Learn

      - + RGL Library Synopsis @@ -164,7 +164,7 @@ least one, it may help you to get a first idea of what GF is. multilingual web gadgets, natural-language interfaces, dialogue systems, and - natural language resources. + natural language resources.

      @@ -318,7 +318,7 @@ least one, it may help you to get a first idea of what GF is. Libraries are at the heart of modern software engineering. In natural language applications, libraries are a way to cope with thousands of details involved in syntax, lexicon, and inflection. The - GF resource grammar library has + GF resource grammar library has support for an increasing number of languages, currently including Afrikaans, Amharic (partial), -- cgit v1.2.3 From 9bf5c98509d5550dfba52eb04606441bd86461b7 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Tue, 27 Nov 2018 22:36:57 +0100 Subject: Work on new download page. Change 18-12 to 4.0.0 --- bin/update_html | 4 +-- download/index.md | 75 ++++++++++++++++++++++++++++++----------------- download/release-18-12.md | 16 ---------- download/release-4.0.0.md | 16 ++++++++++ index.html | 3 +- 5 files changed, 68 insertions(+), 46 deletions(-) delete mode 100644 download/release-18-12.md create mode 100644 download/release-4.0.0.md (limited to 'bin') diff --git a/bin/update_html b/bin/update_html index 26dfc80fe..ec82ec491 100755 --- a/bin/update_html +++ b/bin/update_html @@ -52,7 +52,7 @@ function render_t2t_html { # Final post-processing if [ -f "$html" ] ; then - sed -i.bak "s/

/
/" "$html" && rm "$html.bak" + sed -i.bak "s/
/
/" "$html" && rm "$html.bak" + sed -i.bak "s/
2018-11-28
- GF 18.12 released. + GF 4.0.0 released. + Release notes
2018-07-25
-- cgit v1.2.3 From c7a14537c1a3b5b75c107fdfc2d1078da8e99df5 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 28 Nov 2018 15:42:11 +0100 Subject: Update top links and footer during hackathon --- bin/_template.html | 29 ++- doc/gf-lrec-2010.pdf | Bin 2898006 -> 0 bytes doc/gf-people.md | 7 +- doc/gf-quickstart.html | 158 --------------- doc/gf-reference.t2t | 492 ---------------------------------------------- download/index.md | 20 +- download/release-3.10.md | 16 ++ download/release-4.0.0.md | 16 -- index.html | 77 ++++---- 9 files changed, 91 insertions(+), 724 deletions(-) delete mode 100644 doc/gf-lrec-2010.pdf delete mode 100644 doc/gf-quickstart.html delete mode 100644 doc/gf-reference.t2t create mode 100644 download/release-3.10.md delete mode 100644 download/release-4.0.0.md (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index 3cf10ba47..115683a73 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -64,34 +64,47 @@ $body$ Home -
Use
+
Get started
+
Contribute +
+ +
Repositories - +
  • GF Core
  • diff --git a/doc/gf-lrec-2010.pdf b/doc/gf-lrec-2010.pdf deleted file mode 100644 index 83d1a58cf..000000000 Binary files a/doc/gf-lrec-2010.pdf and /dev/null differ diff --git a/doc/gf-people.md b/doc/gf-people.md index 403a31369..9e0177306 100644 --- a/doc/gf-people.md +++ b/doc/gf-people.md @@ -4,7 +4,7 @@ title: "Grammatical Framework: Authors and Acknowledgements" ## Current maintainers -The current developers and maintainers are +The current maintainers of GF are [Krasimir Angelov](http://www.chalmers.se/cse/EN/organization/divisions/computing-science/people/angelov-krasimir), [Thomas Hallgren](http://www.cse.chalmers.se/~hallgren/), @@ -12,7 +12,8 @@ The current developers and maintainers are [John J. Camilleri](http://johnjcamilleri.com), and [Inari Listenmaa](https://inariksit.github.io/). -For detailed data about contributors to the code repositories, see +This page is otherwise not up to date. +For detailed data about contributors to the code repositories since 2007, see [here (gf-core)](https://github.com/GrammaticalFramework/gf-core/graphs/contributors) and [here (gf-rgl)](https://github.com/GrammaticalFramework/gf-rgl/graphs/contributors). @@ -43,7 +44,7 @@ reports, and other indirect contributions to the code. - [Robin Cooper](http://www.cling.gu.se/~cooper) (Gothenburg) - [Thierry Coquand](http://www.cse.chalmers.se/~coquand) (Chalmers) - [Marc Dymetman](http://www.xrce.xerox.com/people/dymetman/dymetman.html) (XRCE) -- Bertrand Grégoire (Tudor Institure, Luxembourg) +- Bertrand Grégoire (Tudor Institute, Luxembourg) - [Reiner Hähnle](http://www.cse.chalmers.se/~reiner) (Chalmers) - [Gérard Huet](http://pauillac.inria.fr/~huet/) (INRIA) - [Patrik Jansson](http://www.cse.chalmers.se/~patrikj) (Chalmers) diff --git a/doc/gf-quickstart.html b/doc/gf-quickstart.html deleted file mode 100644 index 787c23ce6..000000000 --- a/doc/gf-quickstart.html +++ /dev/null @@ -1,158 +0,0 @@ - - - -GF Quickstart - - - - - - - -
    - -

    -Aarne Ranta -

    -October 2011 for GF 3.3 - -

    - -

    Grammatical Framework Quick Start

    - -
    - -This Quick Start shows a few examples of how GF can be used. -We assume that you have downloaded and installed GF, so that -the command gf works for you. See download and install -instructions here. - -

    Want to try without downloading?

    - -Using GF translation with an existing grammar. - -

    - -Writing GF grammars in the cloud, without installing GF. - - - - -

    Using GF for translation and generation

    - -When you have downloaded and installed GF: -
      -
    1. Copy the files -Food.gf, -FoodEng.gf, and -FoodIta.gf. -Or go to GF/examples/tutorial/food/, if you have downloaded the -GF sources. - -
    2. Start GF with the shell command (without the prompt $) -
      -  $ gf FoodIta.gf FoodEng.gf
      -
      -Alternatively, start GF with gf and give the GF command import FoodIta.gf FoodEng.gf. - -
    3. Translation. Try your first translation by giving the GF command -
      -  parse "this cheese is very very Italian" | linearize
      -
      -Notice that the parser accept the tabulator for word completion. - -
    4. Generation. Random-generate sentences in two languages: -
      -  generate_random | linearize
      -
      - -
    5. Other commands. Use the help command -
      -  help
      -
      -
    6. More examples. Go to GF/examples/phrasebook or some other -subdirectory of GF/examples/. Or try a resource grammar by, for instance, -
      -  import alltenses/LangEng.gfo alltenses/LangGer.gfo
      -
      -  parse -lang=Eng "I love you" | linearize -treebank
      -
      -The resource grammars are found relative to the value of GF_LIB_PATH, which -you may have to set; see here for instructions. - - - -
    - - - -

    Grammar development

    - -Add words to the Food -grammars and try the above commands again. For instance, add the following lines: -
    -  Bread : Kind ;          -- in Food.gf
    -  Bread = {s = "bread"} ; -- in FoodEng.gf
    -  Bread = {s = "pane"} ;  -- in FoodIta.gf
    -
    -and start GF again with the same command. Now you can even translate -this bread is very Italian. - -To lear more on GF commands and -grammar development, go to the one of the tutorials: - -To learn about how GF is used for easily writing grammars for 16 languages, consult the - - - - -

    Run-time grammars and web applications

    - -GF has its own "machine language", PGF (Portable Grammar Format), -which is recommended for use in applications at run time. To produce a PGF file from -the two grammars above, do -
    -  gf -make FoodIta.gf FoodEng.gf
    -  wrote Food.pgf
    -
    -You can use this in Haskell and Java programs, and also on web services, such as -
      -
    • the - minibar - fridge magnets -
    - -The quickest way to provide a GF web service is to start GF with the -server option: -
    -  $ gf -server
    -  This is GF version 3.3
    -  Built on linux/i386 with ghc-7.0, flags: interrupt server cclazy
    -  Document root = /usr/local/share/gf-3.3/www
    -  Starting HTTP server, open http://localhost:41296/ in your web browser.
    -
    -You can view it locally by pointing your -browser to the URL shown. You can add your own .pgf grammar to the service by -copying it over to the documentRoot directory. Just push "reload" in -your browser after each such update. - -

    - -To build more customized web application, consult the -developer wiki. - - -

    User group

    - -You are welcome to join the User Group -to get help and discuss GF-related issues! - - - - - - diff --git a/doc/gf-reference.t2t b/doc/gf-reference.t2t deleted file mode 100644 index 676a2088d..000000000 --- a/doc/gf-reference.t2t +++ /dev/null @@ -1,492 +0,0 @@ -GF Quick Reference -Aarne Ranta -April 4, 2006 - -% NOTE: this is a txt2tags file. -% Create an html file from this file using: -% txt2tags -thtml gf-reference.t2t - -%!style:../css/style.css -%!target:html -%!options: --toc -%!postproc(html): <meta name = "viewport" content = "width = device-width"><TITLE> -%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a> - -This is a quick reference on GF grammars. It aims to -cover all forms of expression available when writing -grammars. It assumes basic knowledge of GF, which -can be acquired from the -[GF Tutorial http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html]. -Help on GF commands is obtained on line by the -help command with ``help``, and help on invoking -GF with ``gf -help``. - - -===A complete example=== - -This is a complete example of a GF grammar divided -into three modules in files. The grammar recognizes the -phrases //one pizza// and //two pizzas//. - -File ``Order.gf``: -``` -abstract Order = { -cat - Order ; - Item ; -fun - One, Two : Item -> Order ; - Pizza : Item ; -} -``` -File ``OrderEng.gf`` (the top file): -``` ---# -path=.:prelude -concrete OrderEng of Order = - open Res, Prelude in { -flags startcat=Order ; -lincat - Order = SS ; - Item = {s : Num => Str} ; -lin - One it = ss ("one" ++ it.s ! Sg) ; - Two it = ss ("two" ++ it.s ! Pl) ; - Pizza = regNoun "pizza" ; -} -``` -File ``Res.gf``: -``` -resource Res = open Prelude in { -param Num = Sg | Pl ; -oper regNoun : Str -> {s : Num => Str} = - \dog -> {s = table { - Sg => dog ; - _ => dog + "s" - } - } ; -} -``` -To use this example, do -``` - % gf -- in shell: start GF - > i OrderEng.gf -- in GF: import grammar - > p "one pizza" -- parse string - > l Two Pizza -- linearize tree -``` - - - -===Modules and files=== - -One module per file. -File named ``Foo.gf`` contains module named -``Foo``. - -Each module has the structure -``` -moduletypename = - Inherits ** -- optional - open Opens in -- optional - { Judgements } -``` -Inherits are names of modules of the same type. -Inheritance can be restricted: -``` - Mo[f,g], -- inherit only f,g from Mo - Lo-[f,g] -- inheris all but f,g from Lo -``` -Opens are possible in ``concrete`` and ``resource``. -They are names of modules of these two types, possibly -qualified: -``` - (M = Mo), -- refer to f as M.f or Mo.f - (Lo = Lo) -- refer to f as Lo.f -``` -Module types and judgements in them: -``` -abstract A -- cat, fun, def, data -concrete C of A -- lincat, lin, lindef, printname -resource R -- param, oper - -interface I -- like resource, but can have - oper f : T without definition -instance J of I -- like resource, defines opers - that I leaves undefined -incomplete -- functor: concrete that opens - concrete CI of A = one or more interfaces - open I in ... -concrete CJ of A = -- completion: concrete that - CI with instantiates a functor by - (I = J) instances of open interfaces -``` -The forms -``param``, ``oper`` -may appear in ``concrete`` as well, but are then -not inherited to extensions. - -All modules can moreover have ``flags`` and comments. -Comments have the forms -``` --- till the end of line -{- any number of lines between -} ---# used for compiler pragmas -``` -A ``concrete`` can be opened like a ``resource``. -It is translated as follows: -``` -cat C ---> oper C : Type = -lincat C = T T ** {lock_C : {}} - -fun f : G -> C ---> oper f : A* -> C* = \g -> -lin f = t t g ** {lock_C = <>} -``` -An ``abstract`` can be opened like an ``interface``. -Any ``concrete`` of it then works as an ``instance``. - - - -===Judgements=== - -``` -cat C -- declare category C -cat C (x:A)(y:B x) -- dependent category C -cat C A B -- same as C (x : A)(y : B) -fun f : T -- declare function f of type T -def f = t -- define f as t -def f p q = t -- define f by pattern matching -data C = f | g -- set f,g as constructors of C -data f : A -> C -- same as - fun f : A -> C; data C=f - -lincat C = T -- define lin.type of cat C -lin f = t -- define lin. of fun f -lin f x y = t -- same as lin f = \x y -> t -lindef C = \s -> t -- default lin. of cat C -printname fun f = s -- printname shown in menus -printname cat C = s -- printname shown in menus -printname f = s -- same as printname fun f = s - -param P = C | D Q R -- define parameter type P - with constructors - C : P, D : Q -> R -> P -oper h : T = t -- define oper h of type T -oper h = t -- omit type, if inferrable - -flags p=v -- set value of flag p -``` -Judgements are terminated by semicolons (``;``). -Subsequent judgments of the same form may share the -keyword: -``` -cat C ; D ; -- same as cat C ; cat D ; -``` -Judgements can also share RHS: -``` -fun f,g : A -- same as fun f : A ; g : A -``` - - -===Types=== - -Abstract syntax (in ``fun``): -``` -C -- basic type, if cat C -C a b -- basic type for dep. category -(x : A) -> B -- dep. functions from A to B -(_ : A) -> B -- nondep. functions from A to B -(p,q : A) -> B -- same as (p : A)-> (q : A) -> B -A -> B -- same as (_ : A) -> B -Int -- predefined integer type -Float -- predefined float type -String -- predefined string type -``` -Concrete syntax (in ``lincat``): -``` -Str -- token lists -P -- parameter type, if param P -P => B -- table type, if P param. type -{s : Str ; p : P}-- record type -{s,t : Str} -- same as {s : Str ; t : Str} -{a : A} **{b : B}-- record type extension, same as - {a : A ; b : B} -A * B * C -- tuple type, same as - {p1 : A ; p2 : B ; p3 : C} -Ints n -- type of n first integers -``` -Resource (in ``oper``): all those of concrete, plus -``` -Tok -- tokens (subtype of Str) -A -> B -- functions from A to B -Int -- integers -Strs -- list of prefixes (for pre) -PType -- parameter type -Type -- any type -``` -As parameter types, one can use any finite type: -``P`` defined in ``param P``, -``Ints n``, and record types of parameter types. - - - -===Expressions=== - -Syntax trees = full function applications -``` -f a b -- : C if fun f : A -> B -> C -1977 -- : Int -3.14 -- : Float -"foo" -- : String -``` -Higher-Order Abstract syntax (HOAS): functions as arguments: -``` -F a (\x -> c) -- : C if a : A, c : C (x : B), - fun F : A -> (B -> C) -> C -``` -Tokens and token lists -``` -"hello" -- : Tok, singleton Str -"hello" ++ "world" -- : Str -["hello world"] -- : Str, same as "hello" ++ "world" -"hello" + "world" -- : Tok, computes to "helloworld" -[] -- : Str, empty list -``` -Parameters -``` -Sg -- atomic constructor -VPres Sg P2 -- applied constructor -{n = Sg ; p = P3} -- record of parameters -``` -Tables -``` -table { -- by full branches - Sg => "mouse" ; - Pl => "mice" - } -table { -- by pattern matching - Pl => "mice" ; - _ => "mouse" -- wildcard pattern - } -table { - n => regn n "cat" -- variable pattern - } -table Num {...} -- table given with arg. type -table ["ox"; "oxen"] -- table as course of values -\\_ => "fish" -- same as table {_ => "fish"} -\\p,q => t -- same as \\p => \\q => t - -t ! p -- select p from table t -case e of {...} -- same as table {...} ! e -``` -Records -``` -{s = "Liz"; g = Fem} -- record in full form -{s,t = "et"} -- same as {s = "et";t= "et"} -{s = "Liz"} ** -- record extension: same as - {g = Fem} {s = "Liz" ; g = Fem} - -<a,b,c> -- tuple, same as {p1=a;p2=b;p3=c} -``` -Functions -``` -\x -> t -- lambda abstract -\x,y -> t -- same as \x -> \y -> t -\x,_ -> t -- binding not in t -``` -Local definitions -``` -let x : A = d in t -- let definition -let x = d in t -- let defin, type inferred -let x=d ; y=e in t -- same as - let x=d in let y=e in t -let {...} in t -- same as let ... in t - -t where {...} -- same as let ... in t -``` -Free variation -``` -variants {x ; y} -- both x and y possible -variants {} -- nothing possible -``` -Prefix-dependent choices -``` -pre {"a" ; "an" / v} -- "an" before v, "a" otherw. -strs {"a" ; "i" ;"o"}-- list of condition prefixes -``` -Typed expression -``` -<t:T> -- same as t, to help type inference -``` -Accessing bound variables in ``lin``: use fields ``$1, $2, $3,...``. -Example: -``` -fun F : (A : Set) -> (El A -> Prop) -> Prop ; -lin F A B = {s = ["for all"] ++ A.s ++ B.$1 ++ B.s} -``` - - -===Pattern matching=== - -These patterns can be used in branches of ``table`` and -``case`` expressions. Patterns are matched in the order in -which they appear in the grammar. -``` -C -- atomic param constructor -C p q -- param constr. applied to patterns -x -- variable, matches anything -_ -- wildcard, matches anything -"foo" -- string -56 -- integer -{s = p ; y = q} -- record, matches extensions too -<p,q> -- tuple, same as {p1=p ; p2=q} -p | q -- disjunction, binds to first match -x@p -- binds x to what p matches -- p -- negation -p + "s" -- sequence of two string patterns -p* -- repetition of a string pattern -``` - -===Sample library functions=== - -``` --- lib/prelude/Predef.gf -drop : Int -> Tok -> Tok -- drop prefix of length -take : Int -> Tok -> Tok -- take prefix of length -tk : Int -> Tok -> Tok -- drop suffix of length -dp : Int -> Tok -> Tok -- take suffix of length -occur : Tok -> Tok -> PBool -- test if substring -occurs : Tok -> Tok -> PBool -- test if any char occurs -show : (P:Type) -> P ->Tok -- param to string -read : (P:Type) -> Tok-> P -- string to param -toStr : (L:Type) -> L ->Str -- find "first" string - --- lib/prelude/Prelude.gf -param Bool = True | False -oper - SS : Type -- the type {s : Str} - ss : Str -> SS -- construct SS - cc2 : (_,_ : SS) -> SS -- concat SS's - optStr : Str -> Str -- string or empty - strOpt : Str -> Str -- empty or string - bothWays : Str -> Str -> Str -- X++Y or Y++X - init : Tok -> Tok -- all but last char - last : Tok -> Tok -- last char - prefixSS : Str -> SS -> SS - postfixSS : Str -> SS -> SS - infixSS : Str -> SS -> SS -> SS - if_then_else : (A : Type) -> Bool -> A -> A -> A - if_then_Str : Bool -> Str -> Str -> Str -``` - - -===Flags=== - -Flags can appear, with growing priority, -- in files, judgement ``flags`` and without dash (``-``) -- as flags to ``gf`` when invoked, with dash -- as flags to various GF commands, with dash - - -Some common flags used in grammars: -``` -startcat=cat use this category as default - -lexer=literals int and string literals recognized -lexer=code like program code -lexer=text like text: spacing, capitals -lexer=textlit text, unknowns as string lits - -unlexer=code like program code -unlexer=codelit code, remove string lit quotes -unlexer=text like text: punctuation, capitals -unlexer=textlit text, remove string lit quotes -unlexer=concat remove all spaces -unlexer=bind remove spaces around "&+" - -optimize=all_subs best for almost any concrete -optimize=values good for lexicon concrete -optimize=all usually good for resource -optimize=noexpand for resource, if =all too big -``` -For the full set of values for ``FLAG``, -use on-line ``h -FLAG``. - - - -===File import search paths=== - -Colon-separated list of directories searched in the -given order: -``` ---# -path=.:../abstract:../common:prelude -``` -This can be (in order of increasing priority), as -first line in the file, as flag to ``gf`` -when invoked, or as flag to the ``i`` command. -The prefix ``--#`` is used only in files. - -GF attempts to satisfy an ``import`` command by searching for the -import filename in the above search paths, initially qualified -relative to the current working directory. If the file is not found in -that initial expansion, the search paths are re-qualified relative to -the directories given in the ``GF_LIB_PATH`` environment variable. If -``GF_LIB_PATH`` is not defined, its default value is -``/usr/local/share/gf-3.9/lib`` (assuming you have GF version 3.9). - -If your GF resource grammar libraries are installed somewhere else, -you will want to set ``GF_LIB_PATH`` to point there instead. In a -pinch, you can point to the ``GF/lib/src/`` folder in your clone of -the GF source code repository. - -Developers of resource grammars may find it useful to define multiple -directories, colon-separated, in ``GF_LIB_PATH``. - - -===Alternative grammar formats=== - -**Old GF** (before GF 2.0): -all judgements in any kinds of modules, -division into files uses ``include``s. -A file ``Foo.gf`` is recognized as the old format -if it lacks a module header. - -**Context-free** (file ``foo.cf``). The form of rules is e.g. -``` -Fun. S ::= NP "is" AP ; -``` -If ``Fun`` is omitted, it is generated automatically. -Rules must be one per line. The RHS can be empty. - -**Extended BNF** (file ``foo.ebnf``). The form of rules is e.g. -``` -S ::= (NP+ ("is" | "was") AP | V NP*) ; -``` -where the RHS is a regular expression of categories -and quoted tokens: ``"foo", CAT, T U, T|U, T*, T+, T?``, or empty. -Rule labels are generated automatically. - - -**Probabilistic grammars** (not a separate format). -You can set the probability of a function ``f`` (in its value category) by -``` ---# prob f 0.009 -``` -These are put into a file given to GF using the ``probs=File`` flag -on command line. This file can be the grammar file itself. - -**Example-based grammars** (file ``foo.gfe``). Expressions of the form -``` -in Cat "example string" -``` -are preprocessed by using a parser given by the flag -``` ---# -resource=File -``` -and the result is written to ``foo.gf``. - - -===References=== - -[GF Homepage http://www.grammaticalframework.org/] - -A. Ranta, Grammatical Framework: A Type-Theoretical Grammar Formalism. -//The Journal of Functional Programming//, vol. 14:2. 2004, pp. 145-189. diff --git a/download/index.md b/download/index.md index 6bea6bba4..5ea18bf90 100644 --- a/download/index.md +++ b/download/index.md @@ -2,23 +2,23 @@ title: Grammatical Framework Download and Installation ... -**GF 4.0.0** was released on 28 November 2018. +**GF 3.10** was released on 28 November 2018. It is the first version of GF which _does not include the RGL_. -What's new? See the [release notes](release-4.0.0.html). +What's new? See the [release notes](release-3.10.html). ## Binary packages All binary releases are now hosted on [GitHub](https://github.com/GrammaticalFramework/gf-core/releases). -| Platform | Download | Features | How to install | -|:----------------|:---------------------------------------------------------------|:-----------|:------------------------------------------------------------| -| macOS | [gf-4.0.0.pkg](gf-4.0.0.pkg) | GF,S,C,J,P | Double-click on the package icon | -| macOS | [gf-4.0.0-bin-intel-mac.tar.gz](gf-4.0.0-bin-intel-mac.tar.gz) | GF,S,C,J,P | `sudo tar -C /usr/local -zxf gf-4.0.0-bin-intel-mac.tar.gz` | -| Raspian 9.1 | [gf\_4.0.0-1\_armhf.deb](gf_4.0.0-1_armhf.deb) | GF,S,C,J,P | `sudo dpkg -i gf_4.0.0-1_armhf.deb` | -| Ubuntu (32-bit) | [gf\_4.0.0-1\_i386.deb](gf_4.0.0-1_i386.deb) | GF,S,C,J,P | `sudo dpkg -i gf_4.0.0-1_i386.deb` | -| Ubuntu (64-bit) | [gf\_4.0.0-1\_amd64.deb](gf_4.0.0-1_amd64.deb) | GF,S,C,J,P | `sudo dpkg -i gf_4.0.0-1_amd64.deb` | -| Windows | [gf-4.0.0-bin-windows.zip](gf-4.0.0-bin-windows.zip) | GF,S | `unzip gf-4.0.0-bin-windows.zip` | +| Platform | Download | Features | How to install | +|:----------------|:-------------------------------------------------------------|:-----------|:-----------------------------------------------------------| +| macOS | [gf-3.10.pkg](gf-3.10.pkg) | GF,S,C,J,P | Double-click on the package icon | +| macOS | [gf-3.10-bin-intel-mac.tar.gz](gf-3.10-bin-intel-mac.tar.gz) | GF,S,C,J,P | `sudo tar -C /usr/local -zxf gf-3.10-bin-intel-mac.tar.gz` | +| Raspian 9.1 | [gf\_3.10-1\_armhf.deb](gf_3.10-1_armhf.deb) | GF,S,C,J,P | `sudo dpkg -i gf_3.10-1_armhf.deb` | +| Ubuntu (32-bit) | [gf\_3.10-1\_i386.deb](gf_3.10-1_i386.deb) | GF,S,C,J,P | `sudo dpkg -i gf_3.10-1_i386.deb` | +| Ubuntu (64-bit) | [gf\_3.10-1\_amd64.deb](gf_3.10-1_amd64.deb) | GF,S,C,J,P | `sudo dpkg -i gf_3.10-1_amd64.deb` | +| Windows | [gf-3.10-bin-windows.zip](gf-3.10-bin-windows.zip) | GF,S | `unzip gf-3.10-bin-windows.zip` | **Features** diff --git a/download/release-3.10.md b/download/release-3.10.md new file mode 100644 index 000000000..574f82f94 --- /dev/null +++ b/download/release-3.10.md @@ -0,0 +1,16 @@ +--- +title: GF 4.0.0 Release Notes +date: 28 November 2018 +... + +## Installation + +See the [download page](index.html). + +## What's new + +- In this release, the GF "core" (compiler and runtimes) have been split from the RGL. + +### Other + +- A lot of repository cleanup diff --git a/download/release-4.0.0.md b/download/release-4.0.0.md deleted file mode 100644 index 574f82f94..000000000 --- a/download/release-4.0.0.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: GF 4.0.0 Release Notes -date: 28 November 2018 -... - -## Installation - -See the [download page](index.html). - -## What's new - -- In this release, the GF "core" (compiler and runtimes) have been split from the RGL. - -### Other - -- A lot of repository cleanup diff --git a/index.html b/index.html index 2621782a1..e7dd297b6 100644 --- a/index.html +++ b/index.html @@ -24,55 +24,43 @@ <div class="row"> - <div class="col-sm-6 col-md-3 offset-md-1"> - <h3>Use</h3> - <a href="download/index.html" class="btn btn-primary mb-2"> - <i class="fas fa-download mr-1"></i> - Download GF - </a> + <div class="col-sm-6 col-md-3"> + <h3>Get started</h3> <ul> - <li><a href="http://cloud.grammaticalframework.org/">GF Cloud</a></li> - <!-- <li><a href="demos/index.html">Other Demos</a></li> --> + <li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li> + <li> + <a href="http://cloud.grammaticalframework.org/"> + GF Cloud + <img src="http://www.grammaticalframework.org/src/www/P/gf-cloud.png" style="height:30px" class="ml-2"> + </a> + </li> + <li><a href="doc/tutorial/gf-tutorial.html">Tutorial</a></li> </ul> - <h4>Community</h4> - <ul> - <li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li> - <li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li> - <li><a href="doc/gf-people.html">Authors</a></li> - <li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li> - </ul> + <a href="download/index.html" class="btn btn-primary mb-3"> + <i class="fas fa-download mr-1"></i> + Download GF + </a> </div> - <div class="col-sm-6 col-md-4"> - <h3>Learn</h3> + <div class="col-sm-6 col-md-3"> + <h3>Learn more</h3> - <a href="lib/doc/synopsis/index.html" class="btn btn-primary mb-2"> - <i class="fab fa-readme mr-1"></i> - RGL Library Synopsis - </a> <ul> - <li><a href="doc/tutorial/gf-tutorial.html">Tutorial</a></li> <li><a href="gf-book">The GF Book</a></li> <li><a href="doc/gf-refman.html">Reference Manual</a></li> <li><a href="doc/gf-shell-reference.html">Shell Reference</a></li> - <li><a href="doc/gf-quickstart.html">Quick Start</a></li> - <li><a href="doc/gf-reference.html">Quick Reference</a></li> - </ul> - - <h4>Other resources</h4> - <ul> - <li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li> <li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a> <small>[PDF]</small></li> - <li><a href="doc/gf-lrec-2010.pdf">Library Tutorial</a> <small>[PDF]</small></li> </ul> + + <a href="lib/doc/synopsis/index.html" class="btn btn-primary mb-2"> + <i class="fab fa-readme mr-1"></i> + RGL Library Synopsis + </a> </div> - <div class="col-sm-6 col-md-4"> + + <div class="col-sm-6 col-md-3"> <h3>Develop</h3> - <a href="https://github.com/GrammaticalFramework/" class="btn btn-primary mb-2"> - <i class="fab fa-github mr-1"></i> - GF on GitHub - </a> <ul> <li><a href="doc/gf-developers.html">Developers Guide</a></li> <!-- <li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a></li> --> @@ -84,6 +72,21 @@ <li><a href="doc/gf-editor-modes.html">Text Editor Support</a></li> </ul> </div> + + <div class="col-sm-6 col-md-3"> + <h3>Contribute</h3> + <ul> + <li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li> + <li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li> + <li><a href="doc/gf-people.html">Authors</a></li> + <li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li> + </ul> + <a href="https://github.com/GrammaticalFramework/" class="btn btn-primary mb-2"> + <i class="fab fa-github mr-1"></i> + GF on GitHub + </a> + </div> + </div> <!-- <div class=links> @@ -231,8 +234,8 @@ least one, it may help you to get a first idea of what GF is. </dd> <dt class="col-sm-3 text-center">2018-11-28</dt> <dd class="col-sm-9"> - <strong>GF 4.0.0 released.</strong> - <a href="download/release-4.0.0.html">Release notes</a> + <strong>GF 3.10 released.</strong> + <a href="download/release-3.10.html">Release notes</a> </dd> <dt class="col-sm-3 text-center">2018-07-25</dt> <dd class="col-sm-9"> -- cgit v1.2.3 From 6278deb7a206ed8b0e9660eac3633a6ae7572783 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" <john@johnjcamilleri.com> Date: Wed, 28 Nov 2018 21:51:16 +0100 Subject: Page uses available width better, no jumping margins --- bin/_template.html | 2 +- doc/gf-refman.html | 2 +- index.html | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index 115683a73..abbd462d8 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -29,7 +29,7 @@ $for(header-includes)$ $endfor$ </head> <body> -<div class="container my-5"> +<div class="container-fluid my-5" style="max-width:1200px"> $if(title)$ <header id="title-block-header"> diff --git a/doc/gf-refman.html b/doc/gf-refman.html index 687e3e490..d052787f4 100644 --- a/doc/gf-refman.html +++ b/doc/gf-refman.html @@ -15,7 +15,7 @@ </style> </HEAD> <BODY> -<div class="container my-5"> +<div class="container-fluid my-5" style="max-width:1200px"> <P ALIGN="center"> <CENTER> diff --git a/index.html b/index.html index e7dd297b6..6c79ec1cf 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ </head> <body> -<div class="container"> +<div class="container-fluid" style="max-width:1200px"> <div class="m-4 text-center"> <img style="height:250px" src="doc/Logos/gf1.svg" alt="GF Logo"> @@ -55,7 +55,7 @@ <a href="lib/doc/synopsis/index.html" class="btn btn-primary mb-2"> <i class="fab fa-readme mr-1"></i> - RGL Library Synopsis + RGL Synopsis </a> </div> -- cgit v1.2.3 From 9e02319b6df1c26bb77d8b6d87726f8e3836e9cc Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" <john@johnjcamilleri.com> Date: Wed, 28 Nov 2018 22:14:58 +0100 Subject: Better responsiveness, homepage and footer --- bin/_template.html | 13 ++++++++----- index.html | 35 +++++++++++------------------------ 2 files changed, 19 insertions(+), 29 deletions(-) (limited to 'bin') diff --git a/bin/_template.html b/bin/_template.html index abbd462d8..9e966857a 100644 --- a/bin/_template.html +++ b/bin/_template.html @@ -59,7 +59,8 @@ $body$ <footer class="bg-light mt-5 py-5"> <div class="container"> <div class="row"> - <div class="col-3"> + + <div class="col-6 col-sm-3"> <a href="$rel-root$"> <i class="fas fa-home"></i> Home @@ -72,7 +73,8 @@ $body$ <li><a href="$rel-root$/download">Download GF</a></li> </ul> </div> - <div class="col-3"> + + <div class="col-6 col-sm-3"> <h6 class="text-muted">Learn more</h6> <ul class="list-unstyled"> <li><a href="$rel-root$/gf-book">The GF Book</a></li> @@ -82,7 +84,8 @@ $body$ <li><a href="$rel-root$/lib/doc/synopsis/index.html">RGL Library Synopsis</a></li> </ul> </div> - <div class="col-3"> + + <div class="col-6 col-sm-3"> <h6 class="text-muted">Develop</h6> <ul class="list-unstyled"> <li><a href="$rel-root$/doc/gf-developers.html">Developers Guide</a></li> @@ -92,7 +95,8 @@ $body$ <li><a href="$rel-root$/doc/gf-editor-modes.html">Text Editor Support</a></li> </ul> </div> - <div class="col-3"> + + <div class="col-6 col-sm-3"> <h6 class="text-muted">Contribute</i> </h6> <ul class="list-unstyled"> @@ -101,7 +105,6 @@ $body$ <li><a href="$rel-root$/doc/gf-people.html">Authors</a></li> <li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li> </ul> - <h6 class="text-muted"> Repositories <i class="fab fa-github ml-1"></i> diff --git a/index.html b/index.html index 6c79ec1cf..355853aef 100644 --- a/index.html +++ b/index.html @@ -14,15 +14,15 @@ </head> <body> -<div class="container-fluid" style="max-width:1200px"> +<div class="container-fluid my-5" style="max-width:1200px"> -<div class="m-4 text-center"> +<div class="text-center"> <img style="height:250px" src="doc/Logos/gf1.svg" alt="GF Logo"> - <h1 class="display-3" style="text-shadow: 1px 1px 5px #999;">Grammatical Framework</h1> + <h1 class="display-4" style="text-shadow: 1px 1px 5px #999; overflow-x: scroll">Grammatical Framework</h1> <h4 class="text-black-50">A programming language for multilingual grammar applications</h4> </div> -<div class="row"> +<div class="row my-4"> <div class="col-sm-6 col-md-3"> <h3>Get started</h3> @@ -37,7 +37,7 @@ <li><a href="doc/tutorial/gf-tutorial.html">Tutorial</a></li> </ul> - <a href="download/index.html" class="btn btn-primary mb-3"> + <a href="download/index.html" class="btn btn-primary ml-3"> <i class="fas fa-download mr-1"></i> Download GF </a> @@ -53,7 +53,7 @@ <li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a> <small>[PDF]</small></li> </ul> - <a href="lib/doc/synopsis/index.html" class="btn btn-primary mb-2"> + <a href="lib/doc/synopsis/index.html" class="btn btn-primary ml-3"> <i class="fab fa-readme mr-1"></i> RGL Synopsis </a> @@ -81,7 +81,7 @@ <li><a href="doc/gf-people.html">Authors</a></li> <li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li> </ul> - <a href="https://github.com/GrammaticalFramework/" class="btn btn-primary mb-2"> + <a href="https://github.com/GrammaticalFramework/" class="btn btn-primary ml-3"> <i class="fab fa-github mr-1"></i> GF on GitHub </a> @@ -89,19 +89,6 @@ </div> -<!-- <div class=links> - <h4>Related to GF</h4> - <ul> - <li><a href="http://school.grammaticalframework.org/"><strong>GF Summer School</strong></a></li> - <li><a href="http://www.postcrashgames.com/gf_world/">Coverage Map</a></li> - <li><a href="doc/gf-bibliography.html">Publications</a></li> - <li><a href="http://remu.grammaticalframework.org/">The REMU Project</a></li> - <li><a href="http://www.molto-project.eu">The MOLTO Project</a></li> - <li><a href="http://en.wikipedia.org/wiki/Grammatical_Framework">GF on Wikipedia</a></li> - <li><p><a href="Http://www.digitalgrammars.com/">Digital Grammars AB</a></li> - </ul> -</div> --> - <h2>What is GF?</h2> <p> GF, Grammatical Framework, is a programming language for @@ -157,7 +144,7 @@ least one, it may help you to get a first idea of what GF is. <div class="row"> - <div class="col-sm-6"> + <div class="col-md-6"> <h2>Applications & Availability</h2> <p> GF can be used for building @@ -169,8 +156,8 @@ least one, it may help you to get a first idea of what GF is. </p> <p> - GF is <strong>open-source</strong>, licensed under <a href="liCENSE">GPL</a> (the program) and - <a href="./liCENSE">LGPL</a> and <a href="./liCENSE">BSD</a> (the libraries). It + GF is <strong>open-source</strong>, licensed under <a href="LICENSE">GPL</a> (the program) and + <a href="LICENSE">LGPL</a> and <a href="LICENSE">BSD</a> (the libraries). It is available for </p> <ul> @@ -224,7 +211,7 @@ least one, it may help you to get a first idea of what GF is. </div> - <div class="col-sm-6"> + <div class="col-md-6"> <h2>News</h2> <dl class="row"> -- cgit v1.2.3