]> gerrit.simantics Code Review - simantics/platform.git/blob - 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
1 import "URL"\r
2 import "Simantics/DB"\r
3 import "http://www.simantics.org/Help-1.0" as HELP\r
4 \r
5 importJava "org.simantics.help.core.HelpUtils" where\r
6     createHelpLibrary :: Resource -> <WriteGraph, Proc> Resource\r
7     createHelpTutorial :: Resource -> String -> <WriteGraph, Proc> Resource\r
8     clearHelpTocCache :: () -> <Proc> ()\r
9     saveHelpFileContents :: Resource -> String -> <WriteGraph, Proc> ()\r
10     readHelpFileContents :: Resource -> <ReadGraph, Proc> String\r
11     markdownToHtml :: Resource -> <ReadGraph, Proc> String\r
12     getHelpBrowserUrl :: () -> URL\r
13 \r
14 createHelpLibraryAction :: Resource -> <Proc> ()\r
15 createHelpLibraryAction parent = do\r
16     syncWrite (\() -> createHelpLibrary parent)\r
17     ()\r
18 \r
19 createHelpTutorialAction :: Resource -> <Proc> ()\r
20 createHelpTutorialAction parent = do\r
21     tutorialFiles = syncRead (\x -> objectsWithType parent L0.ConsistsOf HELP.TutorialFile)\r
22     fileName = if length tutorialFiles == 0\r
23     then "Tutorial"\r
24     else do\r
25         "Tutorial " + (show (length tutorialFiles))\r
26     syncWrite (\() -> createHelpTutorial parent fileName)\r
27     ()