From 1cabc2902ff599e761cba3567f70dc9e8f809348 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Fri, 30 Jan 2015 09:01:02 +0000 Subject: [PATCH] Update docs etc. --- Gruntfile.js | 12 ++++++--- README.md | 6 ++++- bower.json | 9 +++++-- docs/Module.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 6 deletions(-) create mode 100644 docs/Module.md diff --git a/Gruntfile.js b/Gruntfile.js index b9edd79..a66dcca 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,6 +13,12 @@ module.exports = function(grunt) { pscMake: ["<%=libFiles%>"], dotPsci: ["<%=libFiles%>"], + pscDocs: { + readme: { + src: "src/**/*.purs", + dest: "docs/Module.md" + } + }, psc: { exampleTest: { @@ -21,7 +27,7 @@ module.exports = function(grunt) { dest: "tmp/Test.js" } }, - + copy: [ { expand: true, @@ -40,10 +46,10 @@ module.exports = function(grunt) { grunt.loadNpmTasks("grunt-contrib-copy"); grunt.loadNpmTasks("grunt-contrib-clean"); - grunt.loadNpmTasks("grunt-execute") + grunt.loadNpmTasks("grunt-execute"); grunt.loadNpmTasks("grunt-purescript"); - grunt.registerTask("make", ["pscMake", "dotPsci"]); + grunt.registerTask("make", ["pscMake", "dotPsci", "pscDocs"]); grunt.registerTask("test", ["psc", "copy", "execute"]); grunt.registerTask("default", ["clean", "make", "test"]); }; diff --git a/README.md b/README.md index 1dce0c5..59a72b7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # purescript-virtual-dom -[virtual-dom](https://github.com/Matt-Esch/virtual-dom) bindings for PureScript +[virtual-dom](https://github.com/Matt-Esch/virtual-dom) bindings for PureScript. + +This library is only aiming to provide basic `virtual-dom` functionality, with the intention that user-friendly libraries will be built on top of it to provide stronger typing, a `VTree` DSL, etc. + +- [Module documentation](docs/Module.md) diff --git a/bower.json b/bower.json index 6bb3fa6..f1aa7d7 100644 --- a/bower.json +++ b/bower.json @@ -2,7 +2,12 @@ "name": "purescript-virtual-dom", "description": "virtual-dom bindings for PureScript", "keywords": [ - "purescript" + "purescript", + "virtual-dom" + ], + "authors": [ + "Gary Burgess ", + "Daniel Austin " ], "ignore": [ "**/.*", @@ -17,6 +22,6 @@ ], "dependencies": { "purescript-dom": "~0.1.1", - "purescript-maybe":"*" + "purescript-maybe":"~0.2.1" } } diff --git a/docs/Module.md b/docs/Module.md new file mode 100644 index 0000000..4259c56 --- /dev/null +++ b/docs/Module.md @@ -0,0 +1,73 @@ +# Module Documentation + +## Module VirtualDOM + +### Types + + PatchObject represents an Array, where each VPatch is a patch + operation. See virtual-dom/docs.jsig for details. + + data PatchObject :: * + + +### Type Class Instances + + + instance showPatchObject :: Show PatchObject + + +### Values + + + createElement :: VTree -> Node + + + diff :: VTree -> VTree -> PatchObject + + + patch :: forall e. PatchObject -> Node -> Eff (dom :: DOM | e) Node + + +## Module VirtualDOM.VTree + +### Types + + + type TagName = String + + + data VHook :: * + + + data VTree :: * + + +### Type Class Instances + + + instance showVHook :: Show VHook + + + instance showVTree :: Show VTree + + +### Values + + Render a VTree using custom logic function. The logic can examine the + previous VTree before returning the new (or same) one. The result of the + render function must be a vnode, vtext, or widget. This constraint is not + enforced by the types. + + thunk :: (Maybe VTree -> VTree) -> VTree + + + vhook :: forall props. { | props } -> VHook + + + vnode :: forall props. TagName -> { | props } -> [VTree] -> VTree + + + vtext :: String -> VTree + + + widget :: forall props. { | props } -> VTree \ No newline at end of file