本文整理汇总了TypeScript中jupyter-js-utils.getBaseUrl函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getBaseUrl函数的具体用法?TypeScript getBaseUrl怎么用?TypeScript getBaseUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getBaseUrl函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getBaseUrl
import {
SplitPanel
} from 'phosphor-splitpanel';
import {
Widget
} from 'phosphor-widget';
import 'jupyter-js-notebook/lib/index.css';
import 'jupyter-js-notebook/lib/theme.css';
import 'jupyter-js-ui/lib/dialog/index.css';
import 'jupyter-js-ui/lib/dialog/theme.css';
let SERVER_URL = getBaseUrl();
let NOTEBOOK = 'test.ipynb';
function main(): void {
// Initialize the keymap manager with the bindings.
var keymap = new KeymapManager();
// Setup the keydown listener for the document.
document.addEventListener('keydown', event => {
keymap.processKeydownEvent(event);
});
// TODO: check out static example from the history
// and make that a separate example.
let contents = new ContentsManager(SERVER_URL);
示例2: Copyright
| Copyright (c) 2014-2015, Jupyter Development Team.
|
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
'use strict';
import {
startNewSession
} from 'jupyter-js-services';
import {
getBaseUrl, getWsUrl
} from 'jupyter-js-utils';
const BASE_URL = getBaseUrl();
const WS_URL = getWsUrl();
function main() {
// Start a new session.
let options = {
baseUrl: BASE_URL,
wsUrl: WS_URL,
kernelName: 'python',
path: 'foo.ipynb'
};
startNewSession(options).then(session => {
// Rename the session.
session.rename('bar.ipynb').then(() => {
console.log('Session renamed to', session.path);