-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconvert-and-view.sh
More file actions
executable file
·26 lines (19 loc) · 984 Bytes
/
convert-and-view.sh
File metadata and controls
executable file
·26 lines (19 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# convert an .md file to a .html file and spawn a browser to view the result
# Tip: add the following to SciTE to convert and preview doc on F5:
# command.go.$(file.patterns.markdown)=sh convert-and-view.sh "$(FilePath)"
# Tip: use "Only One" chrome extension to avoid opening the same url in a new window every time
out_file="$("$(dirname "$0")/convert.sh" "$@")"
# start "$out_file"
# to enable ajax on file:/// urls use:
chrome="C:\Program Files\Google\Chrome\Application\chrome.exe"
[ -f "$chrome" ] || chrome="$USERPROFILE\Local Settings\Application Data\Google\Chrome\Application\chrome.exe"
[ -f "$chrome" ] || chrome="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
"$chrome" \
--use-spdy=off \
--disable-application-cache \
--allow-file-access-from-files \
--user-data-dir="$(dirname "$0")/../_chrome" \
--disable-web-security \
--enable-file-cookies \
"$out_file"
# to view with firefox use: "<path-to-firefox>\firefox.exe" "file:///$out_file"