Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f5898acf
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5898acf
编写于
6月 16, 2016
作者:
J
Johannes Rieken
提交者:
GitHub
6月 16, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7656 from Microsoft/kieferrm/markdown
extract markdown into an extension
上级
f9483d36
fe748850
变更
30
展开全部
隐藏空白更改
内联
并排
Showing
30 changed file
with
4194 addition
and
807 deletion
+4194
-807
build/gulpfile.hygiene.js
build/gulpfile.hygiene.js
+1
-0
build/npm/postinstall.js
build/npm/postinstall.js
+1
-0
extensions/markdown/OSSREADME.json
extensions/markdown/OSSREADME.json
+102
-0
extensions/markdown/markdown.configuration.json
extensions/markdown/markdown.configuration.json
+26
-0
extensions/markdown/media/markdown.css
extensions/markdown/media/markdown.css
+163
-0
extensions/markdown/media/tomorrow.css
extensions/markdown/media/tomorrow.css
+73
-0
extensions/markdown/package.json
extensions/markdown/package.json
+69
-4
extensions/markdown/package.nls.json
extensions/markdown/package.nls.json
+4
-0
extensions/markdown/src/extension.ts
extensions/markdown/src/extension.ts
+178
-0
extensions/markdown/src/typings/ref.d.ts
extensions/markdown/src/typings/ref.d.ts
+8
-0
extensions/markdown/syntaxes/markdown.tmLanguage
extensions/markdown/syntaxes/markdown.tmLanguage
+1829
-0
extensions/markdown/test/colorize-results/test_md.json
extensions/markdown/test/colorize-results/test_md.json
+1031
-734
extensions/markdown/tsconfig.json
extensions/markdown/tsconfig.json
+13
-0
extensions/theme-abyss/themes/Abyss.tmTheme
extensions/theme-abyss/themes/Abyss.tmTheme
+48
-0
extensions/theme-defaults/themes/dark_vs.json
extensions/theme-defaults/themes/dark_vs.json
+23
-3
extensions/theme-defaults/themes/light_plus.json
extensions/theme-defaults/themes/light_plus.json
+6
-0
extensions/theme-defaults/themes/light_vs.json
extensions/theme-defaults/themes/light_vs.json
+24
-3
extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme
extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme
+1
-1
extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme
...nsions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme
+116
-44
extensions/theme-monokai/themes/Monokai.tmTheme
extensions/theme-monokai/themes/Monokai.tmTheme
+72
-0
extensions/theme-quietlight/themes/QuietLight.tmTheme
extensions/theme-quietlight/themes/QuietLight.tmTheme
+48
-2
extensions/theme-red/themes/red.tmTheme
extensions/theme-red/themes/red.tmTheme
+74
-0
extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme
...nsions/theme-solarized-dark/themes/Solarized-dark.tmTheme
+72
-0
extensions/theme-solarized-light/themes/Solarized-light.tmTheme
...ions/theme-solarized-light/themes/Solarized-light.tmTheme
+72
-0
extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme
...me-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme
+48
-0
src/vs/editor/browser/widget/media/tokens.css
src/vs/editor/browser/widget/media/tokens.css
+7
-0
src/vs/platform/theme/common/themes.ts
src/vs/platform/theme/common/themes.ts
+4
-0
src/vs/workbench/parts/html/browser/webview.html
src/vs/workbench/parts/html/browser/webview.html
+34
-7
src/vs/workbench/parts/html/browser/webview.ts
src/vs/workbench/parts/html/browser/webview.ts
+45
-7
src/vs/workbench/workbench.main.ts
src/vs/workbench/workbench.main.ts
+2
-2
未找到文件。
build/gulpfile.hygiene.js
浏览文件 @
f5898acf
...
@@ -75,6 +75,7 @@ var copyrightFilter = [
...
@@ -75,6 +75,7 @@ var copyrightFilter = [
'
!**/*.sh
'
,
'
!**/*.sh
'
,
'
!**/*.txt
'
,
'
!**/*.txt
'
,
'
!**/*.xpm
'
,
'
!**/*.xpm
'
,
'
!extensions/markdown/media/tomorrow.css
'
];
];
var
tslintFilter
=
[
var
tslintFilter
=
[
...
...
build/npm/postinstall.js
浏览文件 @
f5898acf
...
@@ -11,6 +11,7 @@ const extensions = [
...
@@ -11,6 +11,7 @@ const extensions = [
'
vscode-colorize-tests
'
,
'
vscode-colorize-tests
'
,
'
json
'
,
'
json
'
,
'
configuration-editing
'
,
'
configuration-editing
'
,
'
markdown
'
,
'
typescript
'
,
'
typescript
'
,
'
php
'
,
'
php
'
,
'
javascript
'
,
'
javascript
'
,
...
...
extensions/markdown/OSSREADME.json
0 → 100644
浏览文件 @
f5898acf
//
ATTENTION
-
THIS
DIRECTORY
CONTAINS
THIRD
PARTY
OPEN
SOURCE
MATERIALS:
[
{
"name"
:
"chriskempson/tomorrow-theme"
,
"version"
:
"0.0.0"
,
"license"
:
"MIT"
,
"isProd"
:
true
,
"repositoryURL"
:
"https://github.com/chriskempson/tomorrow-theme"
},
{
"name"
:
"markdown-it/markdown-it"
,
"version"
:
"0.0.0"
,
"license"
:
"MIT"
,
"isProd"
:
true
,
"repositoryURL"
:
"https://github.com/markdown-it/markdown-it"
},
{
"name"
:
"isagalaev/highlight.js"
,
"version"
:
"0.0.0"
,
"license"
:
"BSD"
,
"isProd"
:
true
,
"repositoryURL"
:
"https://github.com/isagalaev/highlight.js"
,
"licenseDetail"
:
[
"Copyright (c) 2006, Ivan Sagalaev"
,
"All rights reserved."
,
"Redistribution and use in source and binary forms, with or without"
,
"modification, are permitted provided that the following conditions are met:"
,
""
,
" * Redistributions of source code must retain the above copyright"
,
" notice, this list of conditions and the following disclaimer."
,
" * Redistributions in binary form must reproduce the above copyright"
,
" notice, this list of conditions and the following disclaimer in the"
,
" documentation and/or other materials provided with the distribution."
,
" * Neither the name of highlight.js nor the names of its contributors"
,
" may be used to endorse or promote products derived from this software"
,
" without specific prior written permission."
,
""
,
"THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY"
,
"EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"
,
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"
,
"DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY"
,
"DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"
,
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"
,
"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"
,
"ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"
,
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"
,
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
]
},
{
"name"
:
"leff/markdown-it-named-headers"
,
"version"
:
"0.0.0"
,
"license"
:
"UNLICENSE"
,
"isProd"
:
true
,
"repositoryURL"
:
"https://github.com/leff/markdown-it-named-headers"
,
"licenseDetail"
:
[
"This is free and unencumbered software released into the public domain."
,
""
,
"Anyone is free to copy, modify, publish, use, compile, sell, or"
,
"distribute this software, either in source code form or as a compiled"
,
"binary, for any purpose, commercial or non-commercial, and by any"
,
"means."
,
""
,
"In jurisdictions that recognize copyright laws, the author or authors"
,
"of this software dedicate any and all copyright interest in the"
,
"software to the public domain. We make this dedication for the benefit"
,
"of the public at large and to the detriment of our heirs and"
,
"successors. We intend this dedication to be an overt act of"
,
"relinquishment in perpetuity of all present and future rights to this"
,
"software under copyright law."
,
""
,
"THE SOFTWARE IS PROVIDED
\"
AS IS
\"
, WITHOUT WARRANTY OF ANY KIND,"
,
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF"
,
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT."
,
"IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR"
,
"OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,"
,
"ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR"
,
"OTHER DEALINGS IN THE SOFTWARE."
,
""
,
"For more information, please refer to <http://unlicense.org/>"
]
},
{
"name"
:
"textmate/markdown.tmbundle"
,
"version"
:
"0.0.0"
,
"license"
:
"TextMate Bundle License"
,
"repositoryURL"
:
"https://github.com/textmate/markdown.tmbundle"
,
"licenseDetail"
:
[
"If not otherwise specified (see below), files in this repository fall under the following license:"
,
""
,
"Permission to copy, use, modify, sell and distribute this"
,
"software is granted. This software is provided
\"
as is
\"
without"
,
"express or implied warranty, and with no claim as to its"
,
"suitability for any purpose."
,
""
,
"An exception is made for files in readable text which contain their own license information,"
,
"or files where an accompanying file exists (in the same directory) with a
\"
-license
\"
suffix added"
,
"to the base-name name of the original file, and an extension of txt, html, or similar. For example"
,
"
\"
tidy
\"
is accompanied by
\"
tidy-license.txt
\"
."
]
}
]
extensions/markdown/markdown.configuration.json
0 → 100644
浏览文件 @
f5898acf
{
"comments"
:
{
//
symbol
used
for
single
line
comment.
Remove
this
entry
if
your
language
does
not
support
line
comments
"lineComment"
:
"//"
,
//
symbols
used
for
start
and
end
a
block
comment.
Remove
this
entry
if
your
language
does
not
support
block
comments
"blockComment"
:
[
"/*"
,
"*/"
]
},
//
symbols
used
as
brackets
"brackets"
:
[
[
"{"
,
"}"
],
[
"["
,
"]"
],
[
"("
,
")"
]
]
}
\ No newline at end of file
extensions/markdown/media/markdown.css
0 → 100644
浏览文件 @
f5898acf
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
body
{
font-family
:
"Segoe WPC"
,
"Segoe UI"
,
"SFUIText-Light"
,
"HelveticaNeue-Light"
,
sans-serif
,
"Droid Sans Fallback"
;
font-size
:
14px
;
padding-left
:
12px
;
line-height
:
22px
;
}
img
{
max-width
:
100%
;
max-height
:
100%
;
}
a
{
color
:
#4080D0
;
text-decoration
:
none
;
}
a
:focus
,
input
:focus
,
select
:focus
,
textarea
:focus
{
outline
:
1px
solid
-webkit-focus-ring-color
;
outline-offset
:
-1px
;
}
hr
{
border
:
0
;
height
:
2px
;
border-bottom
:
2px
solid
;
}
h1
{
padding-bottom
:
0.3em
;
line-height
:
1.2
;
border-bottom-width
:
1px
;
border-bottom-style
:
solid
;
}
h1
,
h2
,
h3
{
font-weight
:
normal
;
}
a
:hover
{
color
:
#4080D0
;
text-decoration
:
underline
;
}
table
{
border-collapse
:
collapse
;
}
table
>
thead
>
tr
>
th
{
text-align
:
left
;
border-bottom
:
1px
solid
;
}
table
>
thead
>
tr
>
th
,
table
>
thead
>
tr
>
td
,
table
>
tbody
>
tr
>
th
,
table
>
tbody
>
tr
>
td
{
padding
:
5px
10px
;
}
table
>
tbody
>
tr
+
tr
>
td
{
border-top
:
1px
solid
;
}
blockquote
{
margin
:
0
7px
0
5px
;
padding
:
0
16px
0
10px
;
border-left
:
5px
solid
;
}
code
{
font-family
:
Menlo
,
Monaco
,
Consolas
,
"Droid Sans Mono"
,
"Courier New"
,
monospace
,
"Droid Sans Fallback"
;
font-size
:
14px
;
line-height
:
19px
;
}
.mac
code
{
font-size
:
12px
;
line-height
:
18px
;
}
code
>
div
{
padding
:
16px
;
border-radius
:
3px
;
overflow
:
auto
;
}
/** Theming */
.vscode-light
{
color
:
rgb
(
30
,
30
,
30
);
}
.vscode-dark
{
color
:
#DDD
;
}
.vscode-high-contrast
{
color
:
white
;
}
.vscode-light
code
{
color
:
#A31515
;
}
.vscode-dark
code
{
color
:
#D7BA7D
;
}
.vscode-light
code
>
div
{
background-color
:
rgba
(
220
,
220
,
220
,
0.4
);
}
.vscode-dark
code
>
div
{
background-color
:
rgba
(
10
,
10
,
10
,
0.4
);
}
.vscode-high-contrast
code
>
div
{
background-color
:
rgb
(
0
,
0
,
0
);
}
.vscode-high-contrast
h1
{
border-color
:
rgb
(
0
,
0
,
0
);
}
.vscode-light
table
>
thead
>
tr
>
th
{
border-color
:
rgba
(
0
,
0
,
0
,
0.69
);
}
.vscode-dark
table
>
thead
>
tr
>
th
{
border-color
:
rgba
(
255
,
255
,
255
,
0.69
);
}
.vscode-light
h1
,
.vscode-light
hr
,
.vscode-light
table
>
tbody
>
tr
+
tr
>
td
{
border-color
:
rgba
(
0
,
0
,
0
,
0.18
);
}
.vscode-dark
h1
,
.vscode-dark
hr
,
.vscode-dark
table
>
tbody
>
tr
+
tr
>
td
{
border-color
:
rgba
(
255
,
255
,
255
,
0.18
);
}
.vscode-light
blockquote
,
.vscode-dark
blockquote
{
background
:
rgba
(
127
,
127
,
127
,
0.1
);
border-color
:
rgba
(
0
,
122
,
204
,
0.5
);
}
.vscode-high-contrast
blockquote
{
background
:
transparent
;
border-color
:
#fff
;
}
\ No newline at end of file
extensions/markdown/media/tomorrow.css
0 → 100644
浏览文件 @
f5898acf
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Tomorrow Comment */
.hljs-comment
,
.hljs-quote
{
color
:
#8e908c
;
}
/* Tomorrow Red */
.hljs-variable
,
.hljs-template-variable
,
.hljs-tag
,
.hljs-name
,
.hljs-selector-id
,
.hljs-selector-class
,
.hljs-regexp
,
.hljs-deletion
{
color
:
#c82829
;
}
/* Tomorrow Orange */
.hljs-number
,
.hljs-built_in
,
.hljs-builtin-name
,
.hljs-literal
,
.hljs-type
,
.hljs-params
,
.hljs-meta
,
.hljs-link
{
color
:
#f5871f
;
}
/* Tomorrow Yellow */
.hljs-attribute
{
color
:
#eab700
;
}
/* Tomorrow Green */
.hljs-string
,
.hljs-symbol
,
.hljs-bullet
,
.hljs-addition
{
color
:
#718c00
;
}
/* Tomorrow Blue */
.hljs-title
,
.hljs-section
{
color
:
#4271ae
;
}
/* Tomorrow Purple */
.hljs-keyword
,
.hljs-selector-tag
{
color
:
#8959a8
;
}
.hljs
{
display
:
block
;
overflow-x
:
auto
;
color
:
#4d4d4c
;
padding
:
0.5em
;
}
.hljs-emphasis
{
font-style
:
italic
;
}
.hljs-strong
{
font-weight
:
bold
;
}
\ No newline at end of file
extensions/markdown/package.json
浏览文件 @
f5898acf
{
{
"name"
:
"markdown"
,
"name"
:
"vscode-markdown"
,
"version"
:
"0.1.0"
,
"displayName"
:
"VS Code Markdown"
,
"publisher"
:
"vscode"
,
"description"
:
"Markdown for VS Code"
,
"engines"
:
{
"vscode"
:
"*"
},
"version"
:
"0.2.0"
,
"publisher"
:
"Microsoft"
,
"engines"
:
{
"vscode"
:
"^1.0.0"
},
"main"
:
"./out/extension"
,
"categories"
:
[
"Languages"
],
"activationEvents"
:
[
"onCommand:extension.previewMarkdown"
,
"onCommand:extension.previewMarkdownSide"
],
"contributes"
:
{
"contributes"
:
{
"languages"
:
[
{
"id"
:
"markdown"
,
"aliases"
:
[
"Markdown"
,
"markdown"
],
"extensions"
:
[
".md"
,
".mdown"
,
".markdown"
,
".markdn"
],
"configuration"
:
"./markdown.configuration.json"
}
],
"grammars"
:
[
{
"language"
:
"markdown"
,
"scopeName"
:
"text.html.markdown"
,
"path"
:
"./syntaxes/markdown.tmLanguage"
}
],
"commands"
:
[
{
"command"
:
"extension.previewMarkdown"
,
"title"
:
"%markdown.previewMarkdown.title%"
},
{
"command"
:
"extension.previewMarkdownSide"
,
"title"
:
"%markdown.previewMarkdownSide.title%"
}
],
"keybindings"
:
[
{
"command"
:
"extension.previewMarkdown"
,
"key"
:
"shift+ctrl+v"
,
"mac"
:
"shift+cmd+v"
},
{
"command"
:
"extension.previewMarkdownSide"
,
"key"
:
"ctrl+k v"
,
"mac"
:
"cmd+k v"
}
],
"snippets"
:
[{
"snippets"
:
[{
"language"
:
"markdown"
,
"language"
:
"markdown"
,
"path"
:
"./snippets/markdown.json"
"path"
:
"./snippets/markdown.json"
}]
}]
},
"scripts"
:
{
"vscode:prepublish"
:
"node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown ./tsconfig.json"
},
"dependencies"
:
{
"highlight.js"
:
"^9.3.0"
,
"markdown-it"
:
"^6.0.1"
,
"markdown-it-named-headers"
:
"0.0.4"
}
}
}
}
\ No newline at end of file
extensions/markdown/package.nls.json
0 → 100644
浏览文件 @
f5898acf
{
"markdown.previewMarkdown.title"
:
"Markdown: Toggle Preview"
,
"markdown.previewMarkdownSide.title"
:
"Markdown: Open Preview to the Side"
}
\ No newline at end of file
extensions/markdown/src/extension.ts
0 → 100644
浏览文件 @
f5898acf
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
path
from
'
path
'
;
import
{
ExtensionContext
,
TextDocumentContentProvider
,
EventEmitter
,
Event
,
Uri
,
ViewColumn
}
from
"
vscode
"
;
const
hljs
=
require
(
'
highlight.js
'
);
const
mdnh
=
require
(
'
markdown-it-named-headers
'
);
const
md
=
require
(
'
markdown-it
'
)({
html
:
true
,
highlight
:
function
(
str
,
lang
)
{
if
(
lang
&&
hljs
.
getLanguage
(
lang
))
{
try
{
return
`<pre class="hljs"><code><div>
${
hljs
.
highlight
(
lang
,
str
,
true
).
value
}
</div></code></pre>`
;
}
catch
(
error
)
{
}
}
return
`<pre class="hljs"><code><div>
${
md
.
utils
.
escapeHtml
(
str
)}
</div></code></pre>`
;
}
}).
use
(
mdnh
,
{});
export
function
activate
(
context
:
ExtensionContext
)
{
let
provider
=
new
MDDocumentContentProvider
(
context
);
let
registration
=
vscode
.
workspace
.
registerTextDocumentContentProvider
(
'
markdown
'
,
provider
);
let
d1
=
vscode
.
commands
.
registerCommand
(
'
extension.previewMarkdown
'
,
()
=>
openPreview
());
let
d2
=
vscode
.
commands
.
registerCommand
(
'
extension.previewMarkdownSide
'
,
()
=>
openPreview
(
true
));
context
.
subscriptions
.
push
(
d1
,
d2
,
registration
);
vscode
.
workspace
.
onDidSaveTextDocument
(
document
=>
{
if
(
isMarkdownFile
(
document
))
{
const
uri
=
getMarkdownUri
(
document
);
provider
.
update
(
uri
);
}
});
vscode
.
workspace
.
onDidChangeTextDocument
(
event
=>
{
if
(
isMarkdownFile
(
event
.
document
))
{
const
uri
=
getMarkdownUri
(
event
.
document
);
provider
.
update
(
uri
);
}
});
vscode
.
workspace
.
onDidChangeConfiguration
(()
=>
{
vscode
.
workspace
.
textDocuments
.
forEach
((
document
)
=>
{
if
(
isMarkdownFile
)
{
provider
.
update
(
document
.
uri
);
}
});
});
}
function
isMarkdownFile
(
document
:
vscode
.
TextDocument
)
{
return
document
.
languageId
===
'
markdown
'
&&
document
.
uri
.
scheme
!==
'
markdown
'
;
// prevent processing of own documents
}
function
getMarkdownUri
(
document
:
vscode
.
TextDocument
)
{
return
document
.
uri
.
with
({
scheme
:
'
markdown
'
,
query
:
document
.
uri
.
toString
()
});
}
function
openPreview
(
sideBySide
?:
boolean
):
void
{
const
activeEditor
=
vscode
.
window
.
activeTextEditor
;
if
(
!
activeEditor
)
{
vscode
.
commands
.
executeCommand
(
'
workbench.action.navigateBack
'
);
return
;
}
let
markdownPreviewUri
=
getMarkdownUri
(
activeEditor
.
document
);
vscode
.
commands
.
executeCommand
(
'
vscode.previewHtml
'
,
markdownPreviewUri
,
getViewColumn
(
sideBySide
),
`Preview '
${
path
.
basename
(
activeEditor
.
document
.
fileName
)}
'`
);
}
function
getViewColumn
(
sideBySide
):
ViewColumn
{
const
active
=
vscode
.
window
.
activeTextEditor
;
if
(
!
active
)
{
return
ViewColumn
.
One
;
}
if
(
!
sideBySide
)
{
return
active
.
viewColumn
;
}
switch
(
active
.
viewColumn
)
{
case
ViewColumn
.
One
:
return
ViewColumn
.
Two
;
case
ViewColumn
.
Two
:
return
ViewColumn
.
Three
;
}
return
active
.
viewColumn
;
}
class
MDDocumentContentProvider
implements
TextDocumentContentProvider
{
private
_context
:
ExtensionContext
;
private
_onDidChange
=
new
EventEmitter
<
Uri
>
();
private
_waiting
:
boolean
;
constructor
(
context
:
ExtensionContext
)
{
this
.
_context
=
context
;
this
.
_waiting
=
false
;
}
private
getMediaPath
(
mediaFile
)
{
return
this
.
_context
.
asAbsolutePath
(
path
.
join
(
'
media
'
,
mediaFile
));
}
private
fixHref
(
resource
:
Uri
,
href
:
string
)
{
if
(
href
)
{
// Return early if href is already a URL
if
(
Uri
.
parse
(
href
).
scheme
)
{
return
href
;
}
// Otherwise convert to a file URI by joining the href with the resource location
return
Uri
.
file
(
path
.
join
(
path
.
dirname
(
resource
.
fsPath
),
href
)).
toString
();
}
return
href
;
}
private
computeCustomStyleSheetIncludes
(
uri
:
Uri
):
string
[]
{
const
styles
=
vscode
.
workspace
.
getConfiguration
(
'
markdown
'
)[
'
styles
'
];
if
(
styles
&&
Array
.
isArray
(
styles
))
{
return
styles
.
map
((
style
)
=>
{
return
`<link rel="stylesheet" href="
${
this
.
fixHref
(
uri
,
style
)}
" type="text/css" media="screen">`
;
});
}
return
[];
}
public
provideTextDocumentContent
(
uri
:
Uri
):
Thenable
<
string
>
{
return
vscode
.
workspace
.
openTextDocument
(
Uri
.
parse
(
uri
.
query
)).
then
(
document
=>
{
const
head
=
[].
concat
(
'
<!DOCTYPE html>
'
,
'
<html>
'
,
'
<head>
'
,
'
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
'
,
`<link rel="stylesheet" type="text/css" href="
${
this
.
getMediaPath
(
'
markdown.css
'
)}
" >`
,
`<link rel="stylesheet" type="text/css" href="
${
this
.
getMediaPath
(
'
tomorrow.css
'
)}
" >`
,
this
.
computeCustomStyleSheetIncludes
(
uri
),
'
</head>
'
,
'
<body>
'
).
join
(
'
\n
'
);
const
body
=
md
.
render
(
document
.
getText
());
const
tail
=
[
'
</body>
'
,
'
</html>
'
].
join
(
'
\n
'
);
return
head
+
body
+
tail
;
});
}
get
onDidChange
():
Event
<
Uri
>
{
return
this
.
_onDidChange
.
event
;
}
public
update
(
uri
:
Uri
)
{
if
(
!
this
.
_waiting
)
{
this
.
_waiting
=
true
;
setTimeout
(()
=>
{
this
.
_waiting
=
false
;
this
.
_onDidChange
.
fire
(
uri
);
},
300
);
}
}
}
\ No newline at end of file
extensions/markdown/src/typings/ref.d.ts
0 → 100644
浏览文件 @
f5898acf
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path='../../../declares.d.ts'/>
/// <reference path='../../../lib.core.d.ts'/>
/// <reference path='../../../node.d.ts'/>
extensions/markdown/syntaxes/markdown.tmLanguage
0 → 100644
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/markdown/test/colorize-results/test_md.json
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/markdown/tsconfig.json
0 → 100644
浏览文件 @
f5898acf
{
"compilerOptions"
:
{
"module"
:
"commonjs"
,
"target"
:
"es5"
,
"outDir"
:
"out"
,
"noLib"
:
true
,
"sourceMap"
:
true
,
"rootDir"
:
"."
},
"exclude"
:
[
"node_modules"
]
}
\ No newline at end of file
extensions/theme-abyss/themes/Abyss.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-defaults/themes/dark_vs.json
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-defaults/themes/light_plus.json
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-defaults/themes/light_vs.json
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-kimbie-dark/themes/Kimbie_dark.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-monokai-dimmed/themes/dimmed-monokai.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-monokai/themes/Monokai.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-quietlight/themes/QuietLight.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-red/themes/red.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-solarized-dark/themes/Solarized-dark.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-solarized-light/themes/Solarized-light.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
extensions/theme-tomorrow-night-blue/themes/Tomorrow-Night-Blue.tmTheme
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
src/vs/editor/browser/widget/media/tokens.css
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
src/vs/platform/theme/common/themes.ts
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
src/vs/workbench/parts/html/browser/webview.html
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
src/vs/workbench/parts/html/browser/webview.ts
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
src/vs/workbench/workbench.main.ts
浏览文件 @
f5898acf
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录