import "URL" import "Simantics/DB" import "http://www.simantics.org/Help-1.0" as HELP importJava "org.simantics.help.core.HelpUtils" where createHelpLibrary :: Resource -> Resource createHelpTutorial :: Resource -> String -> Resource clearHelpTocCache :: () -> () saveHelpFileContents :: Resource -> String -> () readHelpFileContents :: Resource -> String markdownToHtml :: Resource -> String getHelpBrowserUrl :: () -> URL createHelpLibraryAction :: Resource -> () createHelpLibraryAction parent = do syncWrite (\() -> createHelpLibrary parent) () createHelpTutorialAction :: Resource -> () createHelpTutorialAction parent = do tutorialFiles = syncRead (\x -> objectsWithType parent L0.ConsistsOf HELP.TutorialFile) fileName = if length tutorialFiles == 0 then "Tutorial" else do "Tutorial " + (show (length tutorialFiles)) syncWrite (\() -> createHelpTutorial parent fileName) ()