added vscode extensions
15
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/.eslintignore
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
## extensions
|
||||
*.*
|
||||
!*.js
|
||||
# !*.json ← todo integreate with https://www.npmjs.com/package/eslint-plugin-json
|
||||
# !*.ts ← todo integrate with https://github.com/typescript-eslint/typescript-eslint
|
||||
|
||||
|
||||
## same as in .gitignore
|
||||
.vscode-test
|
||||
*.vsix
|
||||
node_modules
|
||||
out
|
||||
|
||||
|
||||
## special cases
|
||||
16
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/.prettierignore
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
## extensions
|
||||
*.*
|
||||
!*.js
|
||||
!*.json
|
||||
!*.md
|
||||
!*.ts
|
||||
|
||||
|
||||
## same as in .gitignore
|
||||
.vscode-test
|
||||
*.vsix
|
||||
node_modules
|
||||
out
|
||||
|
||||
|
||||
## special cases
|
||||
44
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/.vsixmanifest
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="markdown-preview-enhanced" Version="0.5.22" Publisher="shd101wyy"/>
|
||||
<DisplayName>Markdown Preview Enhanced</DisplayName>
|
||||
<Description xml:space="preserve">Markdown Preview Enhanced ported to vscode</Description>
|
||||
<Tags>markdown,keybindings</Tags>
|
||||
<Categories>Other</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.40.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="workspace" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/shd101wyy/vscode-markdown-preview-enhanced" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/shd101wyy/vscode-markdown-preview-enhanced" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/shd101wyy/vscode-markdown-preview-enhanced" />
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues" />
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
<License>extension/LICENSE.md</License>
|
||||
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.md" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
1
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/CHANGELOG.md
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
Please go check the [project releases page](https://github.com/shd101wyy/vscode-markdown-preview-enhanced).
|
||||
17
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/LICENSE.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
```
|
||||
Copyright (c) 2017 Yiyi Wang
|
||||
All rights reserved.
|
||||
|
||||
Developed by: Yiyi Wang and many other contributors
|
||||
https://github.com/shd101wyy/markdown-preview-enhanced
|
||||
```
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution.
|
||||
Neither the names of Yiyi Wang, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.
|
||||
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 CONTRIBUTORS OR COPYRIGHT HOLDERS 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 WITH THE SOFTWARE.
|
||||
80
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/README.md
vendored
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
<h1 align="center"> Markdown Preview Enhanced </h1>
|
||||
|
||||

|
||||
|
||||
<p align="center">
|
||||
<a href="https://shd101wyy.github.io/markdown-preview-enhanced/#/"> English </a>
|
||||
<a href="https://shd101wyy.github.io/markdown-preview-enhanced/#/zh-cn/"> 简体中文 </a>
|
||||
<a href="https://shd101wyy.github.io/markdown-preview-enhanced/#/zh-tw/"> 正體中文 </a>
|
||||
<a href="https://shd101wyy.github.io/markdown-preview-enhanced/#/ja-jp/"> 日本語 </a> <br>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://atom.io/packages/markdown-preview-enhanced">atom</a>
|
||||
&
|
||||
<a href="https://marketplace.visualstudio.com/items?itemName=shd101wyy.markdown-preview-enhanced">vscode</a>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://a.paddle.com/v2/click/16413/111548?link=1227"><img src="https://img.shields.io/badge/LEARN-VSCODE%20POWER%20USER%20COURSE%20%E2%86%92-gray.svg?colorB=4D2AFF" alt="Become VSCode Power User"></a>
|
||||
</p>
|
||||
|
||||
If you are interested, please try out our new prototype web app: [0xGG/crossnote](https://github.com/0xGG/crossnote)
|
||||
|
||||
## Supporting this project
|
||||
|
||||
Markdown Preview Enhanced is an open source project released under the [University of Illinois/NCSA Open Source License](https://github.com/shd101wyy/vscode-markdown-preview-enhanced/blob/HEAD/LICENSE.md). Its ongoing development is made possible thanks to the support by these awesome [backers](https://shd101wyy.github.io/markdown-preview-enhanced/#/backers). You can help make this project better by [supporting us on GitHub Sponsors](https://github.com/sponsors/shd101wyy), [PayPal](https://shd101wyy.github.io/markdown-preview-enhanced/#/paypal), or [微信支付 Wechat Pay](https://shd101wyy.github.io/markdown-preview-enhanced/#/wechat). Thank you!
|
||||
|
||||
## Sponsors
|
||||
|
||||
<p><a title="Try CodeStream" href="https://sponsorlink.codestream.com/?utm_source=vscmarket&utm_campaign=shd101wyy-markdown&utm_medium=banner"><img src="https://alt-images.codestream.com/codestream_logo_shd101wyy-markdown.png"></a></br>
|
||||
Manage pull requests and conduct code reviews in your IDE with full source-tree context. Comment on any line, not just the diffs. Use jump-to-definition, your favorite keybindings, and code intelligence with more of your workflow.<br> <a title="Try CodeStream" href="https://sponsorlink.codestream.com/?utm_source=vscmarket&utm_campaign=shd101wyy-markdown&utm_medium=banner">Learn More</a></p>
|
||||
|
||||
<br>
|
||||
|
||||
<a href="https://github.com/sponsors/shd101wyy">
|
||||
<img src="https://github.blog/wp-content/uploads/2019/05/mona-heart-featured.png?" width="200"></a><br>
|
||||
|
||||
These [GitHub Sponsors](https://github.com/sponsors/shd101wyy#sponsors) and [Backers](https://shd101wyy.github.io/markdown-preview-enhanced/#/backers) help push this project forward 🎉.
|
||||
|
||||
## Introduction
|
||||
|
||||
Markdown Preview Enhanced is an extension that provides you with many useful functionalities such as automatic scroll sync, [math typesetting](https://shd101wyy.github.io/markdown-preview-enhanced/#/math), [mermaid](https://shd101wyy.github.io/markdown-preview-enhanced/#/diagrams?id=mermaid), [PlantUML](https://shd101wyy.github.io/markdown-preview-enhanced/#/diagrams?id=plantuml), [pandoc](https://shd101wyy.github.io/markdown-preview-enhanced/#/pandoc), PDF export, [code chunk](https://shd101wyy.github.io/markdown-preview-enhanced/#/code-chunk), [presentation writer](https://rawgit.com/shd101wyy/markdown-preview-enhanced/master/docs/presentation-intro.html), etc. A lot of its ideas are inspired by [Markdown Preview Plus](https://github.com/atom-community/markdown-preview-plus) and [RStudio Markdown](http://rmarkdown.rstudio.com/).
|
||||
|
||||
Feel free to ask questions, post issues, submit pull request, and request new features.
|
||||
|
||||
For more information about this project and how to use this extension, please check out our documentation ⬇︎
|
||||
|
||||
## Documentation
|
||||
|
||||
To check out the documentation, visit
|
||||
|
||||
- [English](https://shd101wyy.github.io/markdown-preview-enhanced/#/)
|
||||
- [简体中文](https://shd101wyy.github.io/markdown-preview-enhanced/#/zh-cn/)
|
||||
- [正體中文](https://shd101wyy.github.io/markdown-preview-enhanced/#/zh-tw/)
|
||||
- [日本語](https://shd101wyy.github.io/markdown-preview-enhanced/#/ja-jp/)
|
||||
|
||||
Contact me if you are willing to help translate the documentation :)
|
||||
|
||||
## Keybindings
|
||||
|
||||
> The <kbd>cmd</kbd> key for _Windows_ is <kbd>ctrl</kbd>.
|
||||
|
||||
| Shortcuts | Functionality |
|
||||
| ------------------------------------------------- | -------------------------- |
|
||||
| <kbd>cmd-k v</kbd> or <kbd>ctrl-k v</kbd> | Open preview to the Side |
|
||||
| <kbd>cmd-shift-v</kbd> or <kbd>ctrl-shift-v</kbd> | Open preview |
|
||||
| <kbd>ctrl-shift-s</kbd> | Sync preview / Sync source |
|
||||
| <kbd>shift-enter</kbd> | Run Code Chunk |
|
||||
| <kbd>ctrl-shift-enter</kbd> | Run all Code Chunks |
|
||||
| <kbd>cmd-=</kbd> or <kbd>cmd-shift-=</kbd> | Preview zoom in |
|
||||
| <kbd>cmd--</kbd> or <kbd>cmd-shift-\_</kbd> | Preview zoom out |
|
||||
| <kbd>cmd-0</kbd> | Preview reset zoom |
|
||||
| <kbd>esc</kbd> | Toggle sidebar TOC |
|
||||
|
||||
## Changelog
|
||||
|
||||
Please check the [Releases](https://github.com/shd101wyy/vscode-markdown-preview-enhanced/releases) page of this project.
|
||||
|
||||
## License
|
||||
|
||||
[University of Illinois/NCSA Open Source License](https://github.com/shd101wyy/vscode-markdown-preview-enhanced/blob/HEAD/LICENSE.md)
|
||||
19
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/PreviewOnRightPane_16x.svg
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.icon_x002D_vs_x002D_bg{fill:#424242;}
|
||||
</style>
|
||||
<g id="canvas">
|
||||
</g>
|
||||
<g id="outline">
|
||||
</g>
|
||||
<g id="iconFg">
|
||||
</g>
|
||||
<g id="iconBg">
|
||||
<path class="icon_x002D_vs_x002D_bg" d="M9,5h5v2.4c0.4,0.2,0.7,0.4,1,0.7V2H1v12h5.6L9,11.6V5z M2,13V5h5v8H2z M11.3,12.7
|
||||
c0.4,0.2,0.8,0.3,1.2,0.3c1.4,0,2.5-1.1,2.5-2.5C15,9.1,13.9,8,12.5,8C11.1,8,10,9.1,10,10.5c0,0.4,0.1,0.8,0.3,1.2L8,14l1,1
|
||||
L11.3,12.7z M11,10.5C11,9.7,11.7,9,12.5,9c0.8,0,1.5,0.7,1.5,1.5c0,0.8-0.7,1.5-1.5,1.5C11.7,12,11,11.3,11,10.5z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 857 B |
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#C5C5C5;}
|
||||
</style>
|
||||
<g id="canvas">
|
||||
</g>
|
||||
<g id="outline">
|
||||
</g>
|
||||
<g id="iconFg">
|
||||
</g>
|
||||
<g id="iconBg">
|
||||
<path class="st0" d="M9,5h5v2.4c0.4,0.2,0.7,0.4,1,0.7V2H1v12h5.6L9,11.6V5z M2,13V5h5v8H2z M11.3,12.7c0.4,0.2,0.8,0.3,1.2,0.3
|
||||
c1.4,0,2.5-1.1,2.5-2.5C15,9.1,13.9,8,12.5,8C11.1,8,10,9.1,10,10.5c0,0.4,0.1,0.8,0.3,1.2L8,14l1,1L11.3,12.7z M11,10.5
|
||||
C11,9.7,11.7,9,12.5,9c0.8,0,1.5,0.7,1.5,1.5c0,0.8-0.7,1.5-1.5,1.5C11.7,12,11,11.3,11,10.5z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 819 B |
3
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/preview-dark.svg
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 311 B |
3
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/preview-light.svg
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V13L2 14H14L15 13V3L14 2H2ZM2 13V3H14V13H2ZM12 5H4V6H12V5ZM3 4V7H13V4H3ZM7 9H3V8H7V9ZM3 12H7V11H3V12ZM12 9H10V11H12V9ZM9 8V12H13V8H9Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 311 B |
4
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/preview-right-dark.svg
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.219 8.35484C11.6063 8.12309 12.049 8.00047 12.5003 8C12.8904 7.99939 13.2753 8.0901 13.6241 8.26486C13.9729 8.43963 14.276 8.6936 14.5091 9.00646C14.7421 9.31933 14.8987 9.6824 14.9664 10.0666C15.034 10.4509 15.0108 10.8456 14.8985 11.2192C14.7863 11.5929 14.5882 11.9351 14.32 12.2184C14.0518 12.5018 13.7211 12.7185 13.3542 12.8511C12.9873 12.9837 12.5944 13.0287 12.207 12.9823C11.8197 12.9359 11.4485 12.7995 11.1233 12.584L8.7683 14.9399L8.06055 14.2322L10.4163 11.877C10.1677 11.5003 10.0258 11.0634 10.0054 10.6126C9.98511 10.1618 10.0872 9.71384 10.3009 9.31634C10.5145 8.91885 10.8318 8.58659 11.219 8.35484ZM11.667 11.7472C11.9136 11.912 12.2036 12 12.5003 12C12.8981 12 13.2797 11.842 13.561 11.5607C13.8423 11.2794 14.0003 10.8978 14.0003 10.5C14.0003 10.2033 13.9123 9.91332 13.7475 9.66665C13.5827 9.41997 13.3484 9.22772 13.0743 9.11418C12.8002 9.00065 12.4986 8.97095 12.2077 9.02883C11.9167 9.0867 11.6494 9.22956 11.4396 9.43934C11.2299 9.64912 11.087 9.9164 11.0291 10.2074C10.9712 10.4983 11.001 10.7999 11.1145 11.074C11.228 11.3481 11.4203 11.5824 11.667 11.7472Z" fill="#C5C5C5"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 1L14 2V7.33573C13.6829 7.18584 13.3457 7.08481 13 7.03533V2L8 2L8 12.8787L6.87837 14H2L1 13V2L2 1H13ZM9.70794 14H9.70785L10 13.7077V13.7079L9.70794 14ZM13 10.5174C13.0002 10.5116 13.0003 10.5058 13.0003 10.5C13.0003 10.4942 13.0002 10.4884 13 10.4826V10.5174ZM2 2L7 2L7 13H2L2 2Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
4
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/preview-right-light.svg
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.219 8.35484C11.6063 8.12309 12.049 8.00047 12.5003 8C12.8904 7.99939 13.2753 8.0901 13.6241 8.26486C13.9729 8.43963 14.276 8.6936 14.5091 9.00646C14.7421 9.31933 14.8987 9.6824 14.9664 10.0666C15.034 10.4509 15.0108 10.8456 14.8985 11.2192C14.7863 11.5929 14.5882 11.9351 14.32 12.2184C14.0518 12.5018 13.7211 12.7185 13.3542 12.8511C12.9873 12.9837 12.5944 13.0287 12.207 12.9823C11.8197 12.9359 11.4485 12.7995 11.1233 12.584L8.7683 14.9399L8.06055 14.2322L10.4163 11.877C10.1677 11.5003 10.0258 11.0634 10.0054 10.6126C9.98511 10.1618 10.0872 9.71384 10.3009 9.31634C10.5145 8.91885 10.8318 8.58659 11.219 8.35484ZM11.667 11.7472C11.9136 11.912 12.2036 12 12.5003 12C12.8981 12 13.2797 11.842 13.561 11.5607C13.8423 11.2794 14.0003 10.8978 14.0003 10.5C14.0003 10.2033 13.9123 9.91332 13.7475 9.66665C13.5827 9.41997 13.3484 9.22772 13.0743 9.11418C12.8002 9.00065 12.4986 8.97095 12.2077 9.02883C11.9167 9.0867 11.6494 9.22956 11.4396 9.43934C11.2299 9.64912 11.087 9.9164 11.0291 10.2074C10.9712 10.4983 11.001 10.7999 11.1145 11.074C11.228 11.3481 11.4203 11.5824 11.667 11.7472Z" fill="#424242"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 1L14 2V7.33573C13.6829 7.18584 13.3457 7.08481 13 7.03533V2L8 2L8 12.8787L6.87837 14H2L1 13V2L2 1H13ZM9.70794 14H9.70785L10 13.7077V13.7079L9.70794 14ZM13 10.5174C13.0002 10.5116 13.0003 10.5058 13.0003 10.5C13.0003 10.4942 13.0002 10.4884 13 10.4826V10.5174ZM2 2L7 2L7 13H2L2 2Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
52
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/media/preview.svg
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 508 508" style="enable-background:new 0 0 508 508;" xml:space="preserve">
|
||||
<path style="fill:#F2F2F2;" d="M390.213,0h-369c-11.7,0-21.2,9.5-21.2,21.2v375.1l111.8,111.7h278.4c11.7,0,21.2-9.5,21.2-21.2V21.2
|
||||
C411.413,9.5,401.913,0,390.213,0z"/>
|
||||
<rect x="62.013" y="241.1" style="fill:#CDD5DF;" width="287.3" height="25.8"/>
|
||||
<rect x="62.013" y="76.7" style="fill:#FFD05C;" width="151.7" height="25.8"/>
|
||||
<rect x="213.713" y="405.5" style="fill:#65C5B8;" width="135.6" height="25.8"/>
|
||||
<g>
|
||||
<rect x="62.013" y="323.3" style="fill:#CDD5DF;" width="287.3" height="25.8"/>
|
||||
<rect x="62.013" y="158.9" style="fill:#CDD5DF;" width="287.3" height="25.8"/>
|
||||
</g>
|
||||
<rect x="393.608" y="321.101" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 934.7972 285.7962)" style="fill:#F05540;" width="29.2" height="30.8"/>
|
||||
<path style="fill:#41596B;" d="M403.913,156.4c-48.5-48.5-127.3-48.5-175.8,0s-48.5,127.3,0,175.8s127.3,48.5,175.8,0
|
||||
S452.413,204.9,403.913,156.4z"/>
|
||||
<path style="fill:#FFD05C;" d="M498.613,381.4l-39.2-39.2c-12.6-12.6-32.9-12.6-45.5,0s-12.6,32.9,0,45.5l39.2,39.2
|
||||
c12.6,12.6,32.9,12.6,45.5,0C511.112,414.3,511.112,393.9,498.613,381.4z"/>
|
||||
<path style="fill:#FFFFFF;" d="M378.213,306.5c-34.3,34.3-90.1,34.3-124.3,0c-34.3-34.3-34.3-90.1,0-124.3
|
||||
c34.3-34.3,90.1-34.3,124.3,0C412.513,216.4,412.513,272.2,378.213,306.5z"/>
|
||||
<path style="fill:#CDD5DF;" d="M111.813,417.4c0-11.7-9.5-21.2-21.2-21.2h-90.6l111.8,111.8V417.4z"/>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
64
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/out/src/config.js
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MarkdownPreviewEnhancedConfig = void 0;
|
||||
const vscode = require("vscode");
|
||||
class MarkdownPreviewEnhancedConfig {
|
||||
constructor() {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
this.configPath = (config.get("configPath") || "").trim();
|
||||
this.usePandocParser = config.get("usePandocParser");
|
||||
this.breakOnSingleNewLine = config.get("breakOnSingleNewLine");
|
||||
this.enableTypographer = config.get("enableTypographer");
|
||||
this.enableWikiLinkSyntax = config.get("enableWikiLinkSyntax");
|
||||
this.enableLinkify = config.get("enableLinkify");
|
||||
this.useGitHubStylePipedLink = config.get("useGitHubStylePipedLink");
|
||||
this.wikiLinkFileExtension = config.get("wikiLinkFileExtension");
|
||||
this.enableEmojiSyntax = config.get("enableEmojiSyntax");
|
||||
this.enableExtendedTableSyntax = config.get("enableExtendedTableSyntax");
|
||||
this.enableCriticMarkupSyntax = config.get("enableCriticMarkupSyntax");
|
||||
this.frontMatterRenderingOption = config.get("frontMatterRenderingOption");
|
||||
this.mermaidTheme = config.get("mermaidTheme");
|
||||
this.mathRenderingOption = config.get("mathRenderingOption");
|
||||
this.mathInlineDelimiters = config.get("mathInlineDelimiters");
|
||||
this.mathBlockDelimiters = config.get("mathBlockDelimiters");
|
||||
this.mathRenderingOnlineService = config.get("mathRenderingOnlineService");
|
||||
this.codeBlockTheme = config.get("codeBlockTheme");
|
||||
this.previewTheme = config.get("previewTheme");
|
||||
this.revealjsTheme = config.get("revealjsTheme");
|
||||
this.protocolsWhiteList = config.get("protocolsWhiteList");
|
||||
this.imageFolderPath = config.get("imageFolderPath");
|
||||
this.imageUploader = config.get("imageUploader");
|
||||
this.printBackground = config.get("printBackground");
|
||||
this.chromePath = config.get("chromePath");
|
||||
this.imageMagickPath = config.get("imageMagickPath");
|
||||
this.pandocPath = config.get("pandocPath");
|
||||
this.pandocMarkdownFlavor = config.get("pandocMarkdownFlavor");
|
||||
this.pandocArguments = config.get("pandocArguments");
|
||||
this.latexEngine = config.get("latexEngine");
|
||||
this.enableScriptExecution = config.get("enableScriptExecution");
|
||||
this.scrollSync = config.get("scrollSync");
|
||||
this.liveUpdate = config.get("liveUpdate");
|
||||
this.singlePreview = config.get("singlePreview");
|
||||
this.automaticallyShowPreviewOfMarkdownBeingEdited = config.get("automaticallyShowPreviewOfMarkdownBeingEdited");
|
||||
this.enableHTML5Embed = config.get("enableHTML5Embed");
|
||||
this.HTML5EmbedUseImageSyntax = config.get("HTML5EmbedUseImageSyntax");
|
||||
this.HTML5EmbedUseLinkSyntax = config.get("HTML5EmbedUseLinkSyntax");
|
||||
this.HTML5EmbedIsAllowedHttp = config.get("HTML5EmbedIsAllowedHttp");
|
||||
this.HTML5EmbedAudioAttributes = config.get("HTML5EmbedAudioAttributes");
|
||||
this.HTML5EmbedVideoAttributes = config.get("HTML5EmbedVideoAttributes");
|
||||
this.puppeteerWaitForTimeout = config.get("puppeteerWaitForTimeout");
|
||||
this.usePuppeteerCore = config.get("usePuppeteerCore");
|
||||
this.puppeteerArgs = config.get("puppeteerArgs");
|
||||
this.plantumlServer = config.get("plantumlServer");
|
||||
}
|
||||
static getCurrentConfig() {
|
||||
return new MarkdownPreviewEnhancedConfig();
|
||||
}
|
||||
isEqualTo(otherConfig) {
|
||||
const json1 = JSON.stringify(this);
|
||||
const json2 = JSON.stringify(otherConfig);
|
||||
return json1 === json2;
|
||||
}
|
||||
}
|
||||
exports.MarkdownPreviewEnhancedConfig = MarkdownPreviewEnhancedConfig;
|
||||
//# sourceMappingURL=config.js.map
|
||||
514
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/out/src/extension.js
vendored
Normal file
|
|
@ -0,0 +1,514 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.deactivate = exports.getBottomVisibleLine = exports.getTopVisibleLine = exports.activate = void 0;
|
||||
// The module 'vscode' contains the VS Code extensibility API
|
||||
// Import the module and reference it with the alias vscode in your code below
|
||||
const mume_1 = require("@shd101wyy/mume");
|
||||
const path = require("path");
|
||||
const vscode = require("vscode");
|
||||
const image_helper_1 = require("./image-helper");
|
||||
const preview_content_provider_1 = require("./preview-content-provider");
|
||||
let editorScrollDelay = Date.now();
|
||||
// this method is called when your extension iopenTextDocuments activated
|
||||
// your extension is activated the very first time the command is executed
|
||||
function activate(context) {
|
||||
// assume only one preview supported.
|
||||
const contentProvider = new preview_content_provider_1.MarkdownPreviewEnhancedView(context);
|
||||
function openPreviewToTheSide(uri) {
|
||||
let resource = uri;
|
||||
if (!(resource instanceof vscode.Uri)) {
|
||||
if (vscode.window.activeTextEditor) {
|
||||
// we are relaxed and don't check for markdown files
|
||||
resource = vscode.window.activeTextEditor.document.uri;
|
||||
}
|
||||
}
|
||||
contentProvider.initPreview(resource, vscode.window.activeTextEditor, {
|
||||
viewColumn: vscode.ViewColumn.Two,
|
||||
preserveFocus: true,
|
||||
});
|
||||
}
|
||||
function openPreview(uri) {
|
||||
let resource = uri;
|
||||
if (!(resource instanceof vscode.Uri)) {
|
||||
if (vscode.window.activeTextEditor) {
|
||||
// we are relaxed and don't check for markdown files
|
||||
resource = vscode.window.activeTextEditor.document.uri;
|
||||
}
|
||||
}
|
||||
contentProvider.initPreview(resource, vscode.window.activeTextEditor, {
|
||||
viewColumn: vscode.ViewColumn.One,
|
||||
preserveFocus: false,
|
||||
});
|
||||
}
|
||||
function toggleScrollSync() {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
const scrollSync = !config.get("scrollSync");
|
||||
config.update("scrollSync", scrollSync, true).then(() => {
|
||||
contentProvider.updateConfiguration();
|
||||
if (scrollSync) {
|
||||
vscode.window.showInformationMessage("Scroll Sync is enabled");
|
||||
}
|
||||
else {
|
||||
vscode.window.showInformationMessage("Scroll Sync is disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleLiveUpdate() {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
const liveUpdate = !config.get("liveUpdate");
|
||||
config.update("liveUpdate", liveUpdate, true).then(() => {
|
||||
contentProvider.updateConfiguration();
|
||||
if (liveUpdate) {
|
||||
vscode.window.showInformationMessage("Live Update is enabled");
|
||||
}
|
||||
else {
|
||||
vscode.window.showInformationMessage("Live Update is disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
function toggleBreakOnSingleNewLine() {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
const breakOnSingleNewLine = !config.get("breakOnSingleNewLine");
|
||||
config
|
||||
.update("breakOnSingleNewLine", breakOnSingleNewLine, true)
|
||||
.then(() => {
|
||||
contentProvider.updateConfiguration();
|
||||
if (breakOnSingleNewLine) {
|
||||
vscode.window.showInformationMessage("Break On Single New Line is enabled");
|
||||
}
|
||||
else {
|
||||
vscode.window.showInformationMessage("Break On Single New Line is disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
function customizeCSS() {
|
||||
const globalStyleLessFile = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./style.less"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(globalStyleLessFile));
|
||||
}
|
||||
function openMermaidConfig() {
|
||||
const mermaidConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mermaid_config.js"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mermaidConfigFilePath));
|
||||
}
|
||||
function openMathJaxConfig() {
|
||||
const mathjaxConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./mathjax_config.js"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(mathjaxConfigFilePath));
|
||||
}
|
||||
function openKaTeXConfig() {
|
||||
const katexConfigFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./katex_config.js"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(katexConfigFilePath));
|
||||
}
|
||||
function extendParser() {
|
||||
const parserConfigPath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./parser.js"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(parserConfigPath));
|
||||
}
|
||||
function showUploadedImages() {
|
||||
const imageHistoryFilePath = mume_1.utility.addFileProtocol(path.resolve(mume_1.getExtensionConfigPath(), "./image_history.md"));
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(imageHistoryFilePath));
|
||||
}
|
||||
function insertNewSlide() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor && editor.document && editor.edit) {
|
||||
editor.edit((textEdit) => {
|
||||
textEdit.insert(editor.selection.active, "<!-- slide -->\n");
|
||||
});
|
||||
}
|
||||
}
|
||||
function insertPagebreak() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor && editor.document && editor.edit) {
|
||||
editor.edit((textEdit) => {
|
||||
textEdit.insert(editor.selection.active, "<!-- pagebreak -->\n");
|
||||
});
|
||||
}
|
||||
}
|
||||
function createTOC() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor && editor.document && editor.edit) {
|
||||
editor.edit((textEdit) => {
|
||||
textEdit.insert(editor.selection.active, '\n<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->\n');
|
||||
});
|
||||
}
|
||||
}
|
||||
function insertTable() {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
if (editor && editor.document && editor.edit) {
|
||||
editor.edit((textEdit) => {
|
||||
textEdit.insert(editor.selection.active, `| | |
|
||||
|---|---|
|
||||
| | |
|
||||
`);
|
||||
});
|
||||
}
|
||||
}
|
||||
function openImageHelper() {
|
||||
contentProvider.openImageHelper(vscode.window.activeTextEditor.document.uri);
|
||||
}
|
||||
function webviewFinishLoading(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.updateMarkdown(sourceUri);
|
||||
}
|
||||
/**
|
||||
* Insert imageUrl to markdown file
|
||||
* @param uri: markdown source uri
|
||||
* @param imageUrl: url of image to be inserted
|
||||
*/
|
||||
function insertImageUrl(uri, imageUrl) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
vscode.window.visibleTextEditors
|
||||
.filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&
|
||||
editor.document.uri.fsPath === sourceUri.fsPath)
|
||||
.forEach((editor) => {
|
||||
// const line = editor.selection.active.line
|
||||
editor.edit((textEditorEdit) => {
|
||||
textEditorEdit.insert(editor.selection.active, ``);
|
||||
});
|
||||
});
|
||||
}
|
||||
function refreshPreview(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.refreshPreview(sourceUri);
|
||||
}
|
||||
function openInBrowser(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.openInBrowser(sourceUri);
|
||||
}
|
||||
function htmlExport(uri, offline) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.htmlExport(sourceUri, offline);
|
||||
}
|
||||
function chromeExport(uri, type) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.chromeExport(sourceUri, type);
|
||||
}
|
||||
function princeExport(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.princeExport(sourceUri);
|
||||
}
|
||||
function eBookExport(uri, fileType) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.eBookExport(sourceUri, fileType);
|
||||
}
|
||||
function pandocExport(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.pandocExport(sourceUri);
|
||||
}
|
||||
function markdownExport(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.markdownExport(sourceUri);
|
||||
}
|
||||
/*
|
||||
function cacheSVG(uri, code, svg) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.cacheSVG(sourceUri, code, svg)
|
||||
}
|
||||
*/
|
||||
function cacheCodeChunkResult(uri, id, result) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.cacheCodeChunkResult(sourceUri, id, result);
|
||||
}
|
||||
function runCodeChunk(uri, codeChunkId) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.runCodeChunk(sourceUri, codeChunkId);
|
||||
}
|
||||
function runAllCodeChunks(uri) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
contentProvider.runAllCodeChunks(sourceUri);
|
||||
}
|
||||
function runAllCodeChunksCommand() {
|
||||
const textEditor = vscode.window.activeTextEditor;
|
||||
if (!textEditor.document) {
|
||||
return;
|
||||
}
|
||||
if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) {
|
||||
return;
|
||||
}
|
||||
const sourceUri = textEditor.document.uri;
|
||||
const previewUri = preview_content_provider_1.getPreviewUri(sourceUri);
|
||||
if (!previewUri) {
|
||||
return;
|
||||
}
|
||||
contentProvider.previewPostMessage(sourceUri, {
|
||||
command: "runAllCodeChunks",
|
||||
});
|
||||
}
|
||||
function runCodeChunkCommand() {
|
||||
const textEditor = vscode.window.activeTextEditor;
|
||||
if (!textEditor.document) {
|
||||
return;
|
||||
}
|
||||
if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) {
|
||||
return;
|
||||
}
|
||||
const sourceUri = textEditor.document.uri;
|
||||
const previewUri = preview_content_provider_1.getPreviewUri(sourceUri);
|
||||
if (!previewUri) {
|
||||
return;
|
||||
}
|
||||
contentProvider.previewPostMessage(sourceUri, {
|
||||
command: "runCodeChunk",
|
||||
});
|
||||
}
|
||||
function syncPreview() {
|
||||
const textEditor = vscode.window.activeTextEditor;
|
||||
if (!textEditor.document) {
|
||||
return;
|
||||
}
|
||||
if (!preview_content_provider_1.isMarkdownFile(textEditor.document)) {
|
||||
return;
|
||||
}
|
||||
const sourceUri = textEditor.document.uri;
|
||||
contentProvider.previewPostMessage(sourceUri, {
|
||||
command: "changeTextEditorSelection",
|
||||
line: textEditor.selections[0].active.line,
|
||||
forced: true,
|
||||
});
|
||||
}
|
||||
function clickTagA(uri, href) {
|
||||
href = decodeURIComponent(href);
|
||||
href = href
|
||||
.replace(/^vscode\-resource:\/\//, "")
|
||||
.replace(/^vscode\-webview\-resource:\/\/(.+?)\//, "")
|
||||
.replace(/^file\/\/\//, "file:///")
|
||||
.replace(/^https?:\/\/(.+?)\.vscode-webview-test.com\/vscode-resource\/file\/+/, "file:///")
|
||||
.replace(/^https?:\/\/file(.+?)\.vscode-webview\.net\/+/, "file:///");
|
||||
if ([".pdf", ".xls", ".xlsx", ".doc", ".ppt", ".docx", ".pptx"].indexOf(path.extname(href)) >= 0) {
|
||||
mume_1.utility.openFile(href);
|
||||
}
|
||||
else if (href.match(/^file:\/\/\//)) {
|
||||
// openFilePath = href.slice(8) # remove protocol
|
||||
let openFilePath = mume_1.utility.addFileProtocol(href.replace(/(\s*)[\#\?](.+)$/, "")); // remove #anchor and ?params...
|
||||
openFilePath = decodeURI(openFilePath);
|
||||
vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(openFilePath), vscode.ViewColumn.One);
|
||||
}
|
||||
else {
|
||||
mume_1.utility.openFile(href);
|
||||
}
|
||||
}
|
||||
function clickTaskListCheckbox(uri, dataLine) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
const visibleTextEditors = vscode.window.visibleTextEditors;
|
||||
for (let i = 0; i < visibleTextEditors.length; i++) {
|
||||
const editor = visibleTextEditors[i];
|
||||
if (editor.document.uri.fsPath === sourceUri.fsPath) {
|
||||
dataLine = parseInt(dataLine, 10);
|
||||
editor.edit((edit) => {
|
||||
let line = editor.document.lineAt(dataLine).text;
|
||||
if (line.match(/\[ \]/)) {
|
||||
line = line.replace("[ ]", "[x]");
|
||||
}
|
||||
else {
|
||||
line = line.replace(/\[[xX]\]/, "[ ]");
|
||||
}
|
||||
edit.replace(new vscode.Range(new vscode.Position(dataLine, 0), new vscode.Position(dataLine, line.length)), line);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
function setPreviewTheme(uri, theme) {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
config.update("previewTheme", theme, true);
|
||||
}
|
||||
context.subscriptions.push(vscode.workspace.onDidSaveTextDocument((document) => {
|
||||
if (preview_content_provider_1.isMarkdownFile(document)) {
|
||||
contentProvider.updateMarkdown(document.uri, true);
|
||||
}
|
||||
}));
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeTextDocument((event) => {
|
||||
if (preview_content_provider_1.isMarkdownFile(event.document)) {
|
||||
contentProvider.update(event.document.uri);
|
||||
}
|
||||
}));
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
|
||||
contentProvider.updateConfiguration();
|
||||
}));
|
||||
context.subscriptions.push(vscode.window.onDidChangeTextEditorSelection((event) => {
|
||||
if (preview_content_provider_1.isMarkdownFile(event.textEditor.document)) {
|
||||
const firstVisibleScreenRow = getTopVisibleLine(event.textEditor);
|
||||
const lastVisibleScreenRow = getBottomVisibleLine(event.textEditor);
|
||||
const topRatio = (event.selections[0].active.line - firstVisibleScreenRow) /
|
||||
(lastVisibleScreenRow - firstVisibleScreenRow);
|
||||
contentProvider.previewPostMessage(event.textEditor.document.uri, {
|
||||
command: "changeTextEditorSelection",
|
||||
line: event.selections[0].active.line,
|
||||
topRatio,
|
||||
});
|
||||
}
|
||||
}));
|
||||
context.subscriptions.push(vscode.window.onDidChangeTextEditorVisibleRanges((event) => {
|
||||
const textEditor = event.textEditor;
|
||||
if (Date.now() < editorScrollDelay) {
|
||||
return;
|
||||
}
|
||||
if (preview_content_provider_1.isMarkdownFile(textEditor.document)) {
|
||||
const sourceUri = textEditor.document.uri;
|
||||
if (!event.textEditor.visibleRanges.length) {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
const topLine = getTopVisibleLine(textEditor);
|
||||
const bottomLine = getBottomVisibleLine(textEditor);
|
||||
let midLine;
|
||||
if (topLine === 0) {
|
||||
midLine = 0;
|
||||
}
|
||||
else if (Math.floor(bottomLine) ===
|
||||
textEditor.document.lineCount - 1) {
|
||||
midLine = bottomLine;
|
||||
}
|
||||
else {
|
||||
midLine = Math.floor((topLine + bottomLine) / 2);
|
||||
}
|
||||
contentProvider.previewPostMessage(sourceUri, {
|
||||
command: "changeTextEditorSelection",
|
||||
line: midLine,
|
||||
});
|
||||
}
|
||||
}
|
||||
}));
|
||||
/**
|
||||
* Open preview automatically if the `automaticallyShowPreviewOfMarkdownBeingEdited` is on.
|
||||
* @param textEditor
|
||||
*/
|
||||
context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor((textEditor) => {
|
||||
if (textEditor && textEditor.document && textEditor.document.uri) {
|
||||
if (preview_content_provider_1.isMarkdownFile(textEditor.document)) {
|
||||
const sourceUri = textEditor.document.uri;
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
const automaticallyShowPreviewOfMarkdownBeingEdited = config.get("automaticallyShowPreviewOfMarkdownBeingEdited");
|
||||
const isUsingSinglePreview = config.get("singlePreview");
|
||||
/**
|
||||
* Is using single preview and the preview is on.
|
||||
* When we switched text ed()tor, update preview to that text editor.
|
||||
*/
|
||||
if (contentProvider.isPreviewOn(sourceUri)) {
|
||||
if (isUsingSinglePreview &&
|
||||
!contentProvider.previewHasTheSameSingleSourceUri(sourceUri)) {
|
||||
contentProvider.initPreview(sourceUri, textEditor, {
|
||||
viewColumn: contentProvider.getPreview(sourceUri).viewColumn,
|
||||
preserveFocus: true,
|
||||
});
|
||||
}
|
||||
else if (!isUsingSinglePreview) {
|
||||
const previewPanel = contentProvider.getPreview(sourceUri);
|
||||
if (previewPanel) {
|
||||
previewPanel.reveal(vscode.ViewColumn.Two, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (automaticallyShowPreviewOfMarkdownBeingEdited) {
|
||||
openPreviewToTheSide(sourceUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
/*
|
||||
context.subscriptions.push(vscode.workspace.onDidOpenTextDocument((textDocument)=> {
|
||||
// console.log('onDidOpenTextDocument', textDocument.uri)
|
||||
}))
|
||||
*/
|
||||
/*
|
||||
context.subscriptions.push(vscode.window.onDidChangeVisibleTextEditors(textEditors=> {
|
||||
// console.log('onDidChangeonDidChangeVisibleTextEditors ', textEditors)
|
||||
}))
|
||||
*/
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreviewToTheSide", openPreviewToTheSide));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openPreview", openPreview));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleScrollSync", toggleScrollSync));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleLiveUpdate", toggleLiveUpdate));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.toggleBreakOnSingleNewLine", toggleBreakOnSingleNewLine));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openImageHelper", openImageHelper));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runAllCodeChunks", runAllCodeChunksCommand));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.runCodeChunk", runCodeChunkCommand));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.syncPreview", syncPreview));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.customizeCss", customizeCSS));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMermaidConfig", openMermaidConfig));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openMathJaxConfig", openMathJaxConfig));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.openKaTeXConfig", openKaTeXConfig));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.extendParser", extendParser));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.showUploadedImages", showUploadedImages));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertNewSlide", insertNewSlide));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertTable", insertTable));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.insertPagebreak", insertPagebreak));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("markdown-preview-enhanced.createTOC", createTOC));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.revealLine", revealLine));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.insertImageUrl", insertImageUrl));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.pasteImageFile", image_helper_1.pasteImageFile));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.uploadImageFile", image_helper_1.uploadImageFile));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.refreshPreview", refreshPreview));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.openInBrowser", openInBrowser));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.htmlExport", htmlExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.chromeExport", chromeExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.princeExport", princeExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.eBookExport", eBookExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.pandocExport", pandocExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.markdownExport", markdownExport));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.webviewFinishLoading", webviewFinishLoading));
|
||||
// context.subscriptions.push(vscode.commands.registerCommand('_mume.cacheSVG', cacheSVG))
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.cacheCodeChunkResult", cacheCodeChunkResult));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.runCodeChunk", runCodeChunk));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.runAllCodeChunks", runAllCodeChunks));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTagA", clickTagA));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.clickTaskListCheckbox", clickTaskListCheckbox));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.showUploadedImageHistory", showUploadedImages));
|
||||
context.subscriptions.push(vscode.commands.registerCommand("_mume.setPreviewTheme", setPreviewTheme));
|
||||
}
|
||||
exports.activate = activate;
|
||||
function revealLine(uri, line) {
|
||||
const sourceUri = vscode.Uri.parse(uri);
|
||||
vscode.window.visibleTextEditors
|
||||
.filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&
|
||||
editor.document.uri.fsPath === sourceUri.fsPath)
|
||||
.forEach((editor) => {
|
||||
const sourceLine = Math.min(Math.floor(line), editor.document.lineCount - 1);
|
||||
const fraction = line - sourceLine;
|
||||
const text = editor.document.lineAt(sourceLine).text;
|
||||
const start = Math.floor(fraction * text.length);
|
||||
editorScrollDelay = Date.now() + 500;
|
||||
editor.revealRange(new vscode.Range(sourceLine, start, sourceLine + 1, 0), vscode.TextEditorRevealType.InCenter);
|
||||
editorScrollDelay = Date.now() + 500;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get the top-most visible range of `editor`.
|
||||
*
|
||||
* Returns a fractional line number based the visible character within the line.
|
||||
* Floor to get real line number
|
||||
*/
|
||||
function getTopVisibleLine(editor) {
|
||||
if (!editor["visibleRanges"].length) {
|
||||
return undefined;
|
||||
}
|
||||
const firstVisiblePosition = editor["visibleRanges"][0].start;
|
||||
const lineNumber = firstVisiblePosition.line;
|
||||
const line = editor.document.lineAt(lineNumber);
|
||||
const progress = firstVisiblePosition.character / (line.text.length + 2);
|
||||
return lineNumber + progress;
|
||||
}
|
||||
exports.getTopVisibleLine = getTopVisibleLine;
|
||||
/**
|
||||
* Get the bottom-most visible range of `editor`.
|
||||
*
|
||||
* Returns a fractional line number based the visible character within the line.
|
||||
* Floor to get real line number
|
||||
*/
|
||||
function getBottomVisibleLine(editor) {
|
||||
if (!editor["visibleRanges"].length) {
|
||||
return undefined;
|
||||
}
|
||||
const firstVisiblePosition = editor["visibleRanges"][0].end;
|
||||
const lineNumber = firstVisiblePosition.line;
|
||||
let text = "";
|
||||
if (lineNumber < editor.document.lineCount) {
|
||||
text = editor.document.lineAt(lineNumber).text;
|
||||
}
|
||||
const progress = firstVisiblePosition.character / (text.length + 2);
|
||||
return lineNumber + progress;
|
||||
}
|
||||
exports.getBottomVisibleLine = getBottomVisibleLine;
|
||||
// this method is called when your extension is deactivated
|
||||
function deactivate() {
|
||||
//
|
||||
}
|
||||
exports.deactivate = deactivate;
|
||||
//# sourceMappingURL=extension.js.map
|
||||
157
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/out/src/image-helper.js
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uploadImageFile = exports.pasteImageFile = void 0;
|
||||
const mume_1 = require("@shd101wyy/mume");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const vscode = require("vscode");
|
||||
const preview_content_provider_1 = require("./preview-content-provider");
|
||||
/**
|
||||
* Copy ans paste image at imageFilePath to config.imageForlderPath.
|
||||
* Then insert markdown image url to markdown file.
|
||||
* @param uri
|
||||
* @param imageFilePath
|
||||
*/
|
||||
function pasteImageFile(sourceUri, imageFilePath) {
|
||||
if (typeof sourceUri === "string") {
|
||||
sourceUri = vscode.Uri.parse(sourceUri);
|
||||
}
|
||||
const imageFolderPath = vscode.workspace
|
||||
.getConfiguration("markdown-preview-enhanced")
|
||||
.get("imageFolderPath");
|
||||
let imageFileName = path.basename(imageFilePath);
|
||||
const projectDirectoryPath = vscode.workspace.rootPath;
|
||||
let assetDirectoryPath;
|
||||
let description;
|
||||
if (imageFolderPath[0] === "/") {
|
||||
assetDirectoryPath = path.resolve(projectDirectoryPath, "." + imageFolderPath);
|
||||
}
|
||||
else {
|
||||
assetDirectoryPath = path.resolve(path.dirname(sourceUri.fsPath), imageFolderPath);
|
||||
}
|
||||
const destPath = path.resolve(assetDirectoryPath, path.basename(imageFilePath));
|
||||
vscode.window.visibleTextEditors
|
||||
.filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&
|
||||
editor.document.uri.fsPath === sourceUri.fsPath)
|
||||
.forEach((editor) => {
|
||||
fs.mkdir(assetDirectoryPath, (error) => {
|
||||
fs.stat(destPath, (err, stat) => {
|
||||
if (err == null) {
|
||||
// file existed
|
||||
const lastDotOffset = imageFileName.lastIndexOf(".");
|
||||
const uid = "_" +
|
||||
Math.random()
|
||||
.toString(36)
|
||||
.substr(2, 9);
|
||||
if (lastDotOffset > 0) {
|
||||
description = imageFileName.slice(0, lastDotOffset);
|
||||
imageFileName =
|
||||
imageFileName.slice(0, lastDotOffset) +
|
||||
uid +
|
||||
imageFileName.slice(lastDotOffset, imageFileName.length);
|
||||
}
|
||||
else {
|
||||
description = imageFileName;
|
||||
imageFileName = imageFileName + uid;
|
||||
}
|
||||
fs.createReadStream(imageFilePath).pipe(fs.createWriteStream(path.resolve(assetDirectoryPath, imageFileName)));
|
||||
}
|
||||
else if (err.code === "ENOENT") {
|
||||
// file doesn't exist
|
||||
fs.createReadStream(imageFilePath).pipe(fs.createWriteStream(destPath));
|
||||
if (imageFileName.lastIndexOf(".")) {
|
||||
description = imageFileName.slice(0, imageFileName.lastIndexOf("."));
|
||||
}
|
||||
else {
|
||||
description = imageFileName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return vscode.window.showErrorMessage(err.toString());
|
||||
}
|
||||
vscode.window.showInformationMessage(`Image ${imageFileName} has been copied to folder ${assetDirectoryPath}`);
|
||||
let url = `${imageFolderPath}/${imageFileName}`;
|
||||
if (url.indexOf(" ") >= 0) {
|
||||
url = url.replace(/ /g, "%20");
|
||||
}
|
||||
editor.edit((textEditorEdit) => {
|
||||
textEditorEdit.insert(editor.selection.active, ``);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.pasteImageFile = pasteImageFile;
|
||||
function replaceHint(editor, line, hint, withStr) {
|
||||
const textLine = editor.document.lineAt(line);
|
||||
if (textLine.text.indexOf(hint) >= 0) {
|
||||
editor.edit((textEdit) => {
|
||||
textEdit.replace(new vscode.Range(new vscode.Position(line, 0), new vscode.Position(line, textLine.text.length)), textLine.text.replace(hint, withStr));
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function setUploadedImageURL(imageFileName, url, editor, hint, curPos) {
|
||||
let description;
|
||||
if (imageFileName.lastIndexOf(".")) {
|
||||
description = imageFileName.slice(0, imageFileName.lastIndexOf("."));
|
||||
}
|
||||
else {
|
||||
description = imageFileName;
|
||||
}
|
||||
const withStr = ``;
|
||||
if (!replaceHint(editor, curPos.line, hint, withStr)) {
|
||||
let i = curPos.line - 20;
|
||||
while (i <= curPos.line + 20) {
|
||||
if (replaceHint(editor, i, hint, withStr)) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Upload image at imageFilePath to config.imageUploader.
|
||||
* Then insert markdown image url to markdown file.
|
||||
* @param uri
|
||||
* @param imageFilePath
|
||||
*/
|
||||
function uploadImageFile(sourceUri, imageFilePath, imageUploader) {
|
||||
// console.log('uploadImageFile', sourceUri, imageFilePath, imageUploader)
|
||||
if (typeof sourceUri === "string") {
|
||||
sourceUri = vscode.Uri.parse(sourceUri);
|
||||
}
|
||||
const imageFileName = path.basename(imageFilePath);
|
||||
vscode.window.visibleTextEditors
|
||||
.filter((editor) => preview_content_provider_1.isMarkdownFile(editor.document) &&
|
||||
editor.document.uri.fsPath === sourceUri.fsPath)
|
||||
.forEach((editor) => {
|
||||
const uid = Math.random()
|
||||
.toString(36)
|
||||
.substr(2, 9);
|
||||
const hint = `![Uploading ${imageFileName}… (${uid})]()`;
|
||||
const curPos = editor.selection.active;
|
||||
editor.edit((textEditorEdit) => {
|
||||
textEditorEdit.insert(curPos, hint);
|
||||
});
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
const AccessKey = config.get("AccessKey") || "";
|
||||
const SecretKey = config.get("SecretKey") || "";
|
||||
const Bucket = config.get("Bucket") || "";
|
||||
const Domain = config.get("Domain") || "";
|
||||
mume_1.utility
|
||||
.uploadImage(imageFilePath, {
|
||||
method: imageUploader,
|
||||
qiniu: { AccessKey, SecretKey, Bucket, Domain },
|
||||
})
|
||||
.then((url) => {
|
||||
setUploadedImageURL(imageFileName, url, editor, hint, curPos);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.uploadImageFile = uploadImageFile;
|
||||
//# sourceMappingURL=image-helper.js.map
|
||||
719
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/out/src/preview-content-provider.js
vendored
Normal file
|
|
@ -0,0 +1,719 @@
|
|||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isMarkdownFile = exports.getPreviewUri = exports.useSinglePreview = exports.MarkdownPreviewEnhancedView = void 0;
|
||||
const mume = require("@shd101wyy/mume");
|
||||
const mume_1 = require("@shd101wyy/mume");
|
||||
const utility_1 = require("@shd101wyy/mume/out/src/utility");
|
||||
const fs = require("fs");
|
||||
const os_1 = require("os");
|
||||
const path = require("path");
|
||||
const vscode = require("vscode");
|
||||
const config_1 = require("./config");
|
||||
// http://www.typescriptlang.org/play/
|
||||
// https://github.com/Microsoft/vscode/blob/master/extensions/markdown/media/main.js
|
||||
// https://github.com/Microsoft/vscode/tree/master/extensions/markdown/src
|
||||
// https://github.com/tomoki1207/gfm-preview/blob/master/src/gfmProvider.ts
|
||||
// https://github.com/cbreeden/vscode-markdownit
|
||||
class MarkdownPreviewEnhancedView {
|
||||
constructor(context) {
|
||||
this.context = context;
|
||||
this.waiting = false;
|
||||
/**
|
||||
* The key is markdown file fsPath
|
||||
* value is MarkdownEngine
|
||||
*/
|
||||
this.engineMaps = {};
|
||||
/**
|
||||
* The key is markdown file fspath
|
||||
* value is Preview (vscode.Webview) object
|
||||
*/
|
||||
this.previewMaps = {};
|
||||
this.preview2EditorMap = new Map();
|
||||
/**
|
||||
* The key is markdown file fsPath
|
||||
* value is JSAndCssFiles
|
||||
*/
|
||||
this.jsAndCssFilesMaps = {};
|
||||
this.config = config_1.MarkdownPreviewEnhancedConfig.getCurrentConfig();
|
||||
mume
|
||||
.init(this.config.configPath) // init markdown-preview-enhanced
|
||||
.then(() => {
|
||||
mume.onDidChangeConfigFile(this.refreshAllPreviews.bind(this));
|
||||
mume_1.MarkdownEngine.onModifySource(this.modifySource.bind(this));
|
||||
utility_1.useExternalAddFileProtocolFunction((filePath, preview) => {
|
||||
if (preview) {
|
||||
return preview.webview
|
||||
.asWebviewUri(vscode.Uri.file(filePath))
|
||||
.toString(true)
|
||||
.replace(/%3F/gi, "?")
|
||||
.replace(/%23/g, "#");
|
||||
}
|
||||
else {
|
||||
if (!filePath.startsWith("file://")) {
|
||||
filePath = "file:///" + filePath;
|
||||
}
|
||||
filePath = filePath.replace(/^file\:\/+/, "file:///");
|
||||
return filePath;
|
||||
}
|
||||
});
|
||||
const extensionVersion = require(path.resolve(this.context.extensionPath, "./package.json"))["version"];
|
||||
if (extensionVersion !== mume.configs.config["vscode_mpe_version"]) {
|
||||
const config = Object.assign({}, mume.configs.config, {
|
||||
vscode_mpe_version: extensionVersion,
|
||||
});
|
||||
fs.writeFileSync(path.resolve(mume.getExtensionConfigPath(), "config.json"), JSON.stringify(config));
|
||||
if (!mume.configs.config["vscode_mpe_version"]) {
|
||||
// Only show once
|
||||
const actions = ["Open GitHub Sponsors", "I already sponsored"];
|
||||
vscode.window
|
||||
.showInformationMessage("If you like using markdown-preview-enhanced, please consider sponsoring the developer to help make this project better 😊.", ...actions)
|
||||
.then((value) => {
|
||||
if (value === actions[0]) {
|
||||
mume.utility.openFile("https://github.com/sponsors/shd101wyy");
|
||||
}
|
||||
else if (value === actions[1]) {
|
||||
config["already_sponsored"] = true;
|
||||
fs.writeFileSync(path.resolve(mume.getExtensionConfigPath(), "config.json"), JSON.stringify(config));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
refreshAllPreviews() {
|
||||
// clear caches
|
||||
for (const key in this.engineMaps) {
|
||||
if (this.engineMaps.hasOwnProperty(key)) {
|
||||
const engine = this.engineMaps[key];
|
||||
if (engine) {
|
||||
// No need to resetConfig.
|
||||
// Otherwiser when user change settings like `previewTheme`, the preview won't change immediately.
|
||||
// engine.resetConfig();
|
||||
engine.clearCaches();
|
||||
}
|
||||
}
|
||||
}
|
||||
// refresh iframes
|
||||
if (useSinglePreview()) {
|
||||
this.refreshPreviewPanel(this.singlePreviewPanelSourceUriTarget);
|
||||
}
|
||||
else {
|
||||
for (const key in this.previewMaps) {
|
||||
if (this.previewMaps.hasOwnProperty(key)) {
|
||||
this.refreshPreviewPanel(vscode.Uri.file(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* modify markdown source, append `result` after corresponding code chunk.
|
||||
* @param codeChunkData
|
||||
* @param result
|
||||
* @param filePath
|
||||
*/
|
||||
modifySource(codeChunkData, result, filePath) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
function insertResult(i, editor) {
|
||||
const lineCount = editor.document.lineCount;
|
||||
let start = 0;
|
||||
// find <!-- code_chunk_output -->
|
||||
for (let j = i + 1; j < i + 6 && j < lineCount; j++) {
|
||||
if (editor.document
|
||||
.lineAt(j)
|
||||
.text.startsWith("<!-- code_chunk_output -->")) {
|
||||
start = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (start) {
|
||||
// found
|
||||
// TODO: modify exited output
|
||||
let end = start + 1;
|
||||
while (end < lineCount) {
|
||||
if (editor.document
|
||||
.lineAt(end)
|
||||
.text.startsWith("<!-- /code_chunk_output -->")) {
|
||||
break;
|
||||
}
|
||||
end += 1;
|
||||
}
|
||||
// if output not changed, then no need to modify editor buffer
|
||||
let r = "";
|
||||
for (let i2 = start + 2; i2 < end - 1; i2++) {
|
||||
r += editor.document.lineAt(i2).text + "\n";
|
||||
}
|
||||
if (r === result + "\n") {
|
||||
return "";
|
||||
} // no need to modify output
|
||||
editor.edit((edit) => {
|
||||
edit.replace(new vscode.Range(new vscode.Position(start + 2, 0), new vscode.Position(end - 1, 0)), result + "\n");
|
||||
});
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
editor.edit((edit) => {
|
||||
edit.insert(new vscode.Position(i + 1, 0), `\n<!-- code_chunk_output -->\n\n${result}\n\n<!-- /code_chunk_output -->\n`);
|
||||
});
|
||||
return "";
|
||||
}
|
||||
}
|
||||
const visibleTextEditors = vscode.window.visibleTextEditors;
|
||||
for (let i = 0; i < visibleTextEditors.length; i++) {
|
||||
const editor = visibleTextEditors[i];
|
||||
if (this.formatPathIfNecessary(editor.document.uri.fsPath) === filePath) {
|
||||
let codeChunkOffset = 0;
|
||||
const targetCodeChunkOffset = codeChunkData.normalizedInfo.attributes["code_chunk_offset"];
|
||||
const lineCount = editor.document.lineCount;
|
||||
for (let i2 = 0; i2 < lineCount; i2++) {
|
||||
const line = editor.document.lineAt(i2);
|
||||
if (line.text.match(/^```(.+)\"?cmd\"?\s*[=\s}]/)) {
|
||||
if (codeChunkOffset === targetCodeChunkOffset) {
|
||||
i2 = i2 + 1;
|
||||
while (i2 < lineCount) {
|
||||
if (editor.document.lineAt(i2).text.match(/^\`\`\`\s*/)) {
|
||||
break;
|
||||
}
|
||||
i2 += 1;
|
||||
}
|
||||
return insertResult(i2, editor);
|
||||
}
|
||||
else {
|
||||
codeChunkOffset++;
|
||||
}
|
||||
}
|
||||
else if (line.text.match(/\@import\s+(.+)\"?cmd\"?\s*[=\s}]/)) {
|
||||
if (codeChunkOffset === targetCodeChunkOffset) {
|
||||
return insertResult(i2, editor);
|
||||
}
|
||||
else {
|
||||
codeChunkOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
});
|
||||
}
|
||||
/**
|
||||
* return markdown engine of sourceUri
|
||||
* @param sourceUri
|
||||
*/
|
||||
getEngine(sourceUri) {
|
||||
return this.engineMaps[sourceUri.fsPath];
|
||||
}
|
||||
/**
|
||||
* return markdown preview of sourceUri
|
||||
* @param sourceUri
|
||||
*/
|
||||
getPreview(sourceUri) {
|
||||
if (useSinglePreview()) {
|
||||
return this.singlePreviewPanel;
|
||||
}
|
||||
else {
|
||||
return this.previewMaps[sourceUri.fsPath];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* check if the markdown preview is on for the textEditor
|
||||
* @param textEditor
|
||||
*/
|
||||
isPreviewOn(sourceUri) {
|
||||
if (useSinglePreview()) {
|
||||
return !!this.singlePreviewPanel;
|
||||
}
|
||||
else {
|
||||
return !!this.getPreview(sourceUri);
|
||||
}
|
||||
}
|
||||
destroyPreview(sourceUri) {
|
||||
if (useSinglePreview()) {
|
||||
this.singlePreviewPanel = null;
|
||||
this.singlePreviewPanelSourceUriTarget = null;
|
||||
this.preview2EditorMap = new Map();
|
||||
this.previewMaps = {};
|
||||
}
|
||||
else {
|
||||
const previewPanel = this.getPreview(sourceUri);
|
||||
if (previewPanel) {
|
||||
this.preview2EditorMap.delete(previewPanel);
|
||||
delete this.previewMaps[sourceUri.fsPath];
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* remove engine from this.engineMaps
|
||||
* @param sourceUri
|
||||
*/
|
||||
destroyEngine(sourceUri) {
|
||||
if (useSinglePreview()) {
|
||||
return (this.engineMaps = {});
|
||||
}
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
delete this.engineMaps[sourceUri.fsPath]; // destroy engine
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Format pathString if it is on Windows. Convert `c:\` like string to `C:\`
|
||||
* @param pathString
|
||||
*/
|
||||
formatPathIfNecessary(pathString) {
|
||||
if (process.platform === "win32") {
|
||||
pathString = pathString.replace(/^([a-zA-Z])\:\\/, (_, $1) => `${$1.toUpperCase()}:\\`);
|
||||
}
|
||||
return pathString;
|
||||
}
|
||||
getProjectDirectoryPath(sourceUri, workspaceFolders = []) {
|
||||
const possibleWorkspaceFolders = workspaceFolders.filter((workspaceFolder) => {
|
||||
return (path
|
||||
.dirname(sourceUri.path.toUpperCase())
|
||||
.indexOf(workspaceFolder.uri.path.toUpperCase()) >= 0);
|
||||
});
|
||||
let projectDirectoryPath;
|
||||
if (possibleWorkspaceFolders.length) {
|
||||
// We pick the workspaceUri that has the longest path
|
||||
const workspaceFolder = possibleWorkspaceFolders.sort((x, y) => y.uri.fsPath.length - x.uri.fsPath.length)[0];
|
||||
projectDirectoryPath = workspaceFolder.uri.fsPath;
|
||||
}
|
||||
else {
|
||||
projectDirectoryPath = "";
|
||||
}
|
||||
return this.formatPathIfNecessary(projectDirectoryPath);
|
||||
}
|
||||
getFilePath(sourceUri) {
|
||||
return this.formatPathIfNecessary(sourceUri.fsPath);
|
||||
}
|
||||
/**
|
||||
* Initialize MarkdownEngine for this markdown file
|
||||
*/
|
||||
initMarkdownEngine(sourceUri) {
|
||||
let engine = this.getEngine(sourceUri);
|
||||
if (!engine) {
|
||||
engine = new mume_1.MarkdownEngine({
|
||||
filePath: this.getFilePath(sourceUri),
|
||||
projectDirectoryPath: this.getProjectDirectoryPath(sourceUri, vscode.workspace.workspaceFolders),
|
||||
config: this.config,
|
||||
});
|
||||
this.engineMaps[sourceUri.fsPath] = engine;
|
||||
this.jsAndCssFilesMaps[sourceUri.fsPath] = [];
|
||||
}
|
||||
return engine;
|
||||
}
|
||||
initPreview(sourceUri, editor, viewOptions) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const isUsingSinglePreview = useSinglePreview();
|
||||
let previewPanel;
|
||||
if (isUsingSinglePreview && this.singlePreviewPanel) {
|
||||
const oldResourceRoot = this.getProjectDirectoryPath(this.singlePreviewPanelSourceUriTarget, vscode.workspace.workspaceFolders) || path.dirname(this.singlePreviewPanelSourceUriTarget.fsPath);
|
||||
const newResourceRoot = this.getProjectDirectoryPath(sourceUri, vscode.workspace.workspaceFolders) || path.dirname(sourceUri.fsPath);
|
||||
if (oldResourceRoot !== newResourceRoot) {
|
||||
this.singlePreviewPanel.dispose();
|
||||
return this.initPreview(sourceUri, editor, viewOptions);
|
||||
}
|
||||
else {
|
||||
previewPanel = this.singlePreviewPanel;
|
||||
this.singlePreviewPanelSourceUriTarget = sourceUri;
|
||||
}
|
||||
}
|
||||
else if (this.previewMaps[sourceUri.fsPath]) {
|
||||
previewPanel = this.previewMaps[sourceUri.fsPath];
|
||||
}
|
||||
else {
|
||||
const localResourceRoots = [
|
||||
vscode.Uri.file(this.context.extensionPath),
|
||||
vscode.Uri.file(mume.utility.extensionDirectoryPath),
|
||||
vscode.Uri.file(mume.getExtensionConfigPath()),
|
||||
vscode.Uri.file(os_1.tmpdir()),
|
||||
vscode.Uri.file(this.getProjectDirectoryPath(sourceUri, vscode.workspace.workspaceFolders) || path.dirname(sourceUri.fsPath)),
|
||||
];
|
||||
previewPanel = vscode.window.createWebviewPanel("markdown-preview-enhanced", `Preview ${path.basename(sourceUri.fsPath)}`, viewOptions, {
|
||||
enableFindWidget: true,
|
||||
localResourceRoots,
|
||||
enableScripts: true,
|
||||
});
|
||||
previewPanel.iconPath = vscode.Uri.file(path.join(this.context.extensionPath, "media", "preview.svg"));
|
||||
// register previewPanel message events
|
||||
previewPanel.webview.onDidReceiveMessage((message) => {
|
||||
vscode.commands.executeCommand(`_mume.${message.command}`, ...message.args);
|
||||
}, null, this.context.subscriptions);
|
||||
// unregister previewPanel
|
||||
previewPanel.onDidDispose(() => {
|
||||
this.destroyPreview(sourceUri);
|
||||
this.destroyEngine(sourceUri);
|
||||
}, null, this.context.subscriptions);
|
||||
if (isUsingSinglePreview) {
|
||||
this.singlePreviewPanel = previewPanel;
|
||||
this.singlePreviewPanelSourceUriTarget = sourceUri;
|
||||
}
|
||||
}
|
||||
// register previewPanel
|
||||
this.previewMaps[sourceUri.fsPath] = previewPanel;
|
||||
this.preview2EditorMap.set(previewPanel, editor);
|
||||
// set title
|
||||
previewPanel.title = `Preview ${path.basename(sourceUri.fsPath)}`;
|
||||
// init markdown engine
|
||||
let initialLine;
|
||||
if (editor && editor.document.uri.fsPath === sourceUri.fsPath) {
|
||||
initialLine = yield new Promise((resolve, reject) => {
|
||||
// Hack: sometimes we only get 0. I couldn't find API to wait for editor getting loaded.
|
||||
setTimeout(() => {
|
||||
return resolve(editor.selections[0].active.line || 0);
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
const text = editor.document.getText();
|
||||
let engine = this.getEngine(sourceUri);
|
||||
if (!engine) {
|
||||
engine = this.initMarkdownEngine(sourceUri);
|
||||
}
|
||||
engine
|
||||
.generateHTMLTemplateForPreview({
|
||||
inputString: text,
|
||||
config: {
|
||||
sourceUri: sourceUri.toString(),
|
||||
initialLine,
|
||||
vscode: true,
|
||||
},
|
||||
contentSecurityPolicy: "",
|
||||
vscodePreviewPanel: previewPanel,
|
||||
})
|
||||
.then((html) => {
|
||||
previewPanel.webview.html = html;
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Close all previews
|
||||
*/
|
||||
closeAllPreviews(singlePreview) {
|
||||
if (singlePreview) {
|
||||
if (this.singlePreviewPanel) {
|
||||
this.singlePreviewPanel.dispose();
|
||||
}
|
||||
}
|
||||
else {
|
||||
const previewPanels = [];
|
||||
for (const key in this.previewMaps) {
|
||||
if (this.previewMaps.hasOwnProperty(key)) {
|
||||
const previewPanel = this.previewMaps[key];
|
||||
if (previewPanel) {
|
||||
previewPanels.push(previewPanel);
|
||||
}
|
||||
}
|
||||
}
|
||||
previewPanels.forEach((previewPanel) => previewPanel.dispose());
|
||||
}
|
||||
this.previewMaps = {};
|
||||
this.preview2EditorMap = new Map();
|
||||
this.engineMaps = {};
|
||||
this.singlePreviewPanel = null;
|
||||
this.singlePreviewPanelSourceUriTarget = null;
|
||||
}
|
||||
previewPostMessage(sourceUri, message) {
|
||||
const preview = this.getPreview(sourceUri);
|
||||
if (preview) {
|
||||
preview.webview.postMessage(message);
|
||||
}
|
||||
}
|
||||
previewHasTheSameSingleSourceUri(sourceUri) {
|
||||
if (!this.singlePreviewPanelSourceUriTarget) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return this.singlePreviewPanelSourceUriTarget.fsPath === sourceUri.fsPath;
|
||||
}
|
||||
}
|
||||
updateMarkdown(sourceUri, triggeredBySave) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (!engine) {
|
||||
return;
|
||||
}
|
||||
const previewPanel = this.getPreview(sourceUri);
|
||||
if (!previewPanel) {
|
||||
return;
|
||||
}
|
||||
// presentation mode
|
||||
if (engine.isPreviewInPresentationMode) {
|
||||
return this.refreshPreview(sourceUri);
|
||||
}
|
||||
// not presentation mode
|
||||
vscode.workspace.openTextDocument(sourceUri).then((document) => {
|
||||
const text = document.getText();
|
||||
this.previewPostMessage(sourceUri, {
|
||||
command: "startParsingMarkdown",
|
||||
});
|
||||
const preview = this.getPreview(sourceUri);
|
||||
engine
|
||||
.parseMD(text, {
|
||||
isForPreview: true,
|
||||
useRelativeFilePath: false,
|
||||
hideFrontMatter: false,
|
||||
triggeredBySave,
|
||||
vscodePreviewPanel: preview,
|
||||
})
|
||||
.then(({ markdown, html, tocHTML, JSAndCssFiles, yamlConfig }) => {
|
||||
// check JSAndCssFiles
|
||||
if (JSON.stringify(JSAndCssFiles) !==
|
||||
JSON.stringify(this.jsAndCssFilesMaps[sourceUri.fsPath]) ||
|
||||
yamlConfig["isPresentationMode"]) {
|
||||
this.jsAndCssFilesMaps[sourceUri.fsPath] = JSAndCssFiles;
|
||||
// restart iframe
|
||||
this.refreshPreview(sourceUri);
|
||||
}
|
||||
else {
|
||||
this.previewPostMessage(sourceUri, {
|
||||
command: "updateHTML",
|
||||
html,
|
||||
tocHTML,
|
||||
totalLineCount: document.lineCount,
|
||||
sourceUri: sourceUri.toString(),
|
||||
id: yamlConfig.id || "",
|
||||
class: yamlConfig.class || "",
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
refreshPreviewPanel(sourceUri) {
|
||||
this.preview2EditorMap.forEach((editor, previewPanel) => {
|
||||
if (previewPanel &&
|
||||
editor &&
|
||||
editor.document &&
|
||||
isMarkdownFile(editor.document) &&
|
||||
editor.document.uri &&
|
||||
editor.document.uri.fsPath === sourceUri.fsPath) {
|
||||
this.initPreview(sourceUri, editor, {
|
||||
viewColumn: previewPanel.viewColumn,
|
||||
preserveFocus: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
refreshPreview(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine.clearCaches();
|
||||
// restart iframe
|
||||
this.refreshPreviewPanel(sourceUri);
|
||||
}
|
||||
}
|
||||
openInBrowser(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine.openInBrowser({}).catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
htmlExport(sourceUri, offline) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.htmlExport({ offline })
|
||||
.then((dest) => {
|
||||
vscode.window.showInformationMessage(`File ${path.basename(dest)} was created at path: ${dest}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
chromeExport(sourceUri, type) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.chromeExport({ fileType: type, openFileAfterGeneration: true })
|
||||
.then((dest) => {
|
||||
vscode.window.showInformationMessage(`File ${path.basename(dest)} was created at path: ${dest}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
princeExport(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.princeExport({ openFileAfterGeneration: true })
|
||||
.then((dest) => {
|
||||
if (dest.endsWith("?print-pdf")) {
|
||||
// presentation pdf
|
||||
vscode.window.showInformationMessage(`Please copy and open the link: { ${dest.replace(/\_/g, "\\_")} } in Chrome then Print as Pdf.`);
|
||||
}
|
||||
else {
|
||||
vscode.window.showInformationMessage(`File ${path.basename(dest)} was created at path: ${dest}`);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
eBookExport(sourceUri, fileType) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.eBookExport({ fileType, runAllCodeChunks: false })
|
||||
.then((dest) => {
|
||||
vscode.window.showInformationMessage(`eBook ${path.basename(dest)} was created as path: ${dest}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
pandocExport(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.pandocExport({ openFileAfterGeneration: true })
|
||||
.then((dest) => {
|
||||
vscode.window.showInformationMessage(`Document ${path.basename(dest)} was created as path: ${dest}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
markdownExport(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine
|
||||
.markdownExport({})
|
||||
.then((dest) => {
|
||||
vscode.window.showInformationMessage(`Document ${path.basename(dest)} was created as path: ${dest}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
vscode.window.showErrorMessage(error.toString());
|
||||
});
|
||||
}
|
||||
}
|
||||
/*
|
||||
public cacheSVG(sourceUri: Uri, code:string, svg:string) {
|
||||
const engine = this.getEngine(sourceUri)
|
||||
if (engine) {
|
||||
engine.cacheSVG(code, svg)
|
||||
}
|
||||
}
|
||||
*/
|
||||
cacheCodeChunkResult(sourceUri, id, result) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine.cacheCodeChunkResult(id, result);
|
||||
}
|
||||
}
|
||||
runCodeChunk(sourceUri, codeChunkId) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine.runCodeChunk(codeChunkId).then(() => {
|
||||
this.updateMarkdown(sourceUri);
|
||||
});
|
||||
}
|
||||
}
|
||||
runAllCodeChunks(sourceUri) {
|
||||
const engine = this.getEngine(sourceUri);
|
||||
if (engine) {
|
||||
engine.runCodeChunks().then(() => {
|
||||
this.updateMarkdown(sourceUri);
|
||||
});
|
||||
}
|
||||
}
|
||||
update(sourceUri) {
|
||||
if (!this.config.liveUpdate || !this.getPreview(sourceUri)) {
|
||||
return;
|
||||
}
|
||||
if (!this.waiting) {
|
||||
this.waiting = true;
|
||||
setTimeout(() => {
|
||||
this.waiting = false;
|
||||
// this._onDidChange.fire(uri);
|
||||
this.updateMarkdown(sourceUri);
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
updateConfiguration() {
|
||||
const newConfig = config_1.MarkdownPreviewEnhancedConfig.getCurrentConfig();
|
||||
if (!this.config.isEqualTo(newConfig)) {
|
||||
// if `singlePreview` setting is changed, close all previews.
|
||||
if (this.config.singlePreview !== newConfig.singlePreview) {
|
||||
this.closeAllPreviews(this.config.singlePreview);
|
||||
this.config = newConfig;
|
||||
}
|
||||
else {
|
||||
this.config = newConfig;
|
||||
for (const fsPath in this.engineMaps) {
|
||||
if (this.engineMaps.hasOwnProperty(fsPath)) {
|
||||
const engine = this.engineMaps[fsPath];
|
||||
engine.updateConfiguration(newConfig);
|
||||
}
|
||||
}
|
||||
// update all generated md documents
|
||||
this.refreshAllPreviews();
|
||||
}
|
||||
}
|
||||
}
|
||||
openImageHelper(sourceUri) {
|
||||
if (sourceUri.scheme === "markdown-preview-enhanced") {
|
||||
return vscode.window.showWarningMessage("Please focus a markdown file.");
|
||||
}
|
||||
else if (!this.isPreviewOn(sourceUri)) {
|
||||
return vscode.window.showWarningMessage("Please open preview first.");
|
||||
}
|
||||
else {
|
||||
return this.previewPostMessage(sourceUri, {
|
||||
command: "openImageHelper",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.MarkdownPreviewEnhancedView = MarkdownPreviewEnhancedView;
|
||||
/**
|
||||
* check whehter to use only one preview or not
|
||||
*/
|
||||
function useSinglePreview() {
|
||||
const config = vscode.workspace.getConfiguration("markdown-preview-enhanced");
|
||||
return config.get("singlePreview");
|
||||
}
|
||||
exports.useSinglePreview = useSinglePreview;
|
||||
function getPreviewUri(uri) {
|
||||
if (uri.scheme === "markdown-preview-enhanced") {
|
||||
return uri;
|
||||
}
|
||||
let previewUri;
|
||||
if (useSinglePreview()) {
|
||||
previewUri = uri.with({
|
||||
scheme: "markdown-preview-enhanced",
|
||||
path: "single-preview.rendered",
|
||||
});
|
||||
}
|
||||
else {
|
||||
previewUri = uri.with({
|
||||
scheme: "markdown-preview-enhanced",
|
||||
path: uri.path + ".rendered",
|
||||
query: uri.toString(),
|
||||
});
|
||||
}
|
||||
return previewUri;
|
||||
}
|
||||
exports.getPreviewUri = getPreviewUri;
|
||||
function isMarkdownFile(document) {
|
||||
return (document.languageId === "markdown" &&
|
||||
document.uri.scheme !== "markdown-preview-enhanced"); // prevent processing of own documents
|
||||
}
|
||||
exports.isMarkdownFile = isMarkdownFile;
|
||||
//# sourceMappingURL=preview-content-provider.js.map
|
||||
573
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/package.json
vendored
Normal file
|
|
@ -0,0 +1,573 @@
|
|||
{
|
||||
"name": "markdown-preview-enhanced",
|
||||
"displayName": "%displayName%",
|
||||
"version": "0.5.22",
|
||||
"description": "%description%",
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"keywords": [
|
||||
"markdown"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/shd101wyy/vscode-markdown-preview-enhanced/issues"
|
||||
},
|
||||
"repository": "https://github.com/shd101wyy/vscode-markdown-preview-enhanced",
|
||||
"license": "NCSA",
|
||||
"contributors": [
|
||||
"shd101wyy",
|
||||
"kachkaev",
|
||||
"gabyx"
|
||||
],
|
||||
"publisher": "shd101wyy",
|
||||
"main": "./out/src/extension",
|
||||
"scripts": {
|
||||
"check": "npm run check:eslint && npm run check:prettier && npm run check:tsc && npm run check:tslint",
|
||||
"check:eslint": "eslint \"**/*\"",
|
||||
"check:prettier": "prettier --check \"**/*.*\"",
|
||||
"check:tsc": "tsc --project . --noEmit",
|
||||
"check:tslint": "tslint --project .",
|
||||
"compile": "tsc -p ./",
|
||||
"fix": "npm run fix:eslint && npm run fix:tslint && npm run fix:prettier",
|
||||
"fix:eslint": "eslint --fix \"**/*\"",
|
||||
"fix:prettier": "prettier --write \"**/*.*\"",
|
||||
"fix:tslint": "tslint --project .",
|
||||
"test": "npm run compile && node ./node_modules/vscode/bin/test",
|
||||
"vscode:prepublish": "npm run compile",
|
||||
"watch": "tsc -watch -p ./"
|
||||
},
|
||||
"contributes": {
|
||||
"commands": [
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreviewToTheSide",
|
||||
"title": "%markdown-preview-enhanced.openPreviewToTheSide.title%",
|
||||
"category": "Markdown",
|
||||
"icon": {
|
||||
"light": "./media/preview-right-light.svg",
|
||||
"dark": "./media/preview-right-dark.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreview",
|
||||
"title": "%markdown-preview-enhanced.openPreview.title%",
|
||||
"category": "Markdown",
|
||||
"icon": {
|
||||
"light": "./media/preview-right-light.svg",
|
||||
"dark": "./media/preview-right-dark.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.toggleScrollSync",
|
||||
"title": "%markdown-preview-enhanced.toggleScrollSync.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.toggleLiveUpdate",
|
||||
"title": "%markdown-preview-enhanced.toggleLiveUpdate.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.toggleBreakOnSingleNewLine",
|
||||
"title": "%markdown-preview-enhanced.toggleBreakOnSingleNewLine.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openImageHelper",
|
||||
"title": "%markdown-preview-enhanced.openImageHelper.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.runAllCodeChunks",
|
||||
"title": "%markdown-preview-enhanced.runAllCodeChunks.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.runCodeChunk",
|
||||
"title": "%markdown-preview-enhanced.runCodeChunk.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.syncPreview",
|
||||
"title": "%markdown-preview-enhanced.syncPreview.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.customizeCss",
|
||||
"title": "%markdown-preview-enhanced.customizeCss.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.insertNewSlide",
|
||||
"title": "%markdown-preview-enhanced.insertNewSlide.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.insertTable",
|
||||
"title": "%markdown-preview-enhanced.insertTable.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.insertPagebreak",
|
||||
"title": "%markdown-preview-enhanced.insertPagebreak.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.createTOC",
|
||||
"title": "%markdown-preview-enhanced.createTOC.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openMermaidConfig",
|
||||
"title": "%markdown-preview-enhanced.openMermaidConfig.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openMathJaxConfig",
|
||||
"title": "%markdown-preview-enhanced.openMathJaxConfig.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openKaTeXConfig",
|
||||
"title": "%markdown-preview-enhanced.openKaTeXConfig.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.extendParser",
|
||||
"title": "%markdown-preview-enhanced.extendParser.title%"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.showUploadedImages",
|
||||
"title": "%markdown-preview-enhanced.showUploadedImages.title%"
|
||||
}
|
||||
],
|
||||
"configuration": {
|
||||
"type": "object",
|
||||
"title": "Markdown Preview Enhanced",
|
||||
"properties": {
|
||||
"markdown-preview-enhanced.configPath": {
|
||||
"description": "The configuration directory path. Leave it empty to use '~/.mume' as the config path. Please reload vscode to take effect.",
|
||||
"default": "",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.usePandocParser": {
|
||||
"description": "Enable this option will render markdown by pandoc instead of markdown-it.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.breakOnSingleNewLine": {
|
||||
"description": "In Markdown, a single newline character doesn't cause a line break in the generated HTML. In GitHub Flavored Markdown, that is not true. Enable this config option to insert line breaks in rendered HTML for single newlines in Markdown source.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.scrollSync": {
|
||||
"description": "Automatic scroll sync. This is now partially supported.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.liveUpdate": {
|
||||
"description": "Re-render the preview as the contents of the source changes, without requiring the source buffer to be saved. If disabled, the preview is re-rendered only when the buffer is saved to disk.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.singlePreview": {
|
||||
"description": "Open Only One Preview.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.automaticallyShowPreviewOfMarkdownBeingEdited": {
|
||||
"description": "Automatically show preview of markdown being edited.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.enableTypographer": {
|
||||
"description": "Enable smartypants and other sweet transforms.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.mathRenderingOption": {
|
||||
"description": "Choose the Math expression rendering method here. You can also disable math rendering if you want by choosing 'None'.",
|
||||
"default": "KaTeX",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"KaTeX",
|
||||
"MathJax",
|
||||
"None"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.mathInlineDelimiters": {
|
||||
"description": "Use customized Math expression inline delimiters.",
|
||||
"default": [
|
||||
[
|
||||
"$",
|
||||
"$"
|
||||
],
|
||||
[
|
||||
"\\(",
|
||||
"\\)"
|
||||
]
|
||||
],
|
||||
"type": "array"
|
||||
},
|
||||
"markdown-preview-enhanced.mathBlockDelimiters": {
|
||||
"description": "Use customized Math expression block delimiters.",
|
||||
"default": [
|
||||
[
|
||||
"$$",
|
||||
"$$"
|
||||
],
|
||||
[
|
||||
"\\[",
|
||||
"\\]"
|
||||
]
|
||||
],
|
||||
"type": "array"
|
||||
},
|
||||
"markdown-preview-enhanced.mathRenderingOnlineService": {
|
||||
"description": "Choose the Math expression rendering method option for GFM markdown export (Save as Markdown).",
|
||||
"default": "https://latex.codecogs.com/gif.latex",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"https://latex.codecogs.com/gif.latex",
|
||||
"https://latex.codecogs.com/svg.latex",
|
||||
"https://latex.codecogs.com/png.latex"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.enableWikiLinkSyntax": {
|
||||
"description": "Enable Wiki Link syntax support. More information can be found at https://help.github.com/articles/adding-links-to-wikis/",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.enableLinkify": {
|
||||
"description": "Enable or disable conversion of URL-like text to links in the markdown preview.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.useGitHubStylePipedLink": {
|
||||
"description": "If checked, we use GitHub style piped wiki links, i.e. [[linkText|wikiLink]]. Otherwise, we use [[wikiLink|linkText]] as the original Wikipedia style.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.wikiLinkFileExtension": {
|
||||
"description": "By default, the extension for wikilink is `.md`. For example: [[test]] will direct to file path `test.md`.",
|
||||
"default": ".md",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.enableEmojiSyntax": {
|
||||
"description": "Enable emoji & font-awesome plugin. This only works for markdown-it parser, but not pandoc parser.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.enableExtendedTableSyntax": {
|
||||
"description": "Enable extended table syntax to support merging table cells.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.enableCriticMarkupSyntax": {
|
||||
"description": "Enable CriticMarkup syntax. Only works with markdown-it parser. Please check http://criticmarkup.com/users-guide.php for more information.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.frontMatterRenderingOption": {
|
||||
"description": "Front matter rendering option",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"none",
|
||||
"table",
|
||||
"code block"
|
||||
],
|
||||
"default": "none"
|
||||
},
|
||||
"markdown-preview-enhanced.mermaidTheme": {
|
||||
"description": "Mermaid theme, you can choose one from [\"mermaid.css\", \"mermaid.dark.css\", \"mermaid.forest.css\"]",
|
||||
"default": "default",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default",
|
||||
"dark",
|
||||
"forest"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.codeBlockTheme": {
|
||||
"description": "Code block theme. If `auto.css` is chosen, then the code block theme that best matches the current preview theme will be picked.",
|
||||
"default": "auto.css",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"auto.css",
|
||||
"default.css",
|
||||
"atom-dark.css",
|
||||
"atom-light.css",
|
||||
"atom-material.css",
|
||||
"coy.css",
|
||||
"darcula.css",
|
||||
"dark.css",
|
||||
"funky.css",
|
||||
"github.css",
|
||||
"hopscotch.css",
|
||||
"monokai.css",
|
||||
"okaidia.css",
|
||||
"one-dark.css",
|
||||
"one-light.css",
|
||||
"pen-paper-coffee.css",
|
||||
"pojoaque.css",
|
||||
"solarized-dark.css",
|
||||
"solarized-light.css",
|
||||
"twilight.css",
|
||||
"vs.css",
|
||||
"vue.css",
|
||||
"xonokai.css"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.previewTheme": {
|
||||
"description": "Preview Theme",
|
||||
"default": "github-light.css",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"atom-dark.css",
|
||||
"atom-light.css",
|
||||
"atom-material.css",
|
||||
"github-dark.css",
|
||||
"github-light.css",
|
||||
"gothic.css",
|
||||
"medium.css",
|
||||
"monokai.css",
|
||||
"newsprint.css",
|
||||
"night.css",
|
||||
"none.css",
|
||||
"one-dark.css",
|
||||
"one-light.css",
|
||||
"solarized-dark.css",
|
||||
"solarized-light.css",
|
||||
"vue.css"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.revealjsTheme": {
|
||||
"description": "RevealJS Presentation Theme",
|
||||
"default": "white.css",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"beige.css",
|
||||
"black.css",
|
||||
"blood.css",
|
||||
"league.css",
|
||||
"moon.css",
|
||||
"night.css",
|
||||
"serif.css",
|
||||
"simple.css",
|
||||
"sky.css",
|
||||
"solarized.css",
|
||||
"white.css",
|
||||
"none.css"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.protocolsWhiteList": {
|
||||
"description": "Accepted protocols for links.",
|
||||
"default": "http://, https://, atom://, file://, mailto:, tel:",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.imageFolderPath": {
|
||||
"description": "When using Image Helper to copy images, by default images will be copied to root image folder path '/assets'",
|
||||
"default": "/assets",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.imageUploader": {
|
||||
"description": "You can choose different image uploader to upload image",
|
||||
"default": "imgur",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"imgur",
|
||||
"sm.ms",
|
||||
"qiniu"
|
||||
]
|
||||
},
|
||||
"markdown-preview-enhanced.AccessKey": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Qiniu AccessKey"
|
||||
},
|
||||
"markdown-preview-enhanced.SecretKey": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Qiniu SecretKey"
|
||||
},
|
||||
"markdown-preview-enhanced.Bucket": {
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"description": "Qiniu Bucket"
|
||||
},
|
||||
"markdown-preview-enhanced.Domain": {
|
||||
"type": "string",
|
||||
"default": "http://",
|
||||
"description": "Qiniu Domain"
|
||||
},
|
||||
"markdown-preview-enhanced.printBackground": {
|
||||
"description": "Whether to print background for file export or not. If set to `false`, then `github-light` preview theme will be used. You can also set `print_background` in front-matter for individual files.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.chromePath": {
|
||||
"description": "Chrome executable path, which is used for Puppeteer export. Leaving it empty means the path will be found automatically.",
|
||||
"default": "",
|
||||
"type": "string",
|
||||
"scope": "machine"
|
||||
},
|
||||
"markdown-preview-enhanced.imageMagickPath": {
|
||||
"description": "ImageMagick command line path. Should be either `magick` or `convert`. Leaving it empty means the path will be found automatically.",
|
||||
"default": "",
|
||||
"type": "string",
|
||||
"scope": "machine"
|
||||
},
|
||||
"markdown-preview-enhanced.pandocPath": {
|
||||
"description": "Pandoc executable path",
|
||||
"default": "pandoc",
|
||||
"type": "string",
|
||||
"scope": "machine"
|
||||
},
|
||||
"markdown-preview-enhanced.pandocMarkdownFlavor": {
|
||||
"description": "The pandoc markdown flavor you want",
|
||||
"default": "markdown-raw_tex+tex_math_single_backslash",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.pandocArguments": {
|
||||
"description": "Args passed to pandoc command e.g. [\"--smart\", \"--filter=/bin/exe\"] Please use long argument names.",
|
||||
"default": [],
|
||||
"type": "array"
|
||||
},
|
||||
"markdown-preview-enhanced.latexEngine": {
|
||||
"description": "Default latex engine for Pandoc export and latex code chunk.",
|
||||
"default": "pdflatex",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.enableScriptExecution": {
|
||||
"description": "Enables executing code chunks and importing javascript files.\n⚠️ Please use this feature with caution because it may put your security at risk! Your machine can get hacked if someone makes you open a markdown with malicious code while script execution is enabled.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.enableHTML5Embed": {
|
||||
"description": " Enables transform audio video link to to html5 embed audio video tags.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.HTML5EmbedUseImageSyntax": {
|
||||
"description": " Enables video/audio embed with ![]() syntax (default).",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.HTML5EmbedUseLinkSyntax": {
|
||||
"description": "Enables video/audio embed with []() syntax.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.HTML5EmbedIsAllowedHttp": {
|
||||
"description": "When true embed media with http:// schema in URLs. When false ignore and don't embed them.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.HTML5EmbedAudioAttributes": {
|
||||
"description": "HTML attributes to pass to audio tags.",
|
||||
"default": "controls preload=\"metadata\" width=\"320\"",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.HTML5EmbedVideoAttributes": {
|
||||
"description": "HTML attributes to pass to video tags.",
|
||||
"default": "controls preload=\"metadata\" width=\"320\" height=\"240\"",
|
||||
"type": "string"
|
||||
},
|
||||
"markdown-preview-enhanced.puppeteerWaitForTimeout": {
|
||||
"description": "Puppeteer waits for a certain timeout in milliseconds before the document export.",
|
||||
"default": 0,
|
||||
"type": "number"
|
||||
},
|
||||
"markdown-preview-enhanced.usePuppeteerCore": {
|
||||
"description": "If set to true, then locally installed puppeteer-core will be required. Otherwise, the puppeteer globally installed by `npm install -g puppeteer` will be required.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"markdown-preview-enhanced.puppeteerArgs": {
|
||||
"description": "Args passed to puppeteer.launch({args: $puppeteerArgs})",
|
||||
"default": [],
|
||||
"type": "array"
|
||||
},
|
||||
"markdown-preview-enhanced.plantumlServer": {
|
||||
"description": "Render using PlantUML server instead of binary. Leave it empty to use the builtin plantuml.jar binary (`java` is required in system path). Eg: \"http://localhost:8080/svg/\"",
|
||||
"default": "",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"keybindings": [
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreviewToTheSide",
|
||||
"key": "ctrl+k v",
|
||||
"mac": "cmd+k v",
|
||||
"when": "editorLangId == markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreview",
|
||||
"key": "ctrl+shift+v",
|
||||
"mac": "cmd+shift+v",
|
||||
"when": "editorLangId == markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.runAllCodeChunks",
|
||||
"key": "ctrl+shift+enter",
|
||||
"when": "editorLangId == markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.runCodeChunk",
|
||||
"key": "shift+enter",
|
||||
"when": "editorLangId == markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown-preview-enhanced.syncPreview",
|
||||
"key": "ctrl+shift+s",
|
||||
"when": "editorLangId == markdown"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
"editor/context": [
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreviewToTheSide",
|
||||
"when": "editorLangId == markdown",
|
||||
"group": "markdown-preview-enhanced"
|
||||
}
|
||||
],
|
||||
"editor/title": [
|
||||
{
|
||||
"command": "markdown-preview-enhanced.openPreviewToTheSide",
|
||||
"when": "editorLangId == markdown",
|
||||
"group": "navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"activationEvents": [
|
||||
"onLanguage:markdown",
|
||||
"onCommand:markdown-preview-enhanced.openPreviewToTheSide"
|
||||
],
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*.*": [
|
||||
"eslint",
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@shd101wyy/mume": "^0.6.7",
|
||||
"@types/vfile": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cheerio": "^0.22.18",
|
||||
"@types/jquery": "^3.3.9",
|
||||
"@types/mocha": "^5.2.5",
|
||||
"@types/node": "^11.11.0",
|
||||
"@types/vscode": "1.40.0",
|
||||
"eslint": "^5.15.1",
|
||||
"husky": "^3.0.9",
|
||||
"lint-staged": "^9.4.2",
|
||||
"mocha": "^6.1.4",
|
||||
"prettier": "^1.18.2",
|
||||
"prettier-plugin-packagejson": "^2.0.1",
|
||||
"tslint": "^5.13.1",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.40.0"
|
||||
},
|
||||
"__metadata": {
|
||||
"id": "3b1db1fc-c7f7-4bd6-9fa4-b499dfa99a8a",
|
||||
"publisherId": "deac4ec9-08f5-4752-aa45-c6f09e1f615d",
|
||||
"publisherDisplayName": "Yiyi Wang",
|
||||
"installedTimestamp": 1627023563815
|
||||
}
|
||||
}
|
||||
23
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/package.nls.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"displayName": "Markdown Preview Enhanced",
|
||||
"description": "Markdown Preview Enhanced ported to vscode",
|
||||
"markdown-preview-enhanced.openPreviewToTheSide.title": "Markdown Preview Enhanced: Open Preview to the Side",
|
||||
"markdown-preview-enhanced.openPreview.title": "Markdown Preview Enhanced: Open Preview",
|
||||
"markdown-preview-enhanced.toggleScrollSync.title": "Markdown Preview Enhanced: Toggle Scroll Sync",
|
||||
"markdown-preview-enhanced.toggleLiveUpdate.title": "Markdown Preview Enhanced: Toggle Live Update",
|
||||
"markdown-preview-enhanced.toggleBreakOnSingleNewLine.title": "Markdown Preview Enhanced: Toggle Break On Single New Line",
|
||||
"markdown-preview-enhanced.openImageHelper.title": "Markdown Preview Enhanced: Image Helper",
|
||||
"markdown-preview-enhanced.runAllCodeChunks.title": "Markdown Preview Enhanced: Run All Code Chunks",
|
||||
"markdown-preview-enhanced.runCodeChunk.title": "Markdown Preview Enhanced: Run Code Chunk",
|
||||
"markdown-preview-enhanced.syncPreview.title": "Markdown Preview Enhanced: Sync Preview",
|
||||
"markdown-preview-enhanced.customizeCss.title": "Markdown Preview Enhanced: Customize CSS",
|
||||
"markdown-preview-enhanced.insertNewSlide.title": "Markdown Preview Enhanced: Insert New Slide",
|
||||
"markdown-preview-enhanced.insertTable.title": "Markdown Preview Enhanced: Insert Table",
|
||||
"markdown-preview-enhanced.insertPagebreak.title": "Markdown Preview Enhanced: Insert Page Break",
|
||||
"markdown-preview-enhanced.createTOC.title": "Markdown Preview Enhanced: Create TOC",
|
||||
"markdown-preview-enhanced.openMermaidConfig.title": "Markdown Preview Enhanced: Open Mermaid Config",
|
||||
"markdown-preview-enhanced.openMathJaxConfig.title": "Markdown Preview Enhanced: Open MathJax Config",
|
||||
"markdown-preview-enhanced.openKaTeXConfig.title": "Markdown Preview Enhanced: Open KaTeX Config",
|
||||
"markdown-preview-enhanced.extendParser.title": "Markdown Preview Enhanced: Extend Parser",
|
||||
"markdown-preview-enhanced.showUploadedImages.title": "Markdown Preview Enhanced: Show Uploaded Images"
|
||||
}
|
||||
23
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/package.nls.zh.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"displayName": "Markdown 增强预览",
|
||||
"description": " 这款插件意在让你拥有飘逸的 Markdown 写作体验",
|
||||
"markdown-preview-enhanced.openPreviewToTheSide.title": "MPE:打开侧边预览",
|
||||
"markdown-preview-enhanced.openPreview.title": "MPE:打开预览",
|
||||
"markdown-preview-enhanced.toggleScrollSync.title": "MPE:开关预览滑动同步",
|
||||
"markdown-preview-enhanced.toggleLiveUpdate.title": "MPE:开关预览实时更新",
|
||||
"markdown-preview-enhanced.toggleBreakOnSingleNewLine.title": "MPE:开关回车换行",
|
||||
"markdown-preview-enhanced.openImageHelper.title": "MPE:图片助手",
|
||||
"markdown-preview-enhanced.runAllCodeChunks.title": "MPE:运行所有代码块",
|
||||
"markdown-preview-enhanced.runCodeChunk.title": "MPE:运行代码块",
|
||||
"markdown-preview-enhanced.syncPreview.title": "MPE:同步预览",
|
||||
"markdown-preview-enhanced.customizeCss.title": "MPE:自定义样式",
|
||||
"markdown-preview-enhanced.insertNewSlide.title": "MPE:插入新的幻灯片",
|
||||
"markdown-preview-enhanced.insertTable.title": "MPE:插入表格",
|
||||
"markdown-preview-enhanced.insertPagebreak.title": "MPE:插入断页符",
|
||||
"markdown-preview-enhanced.createTOC.title": "MPE:创建目录列表",
|
||||
"markdown-preview-enhanced.openMermaidConfig.title": "MPE:打开 mermaid 设置文件",
|
||||
"markdown-preview-enhanced.openMathJaxConfig.title": "MPE:打开 MathJax 设置文件",
|
||||
"markdown-preview-enhanced.openKaTeXConfig.title": "MPE:打开 KaTeX 设置文件",
|
||||
"markdown-preview-enhanced.extendParser.title": "MPE:扩展 Parser",
|
||||
"markdown-preview-enhanced.showUploadedImages.title": "MPE:显示图片上传历史"
|
||||
}
|
||||
6
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/prettier.config.js
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
module.exports = {
|
||||
arrowParens: "always",
|
||||
endOfLine: "lf",
|
||||
quoteProps: "consistent",
|
||||
trailingComma: "all",
|
||||
};
|
||||
12
.vscode/extensions/shd101wyy.markdown-preview-enhanced-0.5.22/tslint.json
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"defaultSeverity": "error",
|
||||
"extends": ["tslint:recommended", "tslint-config-prettier"],
|
||||
"rules": {
|
||||
"interface-name": [true, "never-prefix"],
|
||||
"member-ordering": false, // TODO: enable and sort MarkdownPreviewEnhancedView
|
||||
"no-string-literal": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"prefer-for-of": false,
|
||||
"no-eval": false
|
||||
}
|
||||
}
|
||||