packages feed

claferwiki 0.4.4 → 0.4.5

raw patch · 13 files changed

+1011/−1013 lines, 13 filesdep ~clafersetup-changedPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: clafer

API changes (from Hackage documentation)

Files

CHANGES.md view
@@ -1,59 +1,63 @@-* claferwiki Version 0.4.4 released on Jun 23, 2016
-
-[Release](https://github.com/gsdlab/claferwiki/pull/15)
-
-* claferwiki Version 0.4.3 released on Dec 22, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/14)
-
-* claferwiki Version 0.4.2.1 released on Oct 20, 2015
-
-Updated to clafer 0.4.2.1, added stack instructions to README.
-
-* claferwiki Version 0.4.2 released on Oct 16, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/13)
-
-* claferwiki Version 0.4.1 released on Sep 1, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/12)
-
-* claferwiki Version 0.4.0 released on Jul 28, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/11)
-
-* claferwiki Version 0.3.10 released on April 24, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/10)
-
-* claferwiki Version 0.3.9 released on March 06, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/9)
-
-* claferwiki Version 0.3.8 released on January 27, 2015
-
-[Release](https://github.com/gsdlab/claferwiki/pull/8)
-
-* claferwiki Version 0.3.7 released on October 23, 2014
-
-[Release](https://github.com/gsdlab/claferwiki/pull/7)
-
-* claferwiki Version 0.3.6.1 released on July 08, 2014
-
-[Release](https://github.com/gsdlab/claferwiki/pull/6)
-
-* claferwiki Version 0.3.6 released on May 23, 2014
-
-[Release](https://github.com/gsdlab/claferwiki/pull/5)
-
-* claferwiki Version 0.3.5 released on January 20, 2014
-
-[Release](https://github.com/gsdlab/claferwiki/pull/4)
-
-* claferwiki Version 0.3.4 released on September 20, 2013
-
-[Release Diff](https://github.com/gsdlab/claferwiki/compare/61a313dd9f65c0a378d97bb4e04be2464af7dbe5...b705ad9744502d15ae39d8503808914c5e798d8d)
-
-* claferwiki Version 0.3.3 released on August 14, 2013
-
-[Release](https://github.com/gsdlab/claferwiki/pull/1)
+* claferwiki Version 0.4.5 released on Mar 13, 2017++[Release](https://github.com/gsdlab/claferwiki/pull/18)++* claferwiki Version 0.4.4 released on Jun 23, 2016++[Release](https://github.com/gsdlab/claferwiki/pull/15)++* claferwiki Version 0.4.3 released on Dec 22, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/14)++* claferwiki Version 0.4.2.1 released on Oct 20, 2015++Updated to clafer 0.4.2.1, added stack instructions to README.++* claferwiki Version 0.4.2 released on Oct 16, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/13)++* claferwiki Version 0.4.1 released on Sep 1, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/12)++* claferwiki Version 0.4.0 released on Jul 28, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/11)++* claferwiki Version 0.3.10 released on April 24, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/10)++* claferwiki Version 0.3.9 released on March 06, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/9)++* claferwiki Version 0.3.8 released on January 27, 2015++[Release](https://github.com/gsdlab/claferwiki/pull/8)++* claferwiki Version 0.3.7 released on October 23, 2014++[Release](https://github.com/gsdlab/claferwiki/pull/7)++* claferwiki Version 0.3.6.1 released on July 08, 2014++[Release](https://github.com/gsdlab/claferwiki/pull/6)++* claferwiki Version 0.3.6 released on May 23, 2014++[Release](https://github.com/gsdlab/claferwiki/pull/5)++* claferwiki Version 0.3.5 released on January 20, 2014++[Release](https://github.com/gsdlab/claferwiki/pull/4)++* claferwiki Version 0.3.4 released on September 20, 2013++[Release Diff](https://github.com/gsdlab/claferwiki/compare/61a313dd9f65c0a378d97bb4e04be2464af7dbe5...b705ad9744502d15ae39d8503808914c5e798d8d)++* claferwiki Version 0.3.3 released on August 14, 2013++[Release](https://github.com/gsdlab/claferwiki/pull/1)
LICENSE view
@@ -1,17 +1,19 @@-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+Copyright 2012-2017 Generative Software Development Lab <http://gsd.uwaterloo.ca>++Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies+of the Software, and to permit persons to whom the Software is furnished to do+so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
Makefile view
@@ -1,30 +1,30 @@-all:
-	stack build
-
-install:
-	stack install
-	stack install gitit
-	@if test ! -d ".git"; then \
-		cp -f  -r .git $(to); \
-	fi
-	mkdir -p $(to)
-	cp -f stack.yaml $(to)
-	cp -f  gitit.cnf $(to)
-	cp -f  claferwiki.sh $(to)
-	chmod +x $(to)/claferwiki.sh
-	cp -f  README.md $(to)
-	mkdir -p $(to)/static/img
-	cp -f  static/img/logo.png $(to)/static/img
-	mkdir -p $(to)/static/css
-	cp -f  static/css/custom.css $(to)/static/css/custom.css
-	cp -f  static/css/clafer.css $(to)/static/css/clafer.css
-
-update:
-	cp -f  claferwiki.sh $(to)
-	cp -f  README.md $(to)
-	cp -f  static/img/logo.png $(to)/static/img
-	cp -f  static/css/custom.css $(to)/static/css/custom.css
-	cp -f  static/css/clafer.css $(to)/static/css/clafer.css
-
-clean:
-	stack clean
+all:+	stack build++install:+	stack install+	stack install gitit+	@if test ! -d ".git"; then \+		cp -f  -r .git $(to); \+	fi+	mkdir -p $(to)+	cp -f stack.yaml $(to)+	cp -f  gitit.cnf $(to)+	cp -f  claferwiki.sh $(to)+	chmod +x $(to)/claferwiki.sh+	cp -f  README.md $(to)+	mkdir -p $(to)/static/img+	cp -f  static/img/logo.png $(to)/static/img+	mkdir -p $(to)/static/css+	cp -f  static/css/custom.css $(to)/static/css/custom.css+	cp -f  static/css/clafer.css $(to)/static/css/clafer.css++update:+	cp -f  claferwiki.sh $(to)+	cp -f  README.md $(to)+	cp -f  static/img/logo.png $(to)/static/img+	cp -f  static/css/custom.css $(to)/static/css/custom.css+	cp -f  static/css/clafer.css $(to)/static/css/clafer.css++clean:+	stack clean
README.md view
@@ -1,161 +1,161 @@-# Claferwiki
-
-##### v0.4.4
-
-**Claferwiki** is a wiki system integrated with [Clafer compiler](https://github.com/gsdlab/clafer). [Clafer](http://clafer.org) is a lightweight yet powerful structural modeling language. Claferwiki allows for embedding Clafer model fragments in wiki pages and provides model authoring support including code highlighting, parse and semantic error reporting, hyperlinking from identifier use to its definition, and graphical view rendering.
-
-Claferwiki supports informal-to-formal modeling, that is, gradually refining parts of specification in natural language into a Clafer model fragments. Claferwiki supports *literate modeling* - both the rich text and the model fragments can be freely mixed. Informal-to-formal modeling is important during domain modeling.
-
-Also, Claferwiki acts as a collaborative, lightweight, web-based model publishing environment for Clafer.
-In addition to code highlighting, error reporting, hyperlinking, and graphical view rendering, it also provides model versioning and distributed online/offline editing capabilities as it is based on the Git distributed version control system and the [Gitit wiki](http://gitit.net/).
-
-Claferwiki is also integrated with other Clafer Web Tools, allowing to open the current page in:
-
-* Clafer Integrated Development Environment ([ClaferIDE](https://github.com/gsdlab/claferIDE)),
-* Clafer Configurator ([ClaferConfigurator](https://github.com/gsdlab/ClaferConfigurator)),
-* Multi-Objective [Visualizer and Explorer](https://github.com/gsdlab/ClaferMooVisualizer)
-
-### Live demo
-
-[Try me!](http://t3-necsis.cs.uwaterloo.ca:8091/)
-
-If the demo is down or you encounter a bug, please email [Michal Antkiewicz](mailto:mantkiew@gsd.uwaterloo.ca).
-
-## Contributors
-
-* [Michał Antkiewicz](http://gsd.uwaterloo.ca/mantkiew), Main developer. Requirements, development, architecture, testing, technology transfer.
-* Chris Walker, co-op student May-Aug, 2012. Developer of Clafer Wiki, HTML and GraphViz generators.
-* [Jimmy Liang](http://gsd.uwaterloo.ca/jliang), Clafer compiler support, including multi-fragment compilation, source/AST/IR traceability, parsing and compilation error reporting.
-
-## Getting the Clafer Wiki
-
-Clafer can be installed either from Hackage or from the source code.
-
-### Dependencies for running
-
-Regardless of the installation method, the following are required:
-
-* [Clafer compiler](https://github.com/gsdlab/clafer/) v0.4.4
-* [GHC](https://www.haskell.org/downloads) >= v7.10.*
-* [Git](http://git-scm.com)
-* [Gitit wiki](http://gitit.net) v0.12.1.1
-* GraphViz
-
-### Installation from Hackage
-
-Claferwiki is now available on [Hackage](http://hackage.haskell.org/package/claferwiki-0.4.4/) and it can be installed using either [`stack`](https://github.com/commercialhaskell/stack) or [`cabal-install`](https://hackage.haskell.org/package/cabal-install).
-
-#### Installation using `stack`
-
-Stack is the only requirement: no other Haskell tooling needs to be installed because stack will automatically install everything that's needed.
-
-1. `stack update`
-2. `stack install claferwiki`
-
-#### Installation using `cabal-install`
-
-1. `cabal update`
-2. `cabal install claferwiki-0.4.4 -fhighlighting -fhttps -fplugins -fnetwork-uri`
-3. `cd <cabal's lib or share folder>`  (`C:\Users\<user>\AppData\Roaming\cabal\i386-windows-ghc-8.0.1\claferwiki-0.4.4` on Windows or `.cabal/share/x86_64-linux-ghc-8.0.1/claferwiki-0.4.4/` on Linux)
-  * execute `make install to=<target directory>`
-  * this will copy the wiki files
-
-### Important: branches must correspond
-
-All related projects are following the *simultaneous release model*.
-The branch `master` contains releases, whereas the branch `develop` contains code under development.
-When building the tools, the branches should match.
-Releases from branches 'master` are guaranteed to work well together.
-Development versions from branches `develop` should work well together but this might not always be the case.
-
-### Installation from source code
-
-1. In some `<source directory>` where you want to have the wiki source code
-   * execute `git clone git://github.com/gsdlab/claferwiki.git`
-2. execute `stack update`
-3. execute `make init`
-4. [install clafer from source code](https://github.com/gsdlab/clafer#installation-from-the-source-code)
-4. execute `make`
-5. execute `make install to=<target directory>`
-  * this will copy the wiki files
-6. in `<target directory>`, execute `git init` to create a git repository for the wiki data
-  * NOTE: see `repository-path:` option in `gitit.cnf`
-
-
-# Usage
-
-Wiki can be configured by editing the `gitit.cnf` file. See [Configuring and customizing gitit](http://gitit.net/README#configuring-and-customizing-gitit).
-
-#### Installation using `stack`
-
-* in the `<target directory>` execute `stack exec gitit -- -f gitit.cnf` to start the wiki server.
-
-#### Using `cabal-install`
-
-* in the `<target directory>` execute `claferwiki.sh` to start the wiki server.
-
-The script can either use gitit and clafer installed in the user package space (default) or in the sandbox. The sandbox location can be provided using the parameter `--sandbox` as follows:
-
-* `./claferwiki.sh --sandbox <relative or absolute path to the sandbox>`, or
-* `./claferwiki.sh --sandbox` which will use the default sandbox location `../.clafertools-cabal-sandbox`
-
-## Update
-
-* in the `<source directory>` execute `git pull`
-* execute `make update to=<target directory>`
-  * this will keep the directory structure and your existing git repository with the wiki contents
-
-## Features
-
-<a href="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-1.png">
-<img src="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-1.png" width="30%" alt="Telematics Example, Module Overview">
-</a>
-<a href="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-2.png">
-<img src="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-2.png" width="30%" alt="Telematics Example, Module Details" >
-</a>
-
-* syntax coloring for Clafer models
-* linking from clafer name references within model fragments to clafer definitions
-* linking from clafer names used in wiki text to clafer definitions
-* pop-up information about clafers in graph rendering
-* translating constraints to controlled natural language and showing as pop-up?
-* overview with graph rendering, statistics, and download links for the entire model source and self-contained HTML rendering
-* integration with ClaferMooVisualizer
-
-## Using Clafer Wiki
-
-For general usage information for the GitIt wiki see the [README](http://gitit.net/README).
-
-You can insert code blocks with clafer code anywhere in the page as follows:
-
-
-\`\`\`clafer
-
-`<here goes your model fragment>`
-
-\`\`\`
-
-The model overview, including the graph, stats, and download links, can be added as follows:
-
-\`\`\` `{.clafer .summary}`
-
-`<the contents in this block are ignored>`
-
-\`\`\`
-
-To have the code blocks correctly processed, make sure to add an empty line before and after the code block, even if the code block is the last element on the page.
-
-## How it works
-
-* Clafer Wiki is a set of plugins for the GitIt wiki which processes clafer code blocks and invokes the Clafer compiler.
-* All code blocks on a single page are interpreted as a single module.
-* The Clafer compiler generates HTML rendering of each code block.
-* The rendering is enriched with:
-  * links to the definitions for super clafers (inheritance)
-  * links to the types of references
-  * compiler error highlights
-
-# Need help?
-
-* Visit [language's website](http://clafer.org).
-* Report issues to [issue tracker](https://github.com/gsdlab/claferwiki/issues)
+# Claferwiki++##### v0.4.5++**Claferwiki** is a wiki system integrated with [Clafer compiler](https://github.com/gsdlab/clafer). [Clafer](http://clafer.org) is a lightweight yet powerful structural modeling language. Claferwiki allows for embedding Clafer model fragments in wiki pages and provides model authoring support including code highlighting, parse and semantic error reporting, hyperlinking from identifier use to its definition, and graphical view rendering.++Claferwiki supports informal-to-formal modeling, that is, gradually refining parts of specification in natural language into a Clafer model fragments. Claferwiki supports *literate modeling* - both the rich text and the model fragments can be freely mixed. Informal-to-formal modeling is important during domain modeling.++Also, Claferwiki acts as a collaborative, lightweight, web-based model publishing environment for Clafer.+In addition to code highlighting, error reporting, hyperlinking, and graphical view rendering, it also provides model versioning and distributed online/offline editing capabilities as it is based on the Git distributed version control system and the [Gitit wiki](http://gitit.net/).++Claferwiki is also integrated with other Clafer Web Tools, allowing to open the current page in:++* Clafer Integrated Development Environment ([ClaferIDE](https://github.com/gsdlab/claferIDE)),+* Clafer Configurator ([ClaferConfigurator](https://github.com/gsdlab/ClaferConfigurator)),+* Multi-Objective [Visualizer and Explorer](https://github.com/gsdlab/ClaferMooVisualizer)++### Live demo++[Try me!](http://t3-necsis.cs.uwaterloo.ca:8091/)++If the demo is down or you encounter a bug, please email [Michal Antkiewicz](mailto:mantkiew@gsd.uwaterloo.ca).++## Contributors++* [Michał Antkiewicz](http://gsd.uwaterloo.ca/mantkiew), Main developer. Requirements, development, architecture, testing, technology transfer.+* Chris Walker, co-op student May-Aug, 2012. Developer of Clafer Wiki, HTML and GraphViz generators.+* [Jimmy Liang](http://gsd.uwaterloo.ca/jliang), Clafer compiler support, including multi-fragment compilation, source/AST/IR traceability, parsing and compilation error reporting.++## Getting the Clafer Wiki++Clafer can be installed either from Hackage or from the source code.++### Dependencies for running++Regardless of the installation method, the following are required:++* [Clafer compiler](https://github.com/gsdlab/clafer/) v0.4.5+* [GHC](https://www.haskell.org/downloads) >= v7.10.*+* [Git](http://git-scm.com)+* [Gitit wiki](http://hackage.haskell.org/package/gitit) v0.12.2.1+* GraphViz++### Installation from Hackage++Claferwiki is now available on [Hackage](http://hackage.haskell.org/package/claferwiki-0.4.5/) and it can be installed using either [`stack`](https://github.com/commercialhaskell/stack) or [`cabal-install`](https://hackage.haskell.org/package/cabal-install).++#### Installation using `stack`++Stack is the only requirement: no other Haskell tooling needs to be installed because stack will automatically install everything that's needed.++1. `stack update`+2. `stack install claferwiki`++#### Installation using `cabal-install`++1. `cabal update`+2. `cabal install claferwiki-0.4.5 -fhighlighting -fhttps -fplugins -fnetwork-uri`+3. `cd <cabal's lib or share folder>`  (`C:\Users\<user>\AppData\Roaming\cabal\i386-windows-ghc-8.0.2\claferwiki-0.4.5` on Windows or `.cabal/share/x86_64-linux-ghc-8.0.2/claferwiki-0.4.5/` on Linux)+  * execute `make install to=<target directory>`+  * this will copy the wiki files++### Important: branches must correspond++All related projects are following the *simultaneous release model*.+The branch `master` contains releases, whereas the branch `develop` contains code under development.+When building the tools, the branches should match.+Releases from branches 'master` are guaranteed to work well together.+Development versions from branches `develop` should work well together but this might not always be the case.++### Installation from source code++1. In some `<source directory>` where you want to have the wiki source code+   * execute `git clone git://github.com/gsdlab/claferwiki.git`+2. execute `stack update`+3. execute `make init`+4. [install clafer from source code](https://github.com/gsdlab/clafer#installation-from-the-source-code)+4. execute `make`+5. execute `make install to=<target directory>`+  * this will copy the wiki files+6. in `<target directory>`, execute `git init` to create a git repository for the wiki data+  * NOTE: see `repository-path:` option in `gitit.cnf`+++# Usage++Wiki can be configured by editing the `gitit.cnf` file. See [Configuring and customizing gitit](http://gitit.net/README#configuring-and-customizing-gitit).++#### Installation using `stack`++* in the `<target directory>` execute `stack exec gitit -- -f gitit.cnf` to start the wiki server.++#### Using `cabal-install`++* in the `<target directory>` execute `claferwiki.sh` to start the wiki server.++The script can either use gitit and clafer installed in the user package space (default) or in the sandbox. The sandbox location can be provided using the parameter `--sandbox` as follows:++* `./claferwiki.sh --sandbox <relative or absolute path to the sandbox>`, or+* `./claferwiki.sh --sandbox` which will use the default sandbox location `../.clafertools-cabal-sandbox`++## Update++* in the `<source directory>` execute `git pull`+* execute `make update to=<target directory>`+  * this will keep the directory structure and your existing git repository with the wiki contents++## Features++<a href="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-1.png">+<img src="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-1.png" width="30%" alt="Telematics Example, Module Overview">+</a>+<a href="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-2.png">+<img src="https://raw.github.com/gsdlab/claferwiki/master/spec/telematics-screenshot-2.png" width="30%" alt="Telematics Example, Module Details" >+</a>++* syntax coloring for Clafer models+* linking from clafer name references within model fragments to clafer definitions+* linking from clafer names used in wiki text to clafer definitions+* pop-up information about clafers in graph rendering+* translating constraints to controlled natural language and showing as pop-up?+* overview with graph rendering, statistics, and download links for the entire model source and self-contained HTML rendering+* integration with ClaferMooVisualizer++## Using Clafer Wiki++For general usage information for the GitIt wiki see the [README](http://gitit.net/README).++You can insert code blocks with clafer code anywhere in the page as follows:+++\`\`\`clafer++`<here goes your model fragment>`++\`\`\`++The model overview, including the graph, stats, and download links, can be added as follows:++\`\`\` `{.clafer .summary}`++`<the contents in this block are ignored>`++\`\`\`++To have the code blocks correctly processed, make sure to add an empty line before and after the code block, even if the code block is the last element on the page.++## How it works++* Clafer Wiki is a set of plugins for the GitIt wiki which processes clafer code blocks and invokes the Clafer compiler.+* All code blocks on a single page are interpreted as a single module.+* The Clafer compiler generates HTML rendering of each code block.+* The rendering is enriched with:+  * links to the definitions for super clafers (inheritance)+  * links to the types of references+  * compiler error highlights++# Need help?++* Visit [language's website](http://clafer.org).+* Report issues to [issue tracker](https://github.com/gsdlab/claferwiki/issues)
Setup.lhs view
@@ -1,4 +1,4 @@-#! /usr/bin/env runhaskell
-
-> import Distribution.Simple
+#! /usr/bin/env runhaskell++> import Distribution.Simple > main = defaultMain
claferwiki.cabal view
@@ -1,54 +1,55 @@-Name:                   claferwiki
-version:                0.4.4
-stability:              experimental
-author:                 Michał Antkiewicz, Chris Walker, Luke Michael Brown
-maintainer:             Michał Antkiewicz <mantkiew@gsd.uwaterloo.ca>
-synopsis:               A wiki-based IDE for literate modeling with Clafer
-description:            A wiki-based IDE for literate modeling with Clafer. A Plugin for the Gitit wiki which collects code blocks written in Clafer (.clafer), compiles them, renders into HTML and Dot, and replaces the code blocks with the results.
-homepage:               http://github.com/gsdlab/claferwiki
-category:               Wiki
-build-type:             Simple
-copyright:              Michal Antkiewicz, Chris Walker, Luke Michael Brown
-license:                MIT
-license-file:           LICENSE
-Tested-with:            GHC == 7.10.3
-                      , GHC == 8.0.1
-Cabal-version:          >= 1.22
-data-files:             claferwiki.sh
-                      , gitit.cnf
-                      , Makefile
-                      , README.md
-                      , CHANGES.md
-                      , static/img/logo.png
-                      , static/css/clafer.css
-                      , static/css/custom.css
-                      , templates/footer.st
-                      , stack.yaml
-source-repository head
-    type:               git
-    location:           git://github.com/gsdlab/claferwiki.git
-library
-  build-tools  :        ghc >= 7.10.3
-  default-language:     Haskell2010
-  build-depends:        base >= 4.7.0.1 && < 5
-                      , containers >= 0.5.5.1
-                      , directory >= 1.2.1.0
-                      , process >= 1.2.0.0
-                      , time >= 1.4.2
-                      , transformers >= 0.3.0.0
-
-                      , mtl >= 2.1.3.1
-                      , network >= 2.4.2.3
-                      , split >= 0.2.2
-
-                      , MissingH >= 1.3.0.1
-                      , network-uri >= 2.6.0.3
-                      , SHA >= 1.6.4.2
-                      , utf8-string >= 0.3.8
-                      , gitit >= 0.12.0.1
-                      , transformers-compat >= 0.3
-
-                      , clafer == 0.4.4
-  hs-source-dirs:       src
-  ghc-options:          -Wall -fno-warn-orphans
-  exposed-modules:      Network.Gitit.Plugin.ClaferWiki
+Name:                   claferwiki+version:                0.4.5+stability:              experimental+author:                 Michał Antkiewicz, Chris Walker, Luke Michael Brown+maintainer:             Michał Antkiewicz <mantkiew@gsd.uwaterloo.ca>+synopsis:               A wiki-based IDE for literate modeling with Clafer+description:            A wiki-based IDE for literate modeling with Clafer. A Plugin for the Gitit wiki which collects code blocks written in Clafer (.clafer), compiles them, renders into HTML and Dot, and replaces the code blocks with the results.+homepage:               http://github.com/gsdlab/claferwiki+category:               Wiki+build-type:             Simple+copyright:              Michal Antkiewicz, Chris Walker, Luke Michael Brown+license:                MIT+license-file:           LICENSE+Tested-with:            GHC == 7.10.3+                      , GHC == 8.0.1+                      , GHC == 8.0.2+Cabal-version:          >= 1.22+data-files:             claferwiki.sh+                      , gitit.cnf+                      , Makefile+                      , README.md+                      , CHANGES.md+                      , static/img/logo.png+                      , static/css/clafer.css+                      , static/css/custom.css+                      , templates/footer.st+                      , stack.yaml+source-repository head+    type:               git+    location:           git://github.com/gsdlab/claferwiki.git+library+  build-tools  :        ghc >= 7.10.3+  default-language:     Haskell2010+  build-depends:        base >= 4.7.0.1 && < 5+                      , containers >= 0.5.5.1+                      , directory >= 1.2.1.0+                      , process >= 1.2.0.0+                      , time >= 1.4.2+                      , transformers >= 0.3.0.0++                      , mtl >= 2.1.3.1+                      , network >= 2.4.2.3+                      , split >= 0.2.2++                      , MissingH >= 1.3.0.1+                      , network-uri >= 2.6.0.3+                      , SHA >= 1.6.4.2+                      , utf8-string >= 0.3.8+                      , gitit >= 0.12.0.1+                      , transformers-compat >= 0.3++                      , clafer == 0.4.5+  hs-source-dirs:       src+  ghc-options:          -Wall -fno-warn-orphans+  exposed-modules:      Network.Gitit.Plugin.ClaferWiki
claferwiki.sh view
@@ -1,12 +1,12 @@-echo "-----------------------------------------"
-echo "| ClaferWiki v0.4.4                     |"
-echo "| https://github.com/gsdlab/claferwiki/ |"
-echo "| By Michal Antkiewicz, Chris Walker    |"
-echo "| Generative Software Development Lab   |"
-echo "| Using `clafer -V`                    |"
-echo "-----------------------------------------"
-echo ""
-echo "Starting gitit..."
-echo ""
-
-stack exec gitit -- -f gitit.cnf
+echo "-----------------------------------------"+echo "| ClaferWiki v0.4.5                     |"+echo "| https://github.com/gsdlab/claferwiki/ |"+echo "| By Michal Antkiewicz, Chris Walker    |"+echo "| Generative Software Development Lab   |"+echo "| Using `clafer -V`                    |"+echo "-----------------------------------------"+echo ""+echo "Starting gitit..."+echo ""++stack exec gitit -- -f gitit.cnf
gitit.cnf view
@@ -1,297 +1,297 @@-# gitit wiki configuration file
-
-# address: 0.0.0.0
-# sets the IP address on which the web server will listen.
-
-port: 8091
-# sets the port on which the web server will run.
-
-wiki-title: Clafer Model Wiki
-# the title of the wiki.
-
-repository-type: Git
-# specifies the type of repository used for wiki content.
-# Options are Git, Darcs, and Mercurial.
-
-repository-path: wikidata
-# specifies the path of the repository directory.  If it does not
-# exist, gitit will create it on startup.
-
-require-authentication: none
-# if 'none', login is never required, and pages can be edited anonymously.
-# if 'modify', login is required to modify the wiki (edit, add, delete
-# pages, upload files).
-# if 'read', login is required to see any wiki pages.
-
-authentication-method: form
-# 'form' means that users will be logged in and registered
-# using forms in the gitit web interface.  'http' means
-# that gitit will assume that HTTP authentication is in
-# place and take the logged in username from the "Authorization"
-# field of the HTTP request header (in addition,
-# the login/logout and registration links will be
-# suppressed).  'generic' means that gitit will assume that
-# some form of authentication is in place that directly
-# sets REMOTE_USER to the name of the authenticated user
-# (e.g. mod_auth_cas on apache).  'rpx' means that gitit
-# will attempt to log in through https://rpxnow.com.
-# This requires that 'rpx-domain', 'rpx-key', and 'base-url'
-# be set below, and that 'curl' be in the system path.
-# 'github' means that you are redirected to github website and
-# need to avail gitit to use your credential from there (github name and
-# email). Your email is used to identify you when you push your wiki data
-# to git to identify you as the author.
-
-user-file: gitit-users
-# specifies the path of the file containing user login information.
-# If it does not exist, gitit will create it (with an empty user list).
-# This file is not used if 'http' is selected for authentication-method.
-
-session-timeout: 60
-# number of minutes of inactivity before a session expires.
-
-static-dir: static
-# specifies the path of the static directory (containing javascript,
-# css, and images).  If it does not exist, gitit will create it
-# and populate it with required scripts, stylesheets, and images.
-
-default-extension: page
-# files in the repository path must have this extension in order
-# to be recognized as Wiki pages
-
-default-page-type: Markdown
-# specifies the type of markup used to interpret pages in the wiki.
-# Possible values are Markdown, CommonMark, RST, LaTeX, HTML, Markdown+LHS,
-# RST+LHS, LaTeX+LHS, DocBook, Org. (The +LHS variants treat the input as
-# literate Haskell. See pandoc's documentation for more details.) If
-# Markdown is selected, pandoc's syntax extensions (for footnotes,
-# delimited code blocks, etc.) will be enabled. Note that pandoc's
-# reStructuredText parser is not complete, so some pages may not be
-# rendered correctly if RST is selected. The same goes for LaTeX and
-# HTML.
-
-math: mathjax
-# specifies how LaTeX math is to be displayed.  Possible values
-# are MathML, raw, mathjax, jsMath, and google.  If mathml is selected,
-# gitit will convert LaTeX math to MathML and link in a script,
-# MathMLinHTML.js, that allows the MathML to be seen in Gecko browsers, IE +
-# mathplayer, and Opera. In other browsers you may get a jumble of characters.
-# If raw is selected, the LaTeX math will be displayed as raw LaTeX math.
-# If mathjax is selected, gitit will link to the remote mathjax script.
-# If jsMath is selected, gitit will link to the script /js/jsMath/easy/load.js,
-# and will assume that jsMath has been installed into the js/jsMath directory.
-# This is the most portable solution. If google is selected, the google chart
-# API is called to render the formula as an image. This requires a connection
-# to google, and might raise a technical or a privacy problem.
-
-mathjax-script: https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
-# specifies the path to MathJax rendering script.
-# You might want to use your own MathJax script to render formulas without
-# Internet connection or if you want to use some special LaTeX packages.
-# Note: path specified there cannot be an absolute path to a script on your hdd,
-# instead you should run your (local if you wish) HTTP server which will
-# serve the MathJax.js script. You can easily (in four lines of code) serve
-# MathJax.js using http://happstack.com/docs/crashcourse/FileServing.html
-# Do not forget the "http://" prefix (e.g. http://localhost:1234/MathJax.js)
-
-show-lhs-bird-tracks: no
-# specifies whether to show Haskell code blocks in "bird style",
-# with "> " at the beginning of each line.
-
-templates-dir: templates
-# specifies the path of the directory containing page templates.
-# If it does not exist, gitit will create it with default templates.
-# Users may wish to edit the templates to customize the appearance of
-# their wiki. The template files are HStringTemplate templates.
-# Variables to be interpolated appear between $'s. Literal $'s must be
-# backslash-escaped.
-
-log-file: gitit.log
-# specifies the path of gitit's log file.  If it does not exist,
-# gitit will create it. The log is in Apache combined log format.
-
-log-level: WARNING
-# determines how much information is logged.
-# Possible values (from most to least verbose) are DEBUG, INFO,
-# NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY.
-
-front-page: Front Page
-# specifies which wiki page is to be used as the wiki's front page.
-# Gitit creates a default front page on startup, if one does not exist
-# already.
-
-no-delete: Front Page, Help
-# specifies pages that cannot be deleted through the web interface.
-# (They can still be deleted directly using git or darcs.)
-# A comma-separated list of page names.  Leave blank to allow
-# every page to be deleted.
-
-no-edit: Help
-# specifies pages that cannot be edited through the web interface.
-# Leave blank to allow every page to be edited.
-
-default-summary:
-# specifies text to be used in the change description if the author
-# leaves the "description" field blank.  If default-summary is blank
-# (the default), the author will be required to fill in the description
-# field.
-
-table-of-contents: yes
-# specifies whether to print a tables of contents (with links to
-# sections) on each wiki page.
-
-plugins:
-# specifies a list of plugins to load.  Plugins may be specified
-# either by their path or by their module name.  If the plugin name
-# starts with Gitit.Plugin., gitit will assume that the plugin is
-# an installed module and will not try to find a source file.
-# Examples:
-plugins: Network.Gitit.Plugin.ClaferWiki
-# plugins: plugins/DotPlugin.hs, CapitalizeEmphasisPlugin.hs
-# plugins: plugins/DotPlugin
-# plugins: Gitit.Plugin.InterwikiLinks
-
-use-cache: no
-# specifies whether to cache rendered pages.  Note that if use-feed
-# is selected, feeds will be cached regardless of the value of use-cache.
-
-cache-dir: cache
-# directory where rendered pages will be cached
-
-max-upload-size: 100K
-# specifies an upper limit on the size (in bytes) of files uploaded
-# through the wiki's web interface.
-# To disable uploads, set this to 0K.
-# This will result in the uploads link disappearing
-# and the _upload url becoming inactive.
-
-max-page-size: 100K
-# specifies an upper limit on the size (in bytes) of pages
-
-debug-mode: no
-# if "yes", causes debug information to be logged while gitit is running.
-
-compress-responses: yes
-# specifies whether HTTP responses should be compressed.
-
-mime-types-file: /etc/mime.types
-# specifies the path of a file containing mime type mappings.
-# Each line of the file should contain two fields, separated by
-# whitespace. The first field is the mime type, the second is a
-# file extension.  For example:
-# video/x-ms-wmx                    wmx
-# If the file is not found, some simple defaults will be used.
-
-use-recaptcha: no
-# if "yes", causes gitit to use the reCAPTCHA service
-# (http://recaptcha.net) to prevent bots from creating accounts.
-
-recaptcha-private-key:
-recaptcha-public-key:
-# specifies the public and private keys for the reCAPTCHA service.
-# To get these, you need to create an account at http://recaptcha.net.
-
-access-question:
-access-question-answers:
-# specifies a question that users must answer when they attempt to create
-# an account, along with a comma-separated list of acceptable answers.
-# This can be used to institute a rudimentary password for signing up as
-# a user on the wiki, or as an alternative to reCAPTCHA.
-# Example:
-# access-question:  What is the code given to you by Ms. X?
-# access-question-answers:  RED DOG, red dog
-
-rpx-domain:
-rpx-key:
-# Specifies the domain and key of your RPX account.  The domain is
-# just the prefix of the complete RPX domain, so if your full domain
-# is 'https://foo.rpxnow.com/', use 'foo' as the value of rpx-domain.
-
-mail-command: sendmail %s
-# specifies the command to use to send notification emails.
-# '%s' will be replaced by the destination email address.
-# The body of the message will be read from stdin.
-# If this field is left blank, password reset will not be offered.
-
-reset-password-message:
-  > From: nobody@$hostname$
-  > To: $useremail$
-  > Subject: Wiki password reset
-  >
-  > Dear $username$:
-  >
-  > To reset your password, please follow the link below:
-  > http://$hostname$:$port$$resetlink$
-  >
-  > Yours sincerely,
-  > The Wiki Master
-
-# gives the text of the message that will be sent to the user should she
-# want to reset her password, or change other registration info.
-# The lines must be indented, and must begin with '>'.  The initial
-# spaces and '> ' will be stripped off. $username$ will be replaced
-# by the user's username, $useremail$ by her email address,
-# $hostname$ by the hostname on which the wiki is running (as
-# returned by the hostname system call), $port$ by the port on
-# which the wiki is running, and $resetlink$ by the
-# relative path of a reset link derived from the user's existing
-# hashed password. If your gitit wiki is being proxied to a location
-# other than the root path of $port$, you should change the link to
-# reflect this: for example, to
-# http://$hostname$/path/to/wiki$resetlink$ or
-# http://gitit.$hostname$$resetlink$
-
-use-feed: no
-# specifies whether an ATOM feed should be enabled (for the site and for
-# individual pages)
-
-base-url:
-# the base URL of the wiki, to be used in constructing feed IDs
-# and RPX token_urls.
-# Set this if use-feed is 'yes' or authentication-method is 'rpx'.
-
-absolute-urls: no
-# make wikilinks absolute with respect to the base-url.
-# So, for example, in a wiki served at the base URL '/wiki', on a page
-# Sub/Page, the wikilink '[Cactus]()' will produce a link to
-# '/wiki/Cactus' if absolute-urls is 'yes', and a relative link to 'Cactus'
-# (referring to '/wiki/Sub/Cactus') if absolute-urls is 'no'.
-
-feed-days: 14
-# number of days to be included in feeds.
-
-feed-refresh-time: 60
-# number of minutes to cache feeds before refreshing
-
-pdf-export: no
-# if yes, PDF will appear in export options. PDF will be created using
-# pdflatex, which must be installed and in the path. Note that PDF
-# exports create significant additional server load.
-
-pandoc-user-data:
-# if a directory is specified, this will be searched for pandoc
-# customizations. These can include a templates/ directory for custom
-# templates for various export formats, an S5 directory for custom
-# S5 styles, and a reference.odt for ODT exports. If no directory is
-# specified, $HOME/.pandoc will be searched. See pandoc's README for
-# more information.
-
-xss-sanitize: no
-# if yes, all HTML (including that produced by pandoc) is filtered
-# through xss-sanitize.  Set to no only if you trust all of your users.
-
-recent-activity-days: 30
-# if the activity page receives no 'since' parameter specifiying the time
-# thereafter which to show the changes, it will by default show "recent"
-# changes. This allows you to specify how recent "recent" means, in days.
-
-[Github]
-# replace dummy oauthclientid and oauthclientsecret:
-oauthclientid: 01239456789abcdef012
-oauthclientsecret: 01239456789abcdef01239456789abcdef012394
-oauthcallback: http://mysite/_githubCallback
-oauthoauthorizeendpoint: https://github.com/login/oauth/authorize
-oauthaccesstokenendpoint: https://github.com/login/oauth/access_token
-## Uncomment if you are checking membership against an organization and change
-## gitit-testorg to this organization:
-# github-org: gitit-testorg
+# gitit wiki configuration file++# address: 0.0.0.0+# sets the IP address on which the web server will listen.++port: 8091+# sets the port on which the web server will run.++wiki-title: Clafer Model Wiki+# the title of the wiki.++repository-type: Git+# specifies the type of repository used for wiki content.+# Options are Git, Darcs, and Mercurial.++repository-path: wikidata+# specifies the path of the repository directory.  If it does not+# exist, gitit will create it on startup.++require-authentication: none+# if 'none', login is never required, and pages can be edited anonymously.+# if 'modify', login is required to modify the wiki (edit, add, delete+# pages, upload files).+# if 'read', login is required to see any wiki pages.++authentication-method: form+# 'form' means that users will be logged in and registered+# using forms in the gitit web interface.  'http' means+# that gitit will assume that HTTP authentication is in+# place and take the logged in username from the "Authorization"+# field of the HTTP request header (in addition,+# the login/logout and registration links will be+# suppressed).  'generic' means that gitit will assume that+# some form of authentication is in place that directly+# sets REMOTE_USER to the name of the authenticated user+# (e.g. mod_auth_cas on apache).  'rpx' means that gitit+# will attempt to log in through https://rpxnow.com.+# This requires that 'rpx-domain', 'rpx-key', and 'base-url'+# be set below, and that 'curl' be in the system path.+# 'github' means that you are redirected to github website and+# need to avail gitit to use your credential from there (github name and+# email). Your email is used to identify you when you push your wiki data+# to git to identify you as the author.++user-file: gitit-users+# specifies the path of the file containing user login information.+# If it does not exist, gitit will create it (with an empty user list).+# This file is not used if 'http' is selected for authentication-method.++session-timeout: 60+# number of minutes of inactivity before a session expires.++static-dir: static+# specifies the path of the static directory (containing javascript,+# css, and images).  If it does not exist, gitit will create it+# and populate it with required scripts, stylesheets, and images.++default-extension: page+# files in the repository path must have this extension in order+# to be recognized as Wiki pages++default-page-type: Markdown+# specifies the type of markup used to interpret pages in the wiki.+# Possible values are Markdown, CommonMark, RST, LaTeX, HTML, Markdown+LHS,+# RST+LHS, LaTeX+LHS, DocBook, Org. (The +LHS variants treat the input as+# literate Haskell. See pandoc's documentation for more details.) If+# Markdown is selected, pandoc's syntax extensions (for footnotes,+# delimited code blocks, etc.) will be enabled. Note that pandoc's+# reStructuredText parser is not complete, so some pages may not be+# rendered correctly if RST is selected. The same goes for LaTeX and+# HTML.++math: mathjax+# specifies how LaTeX math is to be displayed.  Possible values+# are MathML, raw, mathjax, jsMath, and google.  If mathml is selected,+# gitit will convert LaTeX math to MathML and link in a script,+# MathMLinHTML.js, that allows the MathML to be seen in Gecko browsers, IE ++# mathplayer, and Opera. In other browsers you may get a jumble of characters.+# If raw is selected, the LaTeX math will be displayed as raw LaTeX math.+# If mathjax is selected, gitit will link to the remote mathjax script.+# If jsMath is selected, gitit will link to the script /js/jsMath/easy/load.js,+# and will assume that jsMath has been installed into the js/jsMath directory.+# This is the most portable solution. If google is selected, the google chart+# API is called to render the formula as an image. This requires a connection+# to google, and might raise a technical or a privacy problem.++mathjax-script: https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML+# specifies the path to MathJax rendering script.+# You might want to use your own MathJax script to render formulas without+# Internet connection or if you want to use some special LaTeX packages.+# Note: path specified there cannot be an absolute path to a script on your hdd,+# instead you should run your (local if you wish) HTTP server which will+# serve the MathJax.js script. You can easily (in four lines of code) serve+# MathJax.js using http://happstack.com/docs/crashcourse/FileServing.html+# Do not forget the "http://" prefix (e.g. http://localhost:1234/MathJax.js)++show-lhs-bird-tracks: no+# specifies whether to show Haskell code blocks in "bird style",+# with "> " at the beginning of each line.++templates-dir: templates+# specifies the path of the directory containing page templates.+# If it does not exist, gitit will create it with default templates.+# Users may wish to edit the templates to customize the appearance of+# their wiki. The template files are HStringTemplate templates.+# Variables to be interpolated appear between $'s. Literal $'s must be+# backslash-escaped.++log-file: gitit.log+# specifies the path of gitit's log file.  If it does not exist,+# gitit will create it. The log is in Apache combined log format.++log-level: WARNING+# determines how much information is logged.+# Possible values (from most to least verbose) are DEBUG, INFO,+# NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY.++front-page: Front Page+# specifies which wiki page is to be used as the wiki's front page.+# Gitit creates a default front page on startup, if one does not exist+# already.++no-delete: Front Page, Help+# specifies pages that cannot be deleted through the web interface.+# (They can still be deleted directly using git or darcs.)+# A comma-separated list of page names.  Leave blank to allow+# every page to be deleted.++no-edit: Help+# specifies pages that cannot be edited through the web interface.+# Leave blank to allow every page to be edited.++default-summary:+# specifies text to be used in the change description if the author+# leaves the "description" field blank.  If default-summary is blank+# (the default), the author will be required to fill in the description+# field.++table-of-contents: yes+# specifies whether to print a tables of contents (with links to+# sections) on each wiki page.++plugins:+# specifies a list of plugins to load.  Plugins may be specified+# either by their path or by their module name.  If the plugin name+# starts with Gitit.Plugin., gitit will assume that the plugin is+# an installed module and will not try to find a source file.+# Examples:+plugins: Network.Gitit.Plugin.ClaferWiki+# plugins: plugins/DotPlugin.hs, CapitalizeEmphasisPlugin.hs+# plugins: plugins/DotPlugin+# plugins: Gitit.Plugin.InterwikiLinks++use-cache: no+# specifies whether to cache rendered pages.  Note that if use-feed+# is selected, feeds will be cached regardless of the value of use-cache.++cache-dir: cache+# directory where rendered pages will be cached++max-upload-size: 100K+# specifies an upper limit on the size (in bytes) of files uploaded+# through the wiki's web interface.+# To disable uploads, set this to 0K.+# This will result in the uploads link disappearing+# and the _upload url becoming inactive.++max-page-size: 100K+# specifies an upper limit on the size (in bytes) of pages++debug-mode: no+# if "yes", causes debug information to be logged while gitit is running.++compress-responses: yes+# specifies whether HTTP responses should be compressed.++mime-types-file: /etc/mime.types+# specifies the path of a file containing mime type mappings.+# Each line of the file should contain two fields, separated by+# whitespace. The first field is the mime type, the second is a+# file extension.  For example:+# video/x-ms-wmx                    wmx+# If the file is not found, some simple defaults will be used.++use-recaptcha: no+# if "yes", causes gitit to use the reCAPTCHA service+# (http://recaptcha.net) to prevent bots from creating accounts.++recaptcha-private-key:+recaptcha-public-key:+# specifies the public and private keys for the reCAPTCHA service.+# To get these, you need to create an account at http://recaptcha.net.++access-question:+access-question-answers:+# specifies a question that users must answer when they attempt to create+# an account, along with a comma-separated list of acceptable answers.+# This can be used to institute a rudimentary password for signing up as+# a user on the wiki, or as an alternative to reCAPTCHA.+# Example:+# access-question:  What is the code given to you by Ms. X?+# access-question-answers:  RED DOG, red dog++rpx-domain:+rpx-key:+# Specifies the domain and key of your RPX account.  The domain is+# just the prefix of the complete RPX domain, so if your full domain+# is 'https://foo.rpxnow.com/', use 'foo' as the value of rpx-domain.++mail-command: sendmail %s+# specifies the command to use to send notification emails.+# '%s' will be replaced by the destination email address.+# The body of the message will be read from stdin.+# If this field is left blank, password reset will not be offered.++reset-password-message:+  > From: nobody@$hostname$+  > To: $useremail$+  > Subject: Wiki password reset+  >+  > Dear $username$:+  >+  > To reset your password, please follow the link below:+  > http://$hostname$:$port$$resetlink$+  >+  > Yours sincerely,+  > The Wiki Master++# gives the text of the message that will be sent to the user should she+# want to reset her password, or change other registration info.+# The lines must be indented, and must begin with '>'.  The initial+# spaces and '> ' will be stripped off. $username$ will be replaced+# by the user's username, $useremail$ by her email address,+# $hostname$ by the hostname on which the wiki is running (as+# returned by the hostname system call), $port$ by the port on+# which the wiki is running, and $resetlink$ by the+# relative path of a reset link derived from the user's existing+# hashed password. If your gitit wiki is being proxied to a location+# other than the root path of $port$, you should change the link to+# reflect this: for example, to+# http://$hostname$/path/to/wiki$resetlink$ or+# http://gitit.$hostname$$resetlink$++use-feed: no+# specifies whether an ATOM feed should be enabled (for the site and for+# individual pages)++base-url:+# the base URL of the wiki, to be used in constructing feed IDs+# and RPX token_urls.+# Set this if use-feed is 'yes' or authentication-method is 'rpx'.++absolute-urls: no+# make wikilinks absolute with respect to the base-url.+# So, for example, in a wiki served at the base URL '/wiki', on a page+# Sub/Page, the wikilink '[Cactus]()' will produce a link to+# '/wiki/Cactus' if absolute-urls is 'yes', and a relative link to 'Cactus'+# (referring to '/wiki/Sub/Cactus') if absolute-urls is 'no'.++feed-days: 14+# number of days to be included in feeds.++feed-refresh-time: 60+# number of minutes to cache feeds before refreshing++pdf-export: no+# if yes, PDF will appear in export options. PDF will be created using+# pdflatex, which must be installed and in the path. Note that PDF+# exports create significant additional server load.++pandoc-user-data:+# if a directory is specified, this will be searched for pandoc+# customizations. These can include a templates/ directory for custom+# templates for various export formats, an S5 directory for custom+# S5 styles, and a reference.odt for ODT exports. If no directory is+# specified, $HOME/.pandoc will be searched. See pandoc's README for+# more information.++xss-sanitize: no+# if yes, all HTML (including that produced by pandoc) is filtered+# through xss-sanitize.  Set to no only if you trust all of your users.++recent-activity-days: 30+# if the activity page receives no 'since' parameter specifiying the time+# thereafter which to show the changes, it will by default show "recent"+# changes. This allows you to specify how recent "recent" means, in days.++[Github]+# replace dummy oauthclientid and oauthclientsecret:+oauthclientid: 01239456789abcdef012+oauthclientsecret: 01239456789abcdef01239456789abcdef012394+oauthcallback: http://mysite/_githubCallback+oauthoauthorizeendpoint: https://github.com/login/oauth/authorize+oauthaccesstokenendpoint: https://github.com/login/oauth/access_token+## Uncomment if you are checking membership against an organization and change+## gitit-testorg to this organization:+# github-org: gitit-testorg
src/Network/Gitit/Plugin/ClaferWiki.hs view
@@ -1,328 +1,328 @@-{-# LANGUAGE OverloadedStrings #-}
-{-
- Copyright (C) 2012-2014 Michal Antkiewicz, Chris Walker <http://gsd.uwaterloo.ca>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
--}
-{-# LANGUAGE NamedFieldPuns #-}
--- | A plugin for Gitit which integrates the Clafer compiler and links to other
--- Clafer web tools: <http://https://github.com/gsdlab/ClaferIDE ClaferIDE>,
--- <http://https://github.com/gsdlab/ClaferConfigurator ClaferConfigurator>, and
--- <http://https://github.com/gsdlab/ClaferMooVisualizer ClaferMooVisualizer>
-module Network.Gitit.Plugin.ClaferWiki (plugin) where
-
-import Network.Gitit.Interface
-
-import Control.Applicative
-import Control.Monad
-import Control.Monad.Trans.State
-import Data.List
-import Data.List.Split
-import qualified Data.Map as Map
-import Data.String.Utils (replace)
-import Network.BSD (getHostName)
-import System.Directory (createDirectoryIfMissing, doesFileExist)
-import System.Process (readProcessWithExitCode)
-
-import Language.Clafer
-import Language.Clafer.Css as Css
-import Language.Clafer.Generator.Html (highlightErrors)
-
-import Prelude
-
--- | claferWiki collects Clafer code from .clafer code blocks, renders as HTML and graph,
---   and replaces the original blocks with RawBlocks containing the results
-plugin :: Plugin
-plugin = mkPageTransformM claferWiki
-
-claferWiki :: Pandoc -> PluginM Pandoc
-claferWiki pandoc = do
-    -- make sure the directories and clafer.css exist
-    liftIO $ do
-        createDirectoryIfMissing True "static/clafer/"
-        createDirectoryIfMissing True "static/css/"
-        cssExist <- doesFileExist "static/css/clafer.css"
-        unless cssExist $ writeFile "static/css/clafer.css" css
-
-    serverURL <- liftIO $ getHostName
-    pageName <- getPageName
-    config <- askConfig
-
-    let
-        serverPort = show $ portNumber config
-        -- produce the required outputs in a single compilation
-        allCompilationResults = compileFragments fragments claferModes
-
-        htmlCode = extractOutput allCompilationResults Html
-        htmlCodeFragments = splitOn "\n<!-- # FRAGMENT /-->\n" htmlCode
-
-        stats = maybe "No model." statistics $ extractCompilerResult allCompilationResults Html
-
-        dotGraph = maybe "" outputCode $ extractCompilerResult allCompilationResults Graph
-
-        dotCVLGraph = maybe "" outputCode $ extractCompilerResult allCompilationResults CVLGraph
-
-    -- render the graphs to SVG using dot
-    (_, svgGraphWithoutRefs, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] dotGraph
-    (_, svgGraphWithRefs, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] $ changeTransparentToLightGray dotGraph
-    (_, svgCVLGraph, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] dotCVLGraph
-
-        -- using the WikiEnv as state, replace clafer code blocks with appropriate results:
-        -- html rendering of clafer code, graph rendering, download links, ide, configurator, and visualizer buttons
-    let
-        initialWikiEnv = WikiEnv {
-                            we_fileName = pageName,
-                            we_serverURL = serverURL,
-                            we_serverPort = serverPort,
-                            we_htmlCodeFragments = htmlCodeFragments,
-                            we_stats = stats,
-                            we_graphNo = 0,     -- needed to construct unique IDs of <div> for graphs
-                            we_svgGraphWithRefs = svgGraphWithRefs,
-                            we_svgGraphWithoutRefs = svgGraphWithoutRefs,
-                            we_svgCVLGraph = svgCVLGraph
-                         }
-        newPandoc = evalState (bottomUpM replaceClaferWikiBlocks pandoc) initialWikiEnv
-
-    -- save original model
-    liftIO $ writeFile ("static/clafer/" ++ pageName ++ ".cfr") completeModel
-    -- save html version
-    liftIO $ writeFile ("static/clafer/" ++ pageName ++ ".html") $ selfContained htmlCode
-
-    return $ newPandoc
-    where
-        -- collect clafer model fragments
-        fragments :: [ String ]
-        fragments = queryWith addFragment pandoc
-
-        -- collects compiler modes depending on the kinds of blocks on the page
-        claferModes :: [ ClaferMode ]
-        claferModes = nub $ queryWith addMode pandoc
-
-        fragmentedModel = intercalate "//# FRAGMENT\n" fragments
-        completeModel = intercalate "\n" fragments
-
-        addFragment :: Block -> [String]
-        addFragment (CodeBlock (_, [ "clafer" ], _) code) = [ code ++ "\n" ]
-        addFragment _                                     = []
-
-        addMode :: Block -> [ClaferMode]
-        addMode (CodeBlock (_, [ "clafer" ], _) _)              = [Html]
-        addMode (CodeBlock (_, [ "clafer", "graph" ], _) _)     = [Graph]
-        addMode (CodeBlock (_, [ "clafer", "summary" ], _) _)   = [Graph]
-        addMode (CodeBlock (_, [ "clafer", "cvlGraph" ], _) _)  = [CVLGraph]
-        addMode (CodeBlock (_, [ "clafer", "cvlgraph" ], _) _)  = [CVLGraph]
-        addMode _                                               = []
-
-        extractCompilerResult :: Either [ClaferErr] (Map.Map ClaferMode CompilerResult) -> ClaferMode -> Maybe CompilerResult
-        extractCompilerResult result claferMode = either (const Nothing) (Map.lookup claferMode) result
-
-        extractOutput :: Either [ClaferErr] (Map.Map ClaferMode CompilerResult) -> ClaferMode -> String
-        extractOutput (Right compilerResultMap) claferMode =
-            case (Map.lookup claferMode compilerResultMap) of
-                Just CompilerResult{ outputCode } -> outputCode
-                Just NoCompilerResult{ reason } -> "Error: No " ++ show claferMode ++ " output. Reason:" ++ reason
-                Nothing -> "Error: No " ++ show claferMode ++ " output."
-        extractOutput (Left err) _ = highlightErrors fragmentedModel err
-
-        selfContained htmlCode =
-            concat [
-                Css.header,
-                "<style>",
-                Css.css,
-                "</style>",
-                "</head>\n<body>\n",
-                htmlCode,
-                "</body>\n</html>"
-            ]
-
--- | Environment (state) for rewriting the page
-data WikiEnv = WikiEnv {
-                    we_fileName :: String,
-                    we_serverURL :: String,
-                    we_serverPort :: String,
-                    -- | code fragments are consumed
-                    we_htmlCodeFragments :: [ String ],
-                    we_stats :: String,
-                    we_graphNo :: Int,
-                    we_svgGraphWithRefs :: String,
-                    we_svgGraphWithoutRefs :: String,
-                    we_svgCVLGraph :: String
-               }
-
-
-replaceClaferWikiBlocks :: Block -> State WikiEnv Block
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer" ], _) _) = do
-    wikiEnv <- get
-    let (fragment:fragments) = we_htmlCodeFragments wikiEnv
-    put $ wikiEnv { we_htmlCodeFragments = fragments }
-    return $ RawBlock "html" ("<div class=\"code\">" ++ fragment ++ "</div>")
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "links" ], _) _) = do
-    fileName <- gets we_fileName
-    return $ RawBlock "html" $ renderLinks fileName
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "stats" ], _) _) = do
-    stats <- gets we_stats
-    return $ RawBlock "html" $ renderStats stats
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "graph" ], _) _) = do
-    wikiEnv <- get
-    graphNo <- gets we_graphNo
-    svgGraphWithRefs <- gets we_svgGraphWithRefs
-    svgGraphWithoutRefs <- gets we_svgGraphWithoutRefs
-    put $ wikiEnv { we_graphNo = graphNo + 1 }
-    return $ RawBlock "html" $ renderGraphWithToggle svgGraphWithoutRefs svgGraphWithRefs  graphNo
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "cvlGraph" ], _) _) =  do
-    svgCVLGraph <- gets we_svgCVLGraph
-    return $ RawBlock "html" $ renderGraph svgCVLGraph
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "cvlgraph" ], _) _) =  do
-    svgCVLGraph <- gets we_svgCVLGraph
-    return $ RawBlock "html" $ renderGraph svgCVLGraph
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "summary" ], _) _) =  do
-    wikiEnv <- get
-    fileName <- gets we_fileName
-    stats <- gets we_stats
-    graphNo <- gets we_graphNo
-    svgGraphWithRefs <- gets we_svgGraphWithRefs
-    svgGraphWithoutRefs <- gets we_svgGraphWithoutRefs
-    put $ wikiEnv { we_graphNo = graphNo + 1 }
-    return $ RawBlock "html" $ renderSummary fileName stats svgGraphWithoutRefs svgGraphWithRefs graphNo
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "mooviz" ], _) _) =  do
-    wikiEnv <- get
-    return $ renderAnalyzeWithClaferMooViz (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "config" ], _) _) =  do
-    wikiEnv <- get
-    return $ renderConfigureWithClaferConfigurator (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)
-
-replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "ide" ], _) _) =  do
-    wikiEnv <- get
-    return $ renderAddOpenInIDE (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)
-
-replaceClaferWikiBlocks block = return block
-
-renderLinks :: String -> String
-renderLinks fileName =
-    "<div><b>Module Downloads:</b> | <a href=\"/clafer/" ++
-    fileName ++
-    ".cfr\">[.cfr]</a> | <a href=\"/clafer/" ++
-    fileName ++
-    ".html\">[.html]</a> |</div><br>\n"
-
-renderStats :: String -> String
-renderStats stats =
-    "<div><b>Module Statistics:</b> \n| " ++
-    (intercalate " | " $ lines stats ) ++
-    " |</div><br>\n"
-
-
-renderGraphWithToggle :: String           -> String        -> Int      -> String
-renderGraphWithToggle    svgGraphWithoutRefs svgGraphWithRefs graphNo   = unlines [
-    "<div id=\"" ++ renderGraphId False graphNo ++  "\" style=\"display:block;width:100%;border:solid lightgray 1px;overflow-x:auto;\" ondblclick=\"" ++ renderShowRefs graphNo ++ "\">",
-    svgGraphWithoutRefs,
-    "</div>",
-    "<div id=\"" ++ renderGraphId True graphNo ++  "\" style=\"display:none;width:100%;border:solid lightgray 1px;overflow-x:auto;\" ondblclick=\"" ++ renderHideRefs graphNo ++ "\">",
-    svgGraphWithRefs,
-    "</div>" ]
-
-renderGraph :: String  -> String
-renderGraph    svgGraph = unlines [
-    "<div style=\"display:block;width:100%;border:solid lightgray 1px;overflow-x:auto;\">",
-    svgGraph,
-    "</div>" ]
-
-renderShowRefs :: Int    -> String
-renderShowRefs    graphNo =
-  "var gwr=document.getElementById('" ++ renderGraphId True graphNo ++  "'); gwr.style.display='block'; gwr.scrollLeft=this.scrollLeft; this.style.display='none';"
-
-renderHideRefs :: Int    -> String
-renderHideRefs    graphNo =
-  "var gwor=document.getElementById('" ++ renderGraphId False graphNo ++  "'); gwor.style.display='block'; gwor.scrollLeft=this.scrollLeft;this.style.display='none';"
-
-renderGraphId :: Bool -> Int    -> String
-renderGraphId    True    graphNo = "graphWithRefs" ++ show graphNo
-renderGraphId    False   graphNo = "graphWithoutRefs" ++ show graphNo
-
-renderSummary :: String -> String -> String           -> String        -> Int    -> String
-renderSummary    fileName  stats     svgGraphWithoutRefs svgGraphWithRefs graphNo =
-    renderGraphWithToggle svgGraphWithoutRefs svgGraphWithRefs graphNo ++
-    renderStats stats ++
-    renderLinks fileName
-
-
-compileFragments :: [ String ] -> [ ClaferMode ] -> Either [ClaferErr] (Map.Map ClaferMode CompilerResult)
-compileFragments    fragments     claferModes    =
-    -- compile all clafer code
-    runClafer defaultClaferArgs{
-                mode=claferModes,
-                keep_unused=True,
-                add_comments=True,
-                show_references=False } $ do
-                                            mapM_ addModuleFragment fragments
-                                            parse
-                                            iModule <- desugar Nothing
-                                            compile iModule
-                                            generate
-
-
-renderAnalyzeWithClaferMooViz :: String -> String -> String -> Block
-renderAnalyzeWithClaferMooViz fileName serverURL serverPort =
-    RawBlock "html" (unlines [
-      "<div>" ++
-      "<a href=\"http://" ++ serverURL ++ ":8092/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" ++
-      fileName ++
-      ".cfr\" target=\"_blank\" " ++
-      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" ++
-      "Analyze with ClaferMooVisualizer" ++
-      "</a></div><br>\n"
-      ])
-
-renderConfigureWithClaferConfigurator :: String -> String -> String -> Block
-renderConfigureWithClaferConfigurator fileName serverURL serverPort =
-    RawBlock "html" (unlines [
-      "<div>" ++
-      "<a href=\"http://" ++ serverURL ++ ":8093/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" ++
-      fileName ++
-      ".cfr\" target=\"_blank\" " ++
-      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" ++
-      "Configure with ClaferConfigurator" ++
-      "</a></div><br>\n"
-      ])
-
-renderAddOpenInIDE :: String -> String -> String -> Block
-renderAddOpenInIDE fileName serverURL serverPort =
-    RawBlock "html" (unlines [
-      "<div>" ++
-      "<a href=\"http://" ++ serverURL ++ ":8094/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" ++
-      fileName ++
-      ".cfr\" target=\"_blank\" " ++
-      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" ++
-      "Open in ClaferIDE" ++
-      "</a></div><br>\n"
-      ])
-
-getPageName:: PluginM String
-getPageName = replace " " "_" . replace "/" "_" . pgPageName . ctxLayout <$> getContext
-
-changeTransparentToLightGray :: String -> String
-changeTransparentToLightGray = replace "color=transparent" "color=lightgray"
+{-# LANGUAGE OverloadedStrings #-}+{-+ Copyright (C) 2012-2014 Michal Antkiewicz, Chris Walker <http://gsd.uwaterloo.ca>++ Permission is hereby granted, free of charge, to any person obtaining a copy of+ this software and associated documentation files (the "Software"), to deal in+ the Software without restriction, including without limitation the rights to+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies+ of the Software, and to permit persons to whom the Software is furnished to do+ so, subject to the following conditions:++ The above copyright notice and this permission notice shall be included in all+ copies or substantial portions of the Software.++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+ SOFTWARE.+-}+{-# LANGUAGE NamedFieldPuns #-}+-- | A plugin for Gitit which integrates the Clafer compiler and links to other+-- Clafer web tools: <http://https://github.com/gsdlab/ClaferIDE ClaferIDE>,+-- <http://https://github.com/gsdlab/ClaferConfigurator ClaferConfigurator>, and+-- <http://https://github.com/gsdlab/ClaferMooVisualizer ClaferMooVisualizer>+module Network.Gitit.Plugin.ClaferWiki (plugin) where++import Network.Gitit.Interface++import Control.Applicative+import Control.Monad+import Control.Monad.Trans.State+import Data.List+import Data.List.Split+import qualified Data.Map as Map+import Data.String.Utils (replace)+import Network.BSD (getHostName)+import System.Directory (createDirectoryIfMissing, doesFileExist)+import System.Process (readProcessWithExitCode)++import Language.Clafer+import Language.Clafer.Css as Css+import Language.Clafer.Generator.Html (highlightErrors)++import Prelude++-- | claferWiki collects Clafer code from .clafer code blocks, renders as HTML and graph,+--   and replaces the original blocks with RawBlocks containing the results+plugin :: Plugin+plugin = mkPageTransformM claferWiki++claferWiki :: Pandoc -> PluginM Pandoc+claferWiki pandoc = do+    -- make sure the directories and clafer.css exist+    liftIO $ do+        createDirectoryIfMissing True "static/clafer/"+        createDirectoryIfMissing True "static/css/"+        cssExist <- doesFileExist "static/css/clafer.css"+        unless cssExist $ writeFile "static/css/clafer.css" css++    serverURL <- liftIO $ getHostName+    pageName <- getPageName+    config <- askConfig++    let+        serverPort = show $ portNumber config+        -- produce the required outputs in a single compilation+        allCompilationResults = compileFragments fragments claferModes++        htmlCode = extractOutput allCompilationResults Html+        htmlCodeFragments = splitOn "\n<!-- # FRAGMENT /-->\n" htmlCode++        stats = maybe "No model." statistics $ extractCompilerResult allCompilationResults Html++        dotGraph = maybe "" outputCode $ extractCompilerResult allCompilationResults Graph++        dotCVLGraph = maybe "" outputCode $ extractCompilerResult allCompilationResults CVLGraph++    -- render the graphs to SVG using dot+    (_, svgGraphWithoutRefs, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] dotGraph+    (_, svgGraphWithRefs, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] $ changeTransparentToLightGray dotGraph+    (_, svgCVLGraph, _) <- liftIO $ readProcessWithExitCode "dot" [ "-Tsvg" ] dotCVLGraph++        -- using the WikiEnv as state, replace clafer code blocks with appropriate results:+        -- html rendering of clafer code, graph rendering, download links, ide, configurator, and visualizer buttons+    let+        initialWikiEnv = WikiEnv {+                            we_fileName = pageName,+                            we_serverURL = serverURL,+                            we_serverPort = serverPort,+                            we_htmlCodeFragments = htmlCodeFragments,+                            we_stats = stats,+                            we_graphNo = 0,     -- needed to construct unique IDs of <div> for graphs+                            we_svgGraphWithRefs = svgGraphWithRefs,+                            we_svgGraphWithoutRefs = svgGraphWithoutRefs,+                            we_svgCVLGraph = svgCVLGraph+                         }+        newPandoc = evalState (bottomUpM replaceClaferWikiBlocks pandoc) initialWikiEnv++    -- save original model+    liftIO $ writeFile ("static/clafer/" ++ pageName ++ ".cfr") completeModel+    -- save html version+    liftIO $ writeFile ("static/clafer/" ++ pageName ++ ".html") $ selfContained htmlCode++    return $ newPandoc+    where+        -- collect clafer model fragments+        fragments :: [ String ]+        fragments = queryWith addFragment pandoc++        -- collects compiler modes depending on the kinds of blocks on the page+        claferModes :: [ ClaferMode ]+        claferModes = nub $ queryWith addMode pandoc++        fragmentedModel = intercalate "//# FRAGMENT\n" fragments+        completeModel = intercalate "\n" fragments++        addFragment :: Block -> [String]+        addFragment (CodeBlock (_, [ "clafer" ], _) code) = [ code ++ "\n" ]+        addFragment _                                     = []++        addMode :: Block -> [ClaferMode]+        addMode (CodeBlock (_, [ "clafer" ], _) _)              = [Html]+        addMode (CodeBlock (_, [ "clafer", "graph" ], _) _)     = [Graph]+        addMode (CodeBlock (_, [ "clafer", "summary" ], _) _)   = [Graph]+        addMode (CodeBlock (_, [ "clafer", "cvlGraph" ], _) _)  = [CVLGraph]+        addMode (CodeBlock (_, [ "clafer", "cvlgraph" ], _) _)  = [CVLGraph]+        addMode _                                               = []++        extractCompilerResult :: Either [ClaferErr] (Map.Map ClaferMode CompilerResult) -> ClaferMode -> Maybe CompilerResult+        extractCompilerResult result claferMode = either (const Nothing) (Map.lookup claferMode) result++        extractOutput :: Either [ClaferErr] (Map.Map ClaferMode CompilerResult) -> ClaferMode -> String+        extractOutput (Right compilerResultMap) claferMode =+            case (Map.lookup claferMode compilerResultMap) of+                Just CompilerResult{ outputCode } -> outputCode+                Just NoCompilerResult{ reason } -> "Error: No " ++ show claferMode ++ " output. Reason:" ++ reason+                Nothing -> "Error: No " ++ show claferMode ++ " output."+        extractOutput (Left err) _ = highlightErrors fragmentedModel err++        selfContained htmlCode =+            concat [+                Css.header,+                "<style>",+                Css.css,+                "</style>",+                "</head>\n<body>\n",+                htmlCode,+                "</body>\n</html>"+            ]++-- | Environment (state) for rewriting the page+data WikiEnv = WikiEnv {+                    we_fileName :: String,+                    we_serverURL :: String,+                    we_serverPort :: String,+                    -- | code fragments are consumed+                    we_htmlCodeFragments :: [ String ],+                    we_stats :: String,+                    we_graphNo :: Int,+                    we_svgGraphWithRefs :: String,+                    we_svgGraphWithoutRefs :: String,+                    we_svgCVLGraph :: String+               }+++replaceClaferWikiBlocks :: Block -> State WikiEnv Block+replaceClaferWikiBlocks (CodeBlock (_, [ "clafer" ], _) _) = do+    wikiEnv <- get+    let (fragment:fragments) = we_htmlCodeFragments wikiEnv+    put $ wikiEnv { we_htmlCodeFragments = fragments }+    return $ RawBlock "html" ("<div class=\"code\">" ++ fragment ++ "</div>")++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "links" ], _) _) = do+    fileName <- gets we_fileName+    return $ RawBlock "html" $ renderLinks fileName++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "stats" ], _) _) = do+    stats <- gets we_stats+    return $ RawBlock "html" $ renderStats stats++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "graph" ], _) _) = do+    wikiEnv <- get+    graphNo <- gets we_graphNo+    svgGraphWithRefs <- gets we_svgGraphWithRefs+    svgGraphWithoutRefs <- gets we_svgGraphWithoutRefs+    put $ wikiEnv { we_graphNo = graphNo + 1 }+    return $ RawBlock "html" $ renderGraphWithToggle svgGraphWithoutRefs svgGraphWithRefs  graphNo++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "cvlGraph" ], _) _) =  do+    svgCVLGraph <- gets we_svgCVLGraph+    return $ RawBlock "html" $ renderGraph svgCVLGraph++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "cvlgraph" ], _) _) =  do+    svgCVLGraph <- gets we_svgCVLGraph+    return $ RawBlock "html" $ renderGraph svgCVLGraph++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "summary" ], _) _) =  do+    wikiEnv <- get+    fileName <- gets we_fileName+    stats <- gets we_stats+    graphNo <- gets we_graphNo+    svgGraphWithRefs <- gets we_svgGraphWithRefs+    svgGraphWithoutRefs <- gets we_svgGraphWithoutRefs+    put $ wikiEnv { we_graphNo = graphNo + 1 }+    return $ RawBlock "html" $ renderSummary fileName stats svgGraphWithoutRefs svgGraphWithRefs graphNo++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "mooviz" ], _) _) =  do+    wikiEnv <- get+    return $ renderAnalyzeWithClaferMooViz (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "config" ], _) _) =  do+    wikiEnv <- get+    return $ renderConfigureWithClaferConfigurator (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)++replaceClaferWikiBlocks (CodeBlock (_, [ "clafer", "ide" ], _) _) =  do+    wikiEnv <- get+    return $ renderAddOpenInIDE (we_fileName wikiEnv) (we_serverURL wikiEnv) (we_serverPort wikiEnv)++replaceClaferWikiBlocks block = return block++renderLinks :: String -> String+renderLinks fileName =+    "<div><b>Module Downloads:</b> | <a href=\"/clafer/" +++    fileName +++    ".cfr\">[.cfr]</a> | <a href=\"/clafer/" +++    fileName +++    ".html\">[.html]</a> |</div><br>\n"++renderStats :: String -> String+renderStats stats =+    "<div><b>Module Statistics:</b> \n| " +++    (intercalate " | " $ lines stats ) +++    " |</div><br>\n"+++renderGraphWithToggle :: String           -> String        -> Int      -> String+renderGraphWithToggle    svgGraphWithoutRefs svgGraphWithRefs graphNo   = unlines [+    "<div id=\"" ++ renderGraphId False graphNo ++  "\" style=\"display:block;width:100%;border:solid lightgray 1px;overflow-x:auto;\" ondblclick=\"" ++ renderShowRefs graphNo ++ "\">",+    svgGraphWithoutRefs,+    "</div>",+    "<div id=\"" ++ renderGraphId True graphNo ++  "\" style=\"display:none;width:100%;border:solid lightgray 1px;overflow-x:auto;\" ondblclick=\"" ++ renderHideRefs graphNo ++ "\">",+    svgGraphWithRefs,+    "</div>" ]++renderGraph :: String  -> String+renderGraph    svgGraph = unlines [+    "<div style=\"display:block;width:100%;border:solid lightgray 1px;overflow-x:auto;\">",+    svgGraph,+    "</div>" ]++renderShowRefs :: Int    -> String+renderShowRefs    graphNo =+  "var gwr=document.getElementById('" ++ renderGraphId True graphNo ++  "'); gwr.style.display='block'; gwr.scrollLeft=this.scrollLeft; this.style.display='none';"++renderHideRefs :: Int    -> String+renderHideRefs    graphNo =+  "var gwor=document.getElementById('" ++ renderGraphId False graphNo ++  "'); gwor.style.display='block'; gwor.scrollLeft=this.scrollLeft;this.style.display='none';"++renderGraphId :: Bool -> Int    -> String+renderGraphId    True    graphNo = "graphWithRefs" ++ show graphNo+renderGraphId    False   graphNo = "graphWithoutRefs" ++ show graphNo++renderSummary :: String -> String -> String           -> String        -> Int    -> String+renderSummary    fileName  stats     svgGraphWithoutRefs svgGraphWithRefs graphNo =+    renderGraphWithToggle svgGraphWithoutRefs svgGraphWithRefs graphNo +++    renderStats stats +++    renderLinks fileName+++compileFragments :: [ String ] -> [ ClaferMode ] -> Either [ClaferErr] (Map.Map ClaferMode CompilerResult)+compileFragments    fragments     claferModes    =+    -- compile all clafer code+    runClafer defaultClaferArgs{+                mode=claferModes,+                keep_unused=True,+                add_comments=True,+                show_references=False } $ do+                                            mapM_ addModuleFragment fragments+                                            parse+                                            iModule <- desugar Nothing+                                            compile iModule+                                            generate+++renderAnalyzeWithClaferMooViz :: String -> String -> String -> Block+renderAnalyzeWithClaferMooViz fileName serverURL serverPort =+    RawBlock "html" (unlines [+      "<div>" +++      "<a href=\"http://" ++ serverURL ++ ":8092/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" +++      fileName +++      ".cfr\" target=\"_blank\" " +++      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" +++      "Analyze with ClaferMooVisualizer" +++      "</a></div><br>\n"+      ])++renderConfigureWithClaferConfigurator :: String -> String -> String -> Block+renderConfigureWithClaferConfigurator fileName serverURL serverPort =+    RawBlock "html" (unlines [+      "<div>" +++      "<a href=\"http://" ++ serverURL ++ ":8093/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" +++      fileName +++      ".cfr\" target=\"_blank\" " +++      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" +++      "Configure with ClaferConfigurator" +++      "</a></div><br>\n"+      ])++renderAddOpenInIDE :: String -> String -> String -> Block+renderAddOpenInIDE fileName serverURL serverPort =+    RawBlock "html" (unlines [+      "<div>" +++      "<a href=\"http://" ++ serverURL ++ ":8094/?claferFileURL=http://" ++ serverURL ++ ":" ++ serverPort ++ "/clafer/" +++      fileName +++      ".cfr\" target=\"_blank\" " +++      "style=\"background-color: #ccc;color: white;text-decoration: none;padding: 1px 5px 1px 5px;\" >" +++      "Open in ClaferIDE" +++      "</a></div><br>\n"+      ])++getPageName:: PluginM String+getPageName = replace " " "_" . replace "/" "_" . pgPageName . ctxLayout <$> getContext++changeTransparentToLightGray :: String -> String+changeTransparentToLightGray = replace "color=transparent" "color=lightgray"
stack.yaml view
@@ -1,34 +1,25 @@-# For GHC-8.0.1 (does not build yet)
-# extra-deps:
-#   - data-stringmap-1.0.1.1
-#   - json-builder-0.3
-#   - gitit-0.12.1.1
-#   - sendfile-0.7.9
-#   - filestore-0.6.2
-#   - json-0.9.1
-#   - recaptcha-0.1.0.3
-#   - uri-0.1.6.4
-# resolver: nightly-2016-06-21
-
-# for GHC-7.10.3
-extra-deps:
-  - data-stringmap-1.0.1.1
-  - gitit-0.12.1.1
-  - filestore-0.6.2
-  - recaptcha-0.1.0.3
-  - uri-0.1.6.4
-  - sendfile-0.7.9
-resolver: lts-6.4
-
-flags:
-  sendfile:
-    portable: true
-  gitit:
-    plugins: true
-    network-uri: true
-    https: true
-    highlighting: true
-
-packages:
-- '../clafer'
-- '.'
+# For GHC-8.0.2+extra-deps:+  - data-stringmap-1.0.1.1+  - gitit-0.12.2.1+  - sendfile-0.7.9+  - filestore-0.6.3.1+  - json-0.9.1+  - json-builder-0.3+  - recaptcha-0.1.0.3+  - uri-0.1.6.4+  - tagsoup-0.14.1+resolver: lts-8.5++flags:+  sendfile:+    portable: true+  gitit:+    plugins: true+    network-uri: true+    https: true+    highlighting: true++packages:+- '../clafer'+- '.'
static/css/clafer.css view
@@ -1,13 +1,13 @@-.identifier{}
-.keyword{font-weight:bold}
-.reference{}
-.code { background-color: lightgray; padding: 5px 5px 5px 5px; border: 1px solid darkgray; margin-bottom: 15px; 
-        font-family: Pragmata, Menlo, 'DejaVu LGC Sans Mono', 'DejaVu Sans Mono', Consolas, 'Everson Mono', 'Lucida Console', 'Andale Mono', 'Nimbus Mono L', 'Liberation Mono', FreeMono, 'Osaka Monospaced', Courier, 'New Courier', monospace; }
-.standalonecomment { color: green; font-style:italic }
-.inlinecomment { color: green; padding-left:20px; font-style:italic }
-.error{background-color: yellow; color: red }
-.indent{padding-left:20px}
-a[href$='Lookup failed'] {color: red}
-a[href$='Uid not found'] {color: red}
-a[href$='Ambiguous name'] {color: yellow}
-
+.identifier{}+.keyword{font-weight:bold}+.reference{}+.code { background-color: lightgray; padding: 5px 5px 5px 5px; border: 1px solid darkgray; margin-bottom: 15px; +        font-family: Pragmata, Menlo, 'DejaVu LGC Sans Mono', 'DejaVu Sans Mono', Consolas, 'Everson Mono', 'Lucida Console', 'Andale Mono', 'Nimbus Mono L', 'Liberation Mono', FreeMono, 'Osaka Monospaced', Courier, 'New Courier', monospace; }+.standalonecomment { color: green; font-style:italic }+.inlinecomment { color: green; padding-left:20px; font-style:italic }+.error{background-color: yellow; color: red }+.indent{padding-left:20px}+a[href$='Lookup failed'] {color: red}+a[href$='Uid not found'] {color: red}+a[href$='Ambiguous name'] {color: yellow}+
static/css/custom.css view
@@ -1,5 +1,5 @@-@import url("screen.css"); /* default gitit screen styles */
-@import url("hk-pyg.css"); /* for syntax highlighting */
-@import url("clafer.css"); /* for syntax highlighting for Clafer */
-
+@import url("screen.css"); /* default gitit screen styles */+@import url("hk-pyg.css"); /* for syntax highlighting */+@import url("clafer.css"); /* for syntax highlighting for Clafer */+ /* Put your custom style modifications here: */
templates/footer.st view
@@ -1,1 +1,1 @@-<div id="footer">powered by <a href="http://github.com/jgm/gitit/tree/master/">gitit-0.12.1.1</a> and <a href="https://github.com/gsdlab/clafer">clafer-0.4.4</a></div>
+<div id="footer">powered by <a href="http://github.com/jgm/gitit/tree/master/">gitit-0.12.2.1</a> and <a href="https://github.com/gsdlab/clafer">clafer-0.4.5</a></div>