]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.help.core/scl/Simantics/Help.scl
merged svn revision 33114 and added desktop and help plugins
[simantics/platform.git] / bundles / org.simantics.help.core / scl / Simantics / Help.scl
diff --git a/bundles/org.simantics.help.core/scl/Simantics/Help.scl b/bundles/org.simantics.help.core/scl/Simantics/Help.scl
new file mode 100644 (file)
index 0000000..d104a50
--- /dev/null
@@ -0,0 +1,27 @@
+import "URL"\r
+import "Simantics/DB"\r
+import "http://www.simantics.org/Help-1.0" as HELP\r
+\r
+importJava "org.simantics.help.core.HelpUtils" where\r
+    createHelpLibrary :: Resource -> <WriteGraph, Proc> Resource\r
+    createHelpTutorial :: Resource -> String -> <WriteGraph, Proc> Resource\r
+    clearHelpTocCache :: () -> <Proc> ()\r
+    saveHelpFileContents :: Resource -> String -> <WriteGraph, Proc> ()\r
+    readHelpFileContents :: Resource -> <ReadGraph, Proc> String\r
+    markdownToHtml :: Resource -> <ReadGraph, Proc> String\r
+    getHelpBrowserUrl :: () -> URL\r
+\r
+createHelpLibraryAction :: Resource -> <Proc> ()\r
+createHelpLibraryAction parent = do\r
+    syncWrite (\() -> createHelpLibrary parent)\r
+    ()\r
+\r
+createHelpTutorialAction :: Resource -> <Proc> ()\r
+createHelpTutorialAction parent = do\r
+    tutorialFiles = syncRead (\x -> objectsWithType parent L0.ConsistsOf HELP.TutorialFile)\r
+    fileName = if length tutorialFiles == 0\r
+    then "Tutorial"\r
+    else do\r
+        "Tutorial " + (show (length tutorialFiles))\r
+    syncWrite (\() -> createHelpTutorial parent fileName)\r
+    ()
\ No newline at end of file