;+
; NAME:
;   mms_spdsw_help.pro
;
; PURPOSE:
;   Generate HTML Help file for spdsw package.
;
; CALLING SEQUENCE:
;	mms_spdsw_help
;
; INPUTS:
; 	Path to specific release distro.
;
; OUTPUTS:
;	spdsw_rxxxxx_YYYY-MM-DD_mms_help.html
;	spdsw_rxxxxx_YYYY-MM-DD_tplot_help.html
;
; KEYWORDS:
;	none.
;   
;
; MODIFICATION HISTORY:
;
; Prepared for MMS Data Access Tutorial
; March 21, 2016
; Author: Steve Martin
;-
pro mms_spdsw_help

print, format='(/,"mms_spdsw_help generator ...",/)'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Select directories to search

; Base directory where spdsw package is
path_to_package=''
read, path_to_package, prompt='Full path to spdsw package (e.g. /home/user/spdsw_r19060_2015-10-12)? '
if (path_to_package EQ '') then begin
	print, 'No package path entered, halting.'
	stop
endif
print, path_to_package
parse_path_to_package=STRSPLIT(path_to_package,'/',/extract)

; MMS sub-directory to search
mms_path=path_to_package+'/idl/projects/mms'

mms_routines=FILE_SEARCH(mms_path, '*.pro', /expand_environment)

; More general tplot routines
external_routines=FILE_SEARCH(path_to_package+'/idl/external', '*.pro', /expand_environment)
general_routines=FILE_SEARCH(path_to_package+'/idl/general', '*.pro', /expand_environment)
spedas_gui_routines=FILE_SEARCH(path_to_package+'/idl/spedas_gui', '*.pro', /expand_environment)

tplot_routines=[external_routines,general_routines,spedas_gui_routines]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Run HTML help generator
mms_help_file=path_to_package+'_mms_help.html'
tplot_help_file=path_to_package+'_tplot_help.html'

MK_HTML_HELP, mms_routines, mms_help_file,title='MMS Routines<br>'+parse_path_to_package[-1]
MK_HTML_HELP, tplot_routines, tplot_help_file,title='General SPDSW Routines<br>' + $
	parse_path_to_package[-1]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
end
