Skip to content

Commit 49efd35

Browse files
committed
added docs
1 parent bd829af commit 49efd35

File tree

40 files changed

+1731
-1
lines changed

40 files changed

+1731
-1
lines changed

src/client/docs.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
'use strict';
2+
3+
import * as vscode from 'vscode';
4+
import {Disposable} from 'vscode';
5+
import * as fs from 'fs';
6+
import * as path from 'path';
7+
import * as constants from './common/constants';
8+
9+
export class TextDocumentContentProvider extends Disposable implements vscode.TextDocumentContentProvider {
10+
private _onDidChange = new vscode.EventEmitter<vscode.Uri>();
11+
private lastUri: vscode.Uri;
12+
constructor() {
13+
super(() => { });
14+
}
15+
public provideTextDocumentContent(uri: vscode.Uri, token: vscode.CancellationToken): Thenable<string> {
16+
this.lastUri = uri;
17+
return this.generateResultsView();
18+
}
19+
20+
get onDidChange(): vscode.Event<vscode.Uri> {
21+
return this._onDidChange.event;
22+
}
23+
24+
public update() {
25+
this._onDidChange.fire(this.lastUri);
26+
}
27+
28+
private generateResultsView(): Promise<string> {
29+
const htmlContent = `
30+
<!DOCTYPE html>
31+
<head><style type="text/css"> html, body{ height:100%; width:100%; } </style>
32+
<script type="text/javascript">
33+
</script>
34+
</head>
35+
<body>
36+
<iframe id="myframe" frameborder="0" style="border: 0px solid transparent;height:100%;width:100%;"
37+
src="http://0.0.0.0:8000/docs/jupyter_prerequisites/" seamless></iframe></body></html>`;
38+
return Promise.resolve(htmlContent);
39+
}
40+
}
41+
42+
export class DocProvider {
43+
constructor() {
44+
const helpSchema = 'help-viewer';
45+
const previewUri = vscode.Uri.parse(helpSchema + '://authority/jupyter');
46+
47+
const textProvider = new TextDocumentContentProvider();
48+
vscode.workspace.registerTextDocumentContentProvider(helpSchema, textProvider);
49+
50+
vscode.commands.registerCommand('python.displayHelp', (page: string) => {
51+
return vscode.commands.executeCommand('vscode.previewHtml', previewUri, vscode.ViewColumn.One, 'Help')
52+
.then(() => {
53+
// Do nothing
54+
}, reason => {
55+
// vscode.window.showErrorMessage(reason);
56+
});
57+
});
58+
}
59+
}

src/client/docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
public/
3+
.gatsby-context.js
4+
.DS_Store

src/client/docs/.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# back to language cpp to try to bypass osx node failure
2+
language: cpp
3+
sudo: false
4+
env:
5+
- export NODE_VERSION="0.10"
6+
- export NODE_VERSION="0.12"
7+
- export NODE_VERSION="4"
8+
- export NODE_VERSION="5"
9+
os:
10+
- linux
11+
- osx
12+
# pre-install to bring in the correct version of node via nvm
13+
before_install:
14+
- git submodule update --init --recursive
15+
- git clone https://github.com/creationix/nvm.git ./.nvm
16+
- source ./.nvm/nvm.sh
17+
- nvm install $NODE_VERSION
18+
- nvm use $NODE_VERSION
19+
- npm config set python `which python`
20+
- if [ $TRAVIS_OS_NAME == "linux" ]; then
21+
export CC="gcc-4.8";
22+
export CXX="g++-4.8";
23+
export LINK="gcc-4.8";
24+
export LINKXX="g++-4.8";
25+
fi
26+
- gcc --version
27+
- g++ --version
28+
# node 4 depends on gcc 4.8
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- g++-4.8
35+
- gcc-4.8
36+
# script needed to test, because defaults don't work on osx
37+
script:
38+
- npm install
39+
- npm run lint

src/client/docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# gatsby-starter-documentation
2+
Starter for building documentation site with GatsbyJS
3+
4+
Install this starter (assuming Gatsby is installed) by running from your CLI:
5+
`gatsby new gatsby-documentation-site https://github.com/gatsbyjs/gatsby-starter-documentation`
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { Component } from 'react'
2+
import './breakpoints.css'
3+
4+
class Breakpoint extends Component {
5+
render () {
6+
const { mobile, children } = this.props
7+
8+
if (mobile) {
9+
return (
10+
<div className="breakpoint-min-width-700">
11+
{children}
12+
</div>
13+
)
14+
}
15+
16+
return (
17+
<div className="breakpoint-max-width-700">
18+
{children}
19+
</div>
20+
)
21+
}
22+
}
23+
24+
Breakpoint.propTypes = {
25+
children: React.PropTypes.array,
26+
mobile: React.PropTypes.bool,
27+
}
28+
29+
export default Breakpoint
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@media only screen and (min-width: 700px) {
2+
.breakpoint-min-width-700 {
3+
display: block;
4+
}
5+
.breakpoint-max-width-700 {
6+
display: none;
7+
}
8+
}
9+
@media only screen and (max-width: 700px) {
10+
.breakpoint-min-width-700 {
11+
display: none;
12+
}
13+
.breakpoint-max-width-700 {
14+
display: block;
15+
}
16+
}

src/client/docs/config.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
siteTitle="Python in Visual Studio Code"
2+
baseColor = "#884499"
3+
linkPrefix = "/gatsby-starter-documentation"
4+
docPages = [
5+
"/docs/jupyter/",
6+
"/docs/jupyter_getting-started/",
7+
"/docs/jupyter_prerequisites/",
8+
"/docs/jupyter_examples/"
9+
]

src/client/docs/css/github.css

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
3+
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
4+
5+
*/
6+
/*.hljs-comment,
7+
.hljs-quote {
8+
color: #998;
9+
font-style: italic;
10+
}
11+
12+
.hljs-keyword,
13+
.hljs-selector-tag,
14+
.hljs-subst {
15+
color: #333;
16+
font-weight: bold;
17+
}
18+
19+
.hljs-number,
20+
.hljs-literal,
21+
.hljs-variable,
22+
.hljs-template-variable,
23+
.hljs-tag .hljs-attr {
24+
color: #008080;
25+
}
26+
27+
.hljs-string,
28+
.hljs-doctag {
29+
color: #d14;
30+
}
31+
32+
.hljs-title,
33+
.hljs-section,
34+
.hljs-selector-id {
35+
color: #900;
36+
font-weight: bold;
37+
}
38+
39+
.hljs-subst {
40+
font-weight: normal;
41+
}
42+
43+
.hljs-type,
44+
.hljs-class .hljs-title {
45+
color: #458;
46+
font-weight: bold;
47+
}
48+
49+
.hljs-tag,
50+
.hljs-name,
51+
.hljs-attribute {
52+
color: #000080;
53+
font-weight: normal;
54+
}
55+
56+
.hljs-regexp,
57+
.hljs-link {
58+
color: #009926;
59+
}
60+
61+
.hljs-symbol,
62+
.hljs-bullet {
63+
color: #990073;
64+
}
65+
66+
.hljs-built_in,
67+
.hljs-builtin-name {
68+
color: #0086b3;
69+
}
70+
71+
.hljs-meta {
72+
color: #999;
73+
font-weight: bold;
74+
}
75+
76+
.hljs-deletion {
77+
background: #fdd;
78+
}
79+
80+
.hljs-addition {
81+
background: #dfd;
82+
}
83+
84+
.hljs-emphasis {
85+
font-style: italic;
86+
}
87+
88+
.hljs-strong {
89+
font-weight: bold;
90+
}
91+
*/

0 commit comments

Comments
 (0)