@@ -530,20 +530,17 @@ function HTMLizer::init, CUSTOM_TOOLTIPS = custom_tooltips
530
530
endif
531
531
532
532
; get the current directory
533
- thisdir = file_dirname ((( scope_traceback ( / STRUCT))[ - 1 ]).FILENAME )
533
+ thisdir = file_dirname (routine_filepath () )
534
534
535
535
; check for the CSV file
536
- funcCSV = thisdir + path_sep () + 'idl_routines.csv '
537
- if ~file_test (funcCSV ) then begin
538
- message , 'idl_routines.csv not found in the same directory as this file, required for tooltips or docs links!'
536
+ routines = thisdir + path_sep () + 'idl_routines.sav '
537
+ if ~file_test (routines ) then begin
538
+ message , 'idl_routines.sav not found in the same directory as this file, required for tooltips or docs links!'
539
539
endif
540
-
541
- ; read in the CSV file
542
- nlines = file_lines (funcCSV)
543
- toolDatabase = strarr (nlines)
544
- openr , lun, funcCSV, / GET_LUN
545
- readf , lun, toolDatabase
546
- free_lun , lun
540
+
541
+ ; restore the strings for our CSV file which has a variable called toolDatabase
542
+ ; in it
543
+ restore , routines
547
544
548
545
; parse strigns
549
546
posTwo = strpos (toolDatabase, ';;' )
@@ -1769,6 +1766,65 @@ pro htmlizer_write_file, file, strings
1769
1766
end
1770
1767
1771
1768
1769
+ ; +
1770
+ ; :Description:
1771
+ ; Exports the contents of the IDL SAVE file that
1772
+ ; contains the routines to disk for editing.
1773
+ ;
1774
+ ;
1775
+ ;
1776
+ ; :Author: Zachary Norman - GitHub: znorman-harris
1777
+ ; -
1778
+ pro htmlizer_export_csv
1779
+ compile_opt idl2, hidden
1780
+
1781
+ ; get the current directory
1782
+ thisdir = file_dirname (routine_filepath ())
1783
+
1784
+ ; check for the CSV file
1785
+ routines = thisdir + path_sep () + 'idl_routines.sav'
1786
+ if ~file_test (routines) then begin
1787
+ message , 'idl_routines.sav not found in the same directory as this file, required for tooltips or docs links!'
1788
+ endif
1789
+
1790
+ ; read in the strings
1791
+ restore , routines
1792
+
1793
+ ; write the strings to disk
1794
+ htmlizer_write_file, thisdir + path_sep () + 'idl_routines.csv' , toolDatabase
1795
+ end
1796
+
1797
+
1798
+ ; +
1799
+ ; :Description:
1800
+ ; Updates the contents of the IDL SAVE file that
1801
+ ; contains the routines for tooltips and documentation
1802
+ ; by reading from a file called idl_routines.csv in this
1803
+ ; directory.
1804
+ ;
1805
+ ;
1806
+ ;
1807
+ ; :Author: Zachary Norman - GitHub: znorman-harris
1808
+ ; -
1809
+ pro htmlizer_import_csv
1810
+ compile_opt idl2, hidden
1811
+
1812
+ ; get the current directory
1813
+ thisdir = file_dirname (routine_filepath ())
1814
+
1815
+ ; check for the CSV file
1816
+ routines = thisdir + path_sep () + 'idl_routines.csv'
1817
+ if ~file_test (routines) then begin
1818
+ message , 'idl_routines.csv not found in the same directory as this file, required for tooltips or docs links!'
1819
+ endif
1820
+
1821
+ ; read in the strings
1822
+ toolDatabase = htmlizer_read_file(routines)
1823
+
1824
+ ; save them to disk with compression
1825
+ save , toolDatabase, / COMPRESS, FILE = thisdir + path_sep () + 'idl_routines.sav'
1826
+ end
1827
+
1772
1828
1773
1829
; +
1774
1830
; :Description:
0 commit comments