;+ ; @file_comments ; Have one unique online help for IDL and SAXO ; ; @categories ; Documentation ; ; @uses ; mergeonline_help.sh ; ; @restrictions ; Works only with "Unix" type machine ; Needs at least version 6.2 ; ; @history ; Sept 2006: Sebastien Masson (smasson\@lodyc.jussieu.fr) ; ; @version ; $Id$ ;- PRO mergeonline_help ; compile_opt idl2, strictarrsubs ; ; Are we using a "Unix" machine? IF !d.name NE 'X' THEN return ; is the IDL version at least 6.2 ? IF float(strmid(!version.release, 0, 3)) LT 6.2 THEN return ; get the environment variable $HOME home = getenv('HOME') ; is it defined? IF home EQ '' THEN return ; is $HOME a writable directory? home = (file_search(home, /test_directory, /test_write, /mark_directory))[0] IF home EQ '' THEN return ; is $HOME/.assistant a directory ? if not, create it homeassist = home + '.assistant' IF file_test(homeassist, /directory) EQ 0 THEN file_mkdir, homeassist ; is $HOME/.assistant a writable directory? homeassist = (file_search(homeassist, /test_directory, /test_write, /mark_directory))[0] IF homeassist EQ '' THEN return ; is "$HOME/.assistant/src a directory ? if not, create it? homesrc = homeassist + 'src' IF file_test(homesrc, /directory) EQ 0 THEN file_mkdir, homesrc ; is $HOME/.assistant/src a writable directory? homesrc = (file_search(homesrc, /test_directory, /test_write, /mark_directory))[0] IF homesrc EQ '' THEN return ; do idl.adp and home.html already exists? IF file_test(homesrc + 'home.html') AND file_test(homesrc + 'idl.adp') $ AND file_test(homesrc + 'aboutsaxo.txt') THEN BEGIN !help_path = homesrc return ENDIF ; create idl.adp and home.html homeidladp = !dir + '/help/online_help' IF file_test(homeidladp + '/idl.adp') EQ 0 THEN BEGIN print, 'Error when looking for the file '+homeidladp + '/idl.adp ...' print, 'Check the value or your environment variable $IDL_DIR that defines !dir' return ENDIF homesaxoadp = file_dirname(find('buildinit.pro'), /mark_directory) + 'Documentation/idldoc_assistant_output' ; spawn, homesaxoadp + '/../xmldoc/mergeonline_help.sh' $ + ' ' + homeidladp $ + ' ' + homesaxoadp $ + ' ' + homesrc $ + ' ' + !version.release $ , /sh, exit_status = err ; IF err EQ 0 THEN !help_path = homesrc ; RETURN END