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