GithubHelp home page GithubHelp logo

markmap / markmap-vscode Goto Github PK

View Code? Open in Web Editor NEW
217.0 5.0 20.0 1.2 MB

Integrate markmap into VSCode

Home Page: https://marketplace.visualstudio.com/items?itemName=gera2ld.markmap-vscode

License: MIT License

TypeScript 77.05% JavaScript 20.85% CSS 1.78% Shell 0.33%
markmap vscode-extension vscode

markmap-vscode's Introduction

markmap-vscode

vscode open vsx

This extension integrates markmap into VSCode.

Features

  • Preview markdown files as markmap
  • Edit markdown files in a text editor and the markmap will update on the fly
  • Works offline

markmap

Usage

Command Palette

Open a markdown file. Then open the Command Palette (⇧⌘P) and search Open as markmap, press enter.

Context menu

Right click on a markdown file, then choose Open as markmap.

Button on title-bar

Open a markdown file. Find the markmap icon on the editor title-bar and click it.

title button

Configuration

Custom CSS

Extra CSS to customize the style of markmap.

Default Options

Default options for Markmap, see https://markmap.js.org/docs/json-options#markmap-for-vscode for more details.

markmap-vscode's People

Contributors

gera2ld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

markmap-vscode's Issues

Support Workspace Trust

Hello 👋 I'm from the VS Code team.

Recently, we have been exploring a security feature we refer to as Workspace Trust. This feature is intended to centralize and unify a security conscious decision required by a variety of VS Code features. With workspace trust, the user will be able to declare whether or not they trust the folder that is opened in VS Code before these features are executed.

Why you should care

We want to make sure that those users have a delightful experience with workspace trust and that includes extension authors deciding how much of their extension is supported in an untrusted workspace. Custom editors are special in that if they cannot at least render in an untrusted state then they will be replaced by a lightweight message telling the user to enable trust. This means that users of your extension will not be able to see their editors and there may even be cases of data loss.

Custom Editors Untrusted

Workspace Trust experience

You can enable the feature with the following setting security.workspace.trust.enabled. Once enabled, you will see the following dialog when opening folders in VS Code.

Workspace Trust Startup Dialog

This dialog is important for allowing the user to make a decision early and understand the impact of their decision. Once you understand the feature, you may want to customize when to display the dialog using the setting security.workspace.trust.startupPrompt.

You can follow the development of Workspace Trust and provide feedback in issue #106488.

Workspace trust API

First off, all of what I am about to say can be found in issue #120251. That issue will include discussion of the feature and any updates to the feature.

The Workspace Trust extension API is now in stable. This allowed us to release the first cut of our guide for onboarding your extension to Workspace Trust. The API is small, so here is a quick look.

You can declare your extension to provide complete, partial or no support in untrusted workspaces using the untrustedWorkspaces capability in package.json.

The following example declares that the extension is supported completely in untrusted workspaces. In this case, the extension is enabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": true
  }
}

The next example declares that the extension is not supported in untrusted workspaces. In this case, the extension is disabled in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": false
  }
}

The third option is to declared limited support. There are three tools provided to you when you select the limited option.

First, if you have a setting that can be configured in the workspace but requires the workspace to be trusted in order to apply the workspace value, then you can include the setting using restrictedConfigurations array property in untrustedWorkspaces object. Doing so, VS Code will ignore the workspace value of these restricted settings when your extension reads these settings values using the VS Code Workspace Configuration API.

The following example declares the settings that are restricted in untrusted workspaces.

"capabilities": {
  "untrustedWorkspaces": {
    "supported": "limited",
    "restrictedConfigurations": [
      "markdown.styles"
    ]
  }
}

Next, you can also check and listen if the current workspace is trusted or not programmatically using the following API:

export namespace workspace {
  /**
   * When true, the user has explicitly trusted the contents of the workspace.
   */
  export const isTrusted: boolean;
  /**
   * Event that fires when the current workspace has been trusted.
   */
  export const onDidGrantWorkspaceTrust: Event<void>;
}

Lastly, you can hide commands or views declaratively with the isWorkspaceTrusted context key in your when clauses.

A far more detailed guide on how to onboard which will be updated as we receive feedback can be found in issue #120251.

Rollout plan

We are planning on enabling this by default in the near future (most likely next release). To prepare for that day, we want to work with you to allow your editor to work seamlessly alongside the trusted workspace experience

Our Asks

The main features that should work for custom editors in an untrusted folder is rendering, viewing, and saving (if applicable). After reviewing your codebase, I believe that your extension doesn't execute user files or make decisions based on user file contet and therefore is safe to use in an untrusted workspace. My suggestion would be to adopt supported: true

Please let me know if you have any question or would like to meet up via voice chat as I would be happy to assist you in getting your extension ready for workspace trust!

Enable version on vscode.dev ?

Hi, Gera2ld:

Is it possible to enable this on the vs code web version ? Like the MarkdownLint .

It will be super convenient to be able to open/modify the md file directly from the web, view the mind map in web and save it to the github repository directly.

Thanks in advance!

-Yuan

Three capitalized words make the last word disappear

Hi, I am not really used to open issues in open source projects, but I am struggling with this bug.

So I wanted to write this in French:
- Alv, Alvecroft prêtresse du Culte des Grands Anciens à Nimra
(which means the fictionnal character Alv, short for Alvecroft, is a priestess for fictionnal some cult in some fictionnal town)

but the rendered text is Alv, Alvecroft prêtresse du Culte des Grands Anciens à and the last word is missing for no reason.

After playing a lot, it seems that this happens when at least three words that begin with the same letter are capitalized, Alv Alvecroft and Anciens in the example.

If I remove one of the capital letter, the last word appears in the rendered text.

So you can reproduce, copy paste this in a file, picture of what I have as rendered below:

- Alv, Alvecroft prêtresse du Culte des Grands Anciens à Nimra
- Alv, Alvecroft prêtresse du Culte des grands anciens à Nimra
- Alv Alvecroft Albedo Anciens

image

How do I open preview in VSCode

I just installed this plug-in in the latest version of Vscode, but I don't know how to preview it. Is there any shortcut key?

[Improvement] TOC node should focus relevant header on click

If the Table of Contents is present in markdown, then it'll also show up as nodes.
On clicking any content in table of contents that header should be accessible i.e.

  • From below sample file, On clicking "Para 1" in markmap, it should
  1. either open the md file with that section in focus (same as clicking on "Para 1" in TOC inside Markdown file.) OR
  2. Focus on "Para 1" node in Markmap. [Preferred since we are navigating in same file/view]
  • Currently it tries to open a file named #para-1 in the same directory. Which results in a "file not found" view.

Sample file

# Main Header
## Sub Header 1
### Para 1
- This is my content


## Sub Header 2
1. There's more content.

# Main Header 2
- line 1
- line 2

It'll have the following TOC

- [Main Header](#main-header)
  - [Sub Header 1](#sub-header-1)
    - [Para 1](#para-1)
  - [Sub Header 2](#sub-header-2)
- [Main Header 2](#main-header-2)

And Following MarkMap
image

Feature Request: 导图和原文件可以互换左右位置

vscode默认的预览界面是在右边,但是导图的预览在左边,感觉有点不太适应。如果能添加一个“在左侧编辑”的功能就好了。或者打开的时候可以选择默认是以预览模式打开还是以原文件模式打开

Support for markdown frontmatter

FrontMatter always used in markdown file for recording some infos, such as:

---
title: xxx
date: xxxx
tags: ["xxx", "xxx"]
---

and some other extensions can also use this FrontMatter's infos, such as "Nested tags".

Hope this wonderful extension can skip FrontMatter, or it will show wrong mindmap.
Thanks.

Suggestion: Markmap formatting

I typically start note files from scratch and don't save them until later on. So, for my particular usage, it'd be nice if Markmap didn't need a saved .mm.md file to exist before interpreting it as a Markmap.

I'm not entirely sure of the viability of this, but what could be useful is being able to set the language to markmap in the bottom-right corner as an example. This is similar to setting the language to something like Markdown or JSON. This language interpretation could then trigger the Markmap VS Code extension to run and bring up the preview pane, etc.

Setting langauge:
image

[BUG] Markdown table not supported

  • [ x] I have searched for existing issues that already reported this problem and found none
  • [x ] The bug for the VSCode plugin
  • The bug is also present in the web version of VSCode or GitHub Codespaces

Describe the bug

Web version of markmap could render the Mardown table but VS version couldn't.
Not sure it is because of not supporting or a bug?
Hope to have this feature in VSCode version!

To Reproduce

| Products | Price |
|-|-|
| Apple | 4 |
| Banana | 2 |

Not showing as Table is VS
Expected behavior

Products Price
Apple 4
Banana 2

Actual behavior

It become multiple nodes

Environment:

  • Win11

SVG not rendered properly in Safari

Can't describe how much I love this tool. Thank you so much!
when I export to html and send it to my phone, it won't open with a browser. When I save it as html on my computer, it opens with ghosting.
图片

Feature request: locate markdown text from the markmap

This feature enables us to quickly locate and edit the markdown text, which makes the markmap much more productive. Similar to the Markdown Mindmap in Atom, we can jump to the a specific text when we click on the corresponding text in the markmap.

Wish to hear your voice on this feature.

Suggestion: generate markmap from the open markdown file

I'd like to make a suggestion regarding this extension:
apart from previewing/editing .mm.md files,
it would be great to be able, inside VSCode, to also generate such files from the opened .md file.
i.e. as you have an .md file opened,
to be able to click a "Generate" button (Generate mindmap to the side) to display the diagram,
and offer option to save/export it as .mm.md.

Thank you

P.S. Thanks a lot for your great work about markmap, @gera2ld!
I love mind maps, they can be so helpful to visually organize information!

FR: Collapse all branches

Thanks for this great extension. When opening a large mind-map, it is hard to navigate because it is so huge. It would be really helpful if there was a way to collapse all branches in one go, and even better if this was optionally done when first rendering the map.

The '>Open as markmap' command do not work for 'filename.md' files

from yesterday afternoon, and require me to select editor as this:

image

but all right for 'filename.mm.md' files still.


Here is my VSCode's:

Version: 1.54.1 (user setup)
Commit: f30a9b73e8ffc278e71575118b6bf568f04587c8
Date: 2021-03-04T22:38:31.419Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.17763

Open VSX Listing: Signing the Publisher Agreement

Thank you for being part of the Open VSX community by adding your extensions to the Open VSX Registry. Please note that the service was recently transferred to the Eclipse Foundation and urgent action on your part is needed so we can continue to list your extensions. To ensure uninterrupted service, please sign the Eclipse Publisher Agreement on or before January 8, 2021. If not signed by that date, your extensions will be delisted and will no longer appear on the site nor be available via the API. If you sign at a later date, your extensions will then be re-activated. The signing process is explained in the Wiki (steps 1 and 2).

Please also note that all extensions MUST have a license in order to be listed.

More details are in these recent blog posts:
https://blogs.eclipse.org/post/brian-king/open-vsx-registry-under-new-management
https://blogs.eclipse.org/post/brian-king/new-era-open-vsx-registry

Today, there’s growing momentum around open source tools and technologies that support Visual Studio (VS) Code extensions. Leading global organizations are adopting these tools and technologies. This momentum has spurred demand for a marketplace without restrictions and limitations. Thanks for joining us on this journey as we continue to build the Open VSX community. We look forward to continued innovation from you in 2021!

Suggestion: Add an anchor to every branch of the markmap

Markmap saves me a lot of time, and I think it has the potential to replace the TOC 😆
However, we can jump to the position of the text by simply clicking on the TOC.
Adding an anchor to every branch of the markmap may be beneficial.

如何编译代码

我在编译时总是出现这个错误

SyntaxError: E:\GitRepo\vscext\markmap-vscode\src\extension.ts: Unexpected token, expected "{" (30:20)    

  28 | const transformer = new Transformer();
  29 | 
> 30 | class MarkmapEditor implements CustomTextEditorProvider {
     |                     ^
  31 |   static readonly viewType = 'markmap-vscode.markmap';
  32 | 
  33 |   constructor(public context: ExtensionContext) {}
    at Parser._raise (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:799:17)
    at Parser.raiseWithData (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:792:17)        
    at Parser.raise (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:786:17)
    at Parser.unexpected (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:9089:16)
    at Parser.expect (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:9075:28)
    at Parser.parseClassBody (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:12365:10)     
    at Parser.parseClass (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:12339:22)
    at Parser.parseStatementContent (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:11619:21)
    at Parser.parseStatement (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:11577:17)     
    at Parser.parseBlockOrModuleBlockBody (E:\gitrepo\vscext\markmap-vscode\node_modules\@babel\parser\lib\index.js:12159:25)
[00:29:27] 'build' errored after 2.4 s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
终端进程“C:\Windows\System32\cmd.exe /d /c yarn run build”已终止,退出代码: 1。

CRLF is not supported when parsing frontmatter

I have read the guide but I still don't know where I should put my frontmatter. I try to put it in my markdown files but it seems not to work, Can you tell me how to configure the settings in detail? I really need this amazing extension!

Math formula fail to show when update

When I upgrade to Ubuntu 22.04 and vscode 1.67.2, the math formula failed to show for whatever versions of markmap (from 0.08~0.14).

The file (.md) loading is tremendously slower for versions > 0.09. It takes about less than 1 second to load for 0.09 version, while it takes about more than 30 seconds to load the same file for version > 0.09!

Tested for the following:
OS: Ubuntu 22.04
vscode: 1.67.2
markmap: 0.08~0.14

Exception for "Open as markmap"

Without opening the file, right-click "Open as markmap", there is no response, and the markmap cannot be opened correctly

Co-publish in Open VSX

Open VSX is an open-source registry for VS Code extensions. It can be used by any development environment that supports such extensions. See this article for more information.

It would be cool if this marvellous extension is available in OpenVSX.

The guide to publish it can be found here.

There is a Github Action to publish the extension to OpenVSX that can be used too.

cant install

Unable to install 'gera2ld.markmap-vscode' extension because it is not compatible with the current version of VS Code (version 1.45.1).

supported versions?

Feature request: highlight

Hello! 😊So GREAT it is! BUT it seems that it doesn't support the markdown grammar that using == to highlight the content.
HOPE you could add this feature.

Error on vscode

I started to face this issue:

Could not register service workers: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

... even with simple docs like

# Main

## node 1

- test
- test 2

Is there something I can try to fix/debug?
Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.