module Sound.SC3.Server.Help where
import Control.Monad
import System.FilePath
import System.Process
import qualified Sound.SC3.UGen.Help as Help
sc3_server_command_ref :: FilePath -> String -> FilePath
sc3_server_command_ref d c =
let f = d </> "Reference/Server-Command-Reference.html"
c' = case c of
'/':_ -> c
_ -> '/':c
in f ++ '#':c'
viewServerHelp :: String -> IO ()
viewServerHelp c = do
d <- Help.sc3HelpDirectory
let nm = sc3_server_command_ref d c
br <- Help.get_env_default "BROWSER" "x-www-browser"
void (rawSystem br ["file://" ++ nm])