Skip to content

Commit 7b2145f

Browse files
author
Zachary Norman
committed
Updated routines to use compressed file on disk to reduce space
1 parent 3bc2b4d commit 7b2145f

File tree

5 files changed

+83
-8893
lines changed

5 files changed

+83
-8893
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# .gitignore file initialized by the IDL Developer Tools
2+
/dist
3+
*spec.pro.log
4+
*idl.test.log
5+
idl_routines.csv

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ print, 'Output file : ' + outFile
5050
```
5151

5252

53+
## Updating the Routines
54+
55+
In order to update the routines you will need to do two things:
56+
57+
1. Run the routine `htmlizer_export_csv` which will read in the `idl_routines.sav` file and export it to `idl_routines.csv`.
58+
59+
2. Make changes to the `idl_routines.csv` file and then run `htmlizer_import_csv` which will then update `idl_routines.csv`
60+
61+
Take a look at the idl_routines.csv file for what the syntax should be for adding additional rows of information.
62+
63+
5364
## License
5465

5566
© 2018 Harris Geospatial Solutions, Inc.

htmlizer__define.pro

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,20 +530,17 @@ function HTMLizer::init, CUSTOM_TOOLTIPS = custom_tooltips
530530
endif
531531

532532
;get the current directory
533-
thisdir = file_dirname(((scope_traceback(/STRUCT))[-1]).FILENAME)
533+
thisdir = file_dirname(routine_filepath())
534534

535535
;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!'
539539
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
547544

548545
;parse strigns
549546
posTwo = strpos(toolDatabase, ';;')
@@ -1769,6 +1766,65 @@ pro htmlizer_write_file, file, strings
17691766
end
17701767

17711768

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+
17721828

17731829
;+
17741830
; :Description:

0 commit comments

Comments
 (0)