-
-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add options for special browser to open preview page
- Loading branch information
Showing
15 changed files
with
148 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
/* | ||
* fork from https://github.com/domenic/opener | ||
*/ | ||
const child_process_1 = tslib_1.__importDefault(require("child_process")); | ||
const os_1 = tslib_1.__importDefault(require("os")); | ||
module.exports = function opener(args, tool, callback) { | ||
let platform = process.platform; | ||
args = [].concat(args); | ||
if (tool) { | ||
args.unshift(tool); | ||
} | ||
// Attempt to detect Windows Subystem for Linux (WSL). | ||
// WSL itself as Linux (which works in most cases), but in | ||
// this specific case we need to treat it as actually being Windows. | ||
// The "Windows-way" of opening things through cmd.exe works just fine here, | ||
// whereas using xdg-open does not, since there is no X Windows in WSL. | ||
if (platform === 'linux' && os_1.default.release().indexOf('Microsoft') !== -1) { | ||
platform = 'win32'; | ||
} | ||
// http://stackoverflow.com/q/1480971/3191, but see below for Windows. | ||
let command; | ||
switch (platform) { | ||
case 'win32': { | ||
command = 'cmd.exe'; | ||
break; | ||
} | ||
case 'darwin': { | ||
command = 'open'; | ||
if (tool) { | ||
args.unshift('-a'); | ||
} | ||
break; | ||
} | ||
default: { | ||
command = 'xdg-open'; | ||
break; | ||
} | ||
} | ||
if (platform === 'win32') { | ||
// On Windows, we really want to use the "start" command. | ||
// But, the rules regarding arguments with spaces, and escaping them with quotes, | ||
// can get really arcane. So the easiest way to deal with this is to pass off the | ||
// responsibility to "cmd /c", which has that logic built in. | ||
// | ||
// Furthermore, if "cmd /c" double-quoted the first parameter, | ||
// then "start" will interpret it as a window title, | ||
// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 | ||
// | ||
// Additionally, on Windows ampersand needs to be escaped when passed to "start" | ||
args = args.map(value => { | ||
return value.replace(/&/g, '^&'); | ||
}); | ||
args = ['/c', 'start', '""'].concat(args); | ||
} | ||
return child_process_1.default.execFile(command, args, null, callback); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/404.js" as="script"/><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-94dad8183cac85e3af97.js" as="script"/></head><body><div id="__next"><div data-reactroot="">404</div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"Bl3Xk6SKdeG3dxMfwaFwz","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/404" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/404.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" async=""></script><script src="/_next/static/runtime/main-94dad8183cac85e3af97.js" async=""></script></body></html> | ||
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/404.js" as="script"/><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-94dad8183cac85e3af97.js" as="script"/></head><body><div id="__next"><div data-reactroot="">404</div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"262vxEr5Glefa1A~zX7ZC","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/404" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/404.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" async=""></script><script src="/_next/static/runtime/main-94dad8183cac85e3af97.js" async=""></script></body></html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><title class="next-head">「」</title><link rel="shortcut icon" type="image/ico" href="/_static/favicon.ico" class="next-head"/><link rel="stylesheet" href="/_static/page.css" class="next-head"/><link rel="stylesheet" href="/_static/markdown.css" class="next-head"/><link rel="stylesheet" href="/_static/highlight.css" class="next-head"/><link rel="stylesheet" href="/_static/[email protected]" class="next-head"/><script type="text/javascript" src="/_static/tweenlite.min.js" class="next-head"></script><script type="text/javascript" src="/_static/mermaid.min.js" class="next-head"></script><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/index.js" as="script"/><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-94dad8183cac85e3af97.js" as="script"/></head><body><div id="__next"><div id="page-ctn"><header id="page-header"><h3><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"></path></svg></h3></header><section class="markdown-body"></section></div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"Bl3Xk6SKdeG3dxMfwaFwz","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/Bl3Xk6SKdeG3dxMfwaFwz/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" async=""></script><script src="/_next/static/runtime/main-94dad8183cac85e3af97.js" async=""></script></body></html> | ||
<!DOCTYPE html><html><head><meta charSet="utf-8" class="next-head"/><title class="next-head">「」</title><link rel="shortcut icon" type="image/ico" href="/_static/favicon.ico" class="next-head"/><link rel="stylesheet" href="/_static/page.css" class="next-head"/><link rel="stylesheet" href="/_static/markdown.css" class="next-head"/><link rel="stylesheet" href="/_static/highlight.css" class="next-head"/><link rel="stylesheet" href="/_static/[email protected]" class="next-head"/><script type="text/javascript" src="/_static/tweenlite.min.js" class="next-head"></script><script type="text/javascript" src="/_static/mermaid.min.js" class="next-head"></script><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/index.js" as="script"/><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_app.js" as="script"/><link rel="preload" href="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_error.js" as="script"/><link rel="preload" href="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" as="script"/><link rel="preload" href="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" as="script"/><link rel="preload" href="/_next/static/runtime/main-94dad8183cac85e3af97.js" as="script"/></head><body><div id="__next"><div id="page-ctn"><header id="page-header"><h3><svg viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"></path></svg></h3></header><section class="markdown-body"></section></div></div><script>__NEXT_DATA__ = {"props":{"pageProps":{}},"page":"/","query":{},"buildId":"262vxEr5Glefa1A~zX7ZC","nextExport":true};__NEXT_LOADED_PAGES__=[];__NEXT_REGISTER_PAGE=function(r,f){__NEXT_LOADED_PAGES__.push([r, f])}</script><script async="" id="__NEXT_PAGE__/" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/index.js"></script><script async="" id="__NEXT_PAGE__/_app" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_app.js"></script><script async="" id="__NEXT_PAGE__/_error" src="/_next/static/262vxEr5Glefa1A~zX7ZC/pages/_error.js"></script><script src="/_next/static/runtime/webpack-42652fa8b82c329c0559.js" async=""></script><script src="/_next/static/chunks/commons.1c1b5ebd55cbcad2529a.js" async=""></script><script src="/_next/static/runtime/main-94dad8183cac85e3af97.js" async=""></script></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,3 @@ if (!isRoot) { | |
module.exports = (name = 'mkdp'): log4js.Logger => { | ||
return log4js.getLogger(name) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* fork from https://github.com/domenic/opener | ||
*/ | ||
import childProcess from 'child_process' | ||
import os from 'os' | ||
|
||
module.exports = function opener( | ||
args: string | string[], | ||
tool: string | undefined, | ||
callback: (() => any) | undefined | ||
) { | ||
let platform = process.platform | ||
args = [].concat(args) | ||
|
||
if (tool) { | ||
args.unshift(tool) | ||
} | ||
|
||
// Attempt to detect Windows Subystem for Linux (WSL). | ||
// WSL itself as Linux (which works in most cases), but in | ||
// this specific case we need to treat it as actually being Windows. | ||
// The "Windows-way" of opening things through cmd.exe works just fine here, | ||
// whereas using xdg-open does not, since there is no X Windows in WSL. | ||
if (platform === 'linux' && os.release().indexOf('Microsoft') !== -1) { | ||
platform = 'win32' | ||
} | ||
|
||
// http://stackoverflow.com/q/1480971/3191, but see below for Windows. | ||
let command | ||
switch (platform) { | ||
case 'win32': { | ||
command = 'cmd.exe' | ||
break | ||
} | ||
case 'darwin': { | ||
command = 'open' | ||
if (tool) { | ||
args.unshift('-a') | ||
} | ||
break | ||
} | ||
default: { | ||
command = 'xdg-open' | ||
break | ||
} | ||
} | ||
|
||
if (platform === 'win32') { | ||
// On Windows, we really want to use the "start" command. | ||
// But, the rules regarding arguments with spaces, and escaping them with quotes, | ||
// can get really arcane. So the easiest way to deal with this is to pass off the | ||
// responsibility to "cmd /c", which has that logic built in. | ||
// | ||
// Furthermore, if "cmd /c" double-quoted the first parameter, | ||
// then "start" will interpret it as a window title, | ||
// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 | ||
// | ||
// Additionally, on Windows ampersand needs to be escaped when passed to "start" | ||
args = args.map(value => { | ||
return value.replace(/&/g, '^&') | ||
}) | ||
args = ['/c', 'start', '""'].concat(args) | ||
} | ||
|
||
return childProcess.execFile(command, args, null, callback) | ||
} |