GithubHelp home page GithubHelp logo

mjbvz / vscode-github-markdown-preview Goto Github PK

View Code? Open in Web Editor NEW
74.0 74.0 8.0 288 KB

Changes VS Code's built-in markdown preview to match Github markdown rendering in style and content

Home Page: https://marketplace.visualstudio.com/items?itemName=bierner.github-markdown-preview

License: MIT License

vscode-github-markdown-preview's People

Contributors

chrizpy avatar mattbierner avatar mjbvz avatar technicalpickles avatar williambuttenham 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

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-github-markdown-preview's Issues

TOC is only rendered for ATX style headings

Behavior

The TOC is only rendered for ATX style headings, like

# First level
## Second level
### Third level

whereas setext style headings are ignored

First
===
not rendered

Second
--------
not rendered

### Third
Rendered

Problem
Using ATX style headers is not allowed in various projects and most notably the default settings of the Markdown linter for VS Code.

Expected behavior

The TOC generator should also take setext style headers into consideration.

Feature Request: Add Alerts

GitHub added extension for Alerts, here is an example :)

> [!NOTE]
> Useful information that users should know, even when skimming content.

> [!TIP]
> Helpful advice for doing things better or more easily.

> [!IMPORTANT]
> Key information users need to know to achieve their goal.

> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.

> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.

Note

Useful information that users should know, even when skimming content.

Tip

Helpful advice for doing things better or more easily.

Important

Key information users need to know to achieve their goal.

Warning

Urgent info that needs immediate user attention to avoid problems.

Caution

Advises about risks or negative outcomes of certain actions.

Seems that https://github.com/ByPikod/markdown-it-github-alert can be handy

Option to flatten relative links for GitHub wikis

GitHub wikis flatten the folder structure which changes how relative links are handled:

To link to the file foo/file1.md from bar/file2.md, VSCode expects a link like ../foo/file1.md.
When the files are displayed in a GitHub wiki the folder structure is flattened so it expects just file1.md.

It would be nice to have the option to replicate this behaviour in VSCode to test links when editing wikis.

Add Note/Warning

> **Note**
> This is a note

> **Warning**
> This is a warning

Produces:

Note
This is a note

Warning
This is a warning

Support for line number fragment (#L3) in source code links like on GitHub

Hi there,

In our markdown docs on GitHub we use in-repo relative paths with fragments like (#L32) to link to source code from a markdown doc.

For example, see here where links to C# classes are actually in-repo relative paths with fragments like "#L34" specifying the line number.

Unfortunately the fragment part of the links doesn't work when previewing Markdown in VS Code.

Could you add such support to your extension?

BR,
Mark

Error loading webview

When I have the Markdown preview tab open for a while, I occasionally encounter the following error:

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

I still get this error if I try closing and reopening the tab, or using the "Developer: Reload Window" command. The only way I have been able to resolve this error is to manually close and reopen VS Code.

Publish to OpenVSX

Hi there @mjbvz ๐Ÿ‘‹! Please publish this extension and the styling one to the Open VSX Registry.

Context

Unfortunately, as Microsoft prohibits usages of the Microsoft marketplace by any other products or redistribution of .vsix files from it, in order to use VS Code extensions in non-Microsoft products, I kindly ask that you take ownership of the VS Code extension namespace in Open VSX and publish this extension on Open VSX.

What is Open VSX? Why does it exist?

The Open VSX Registry is a vendor neutral alternative to the MS marketplace used by most other derivatives of VS Code like VSCodium, Gitpod, OpenVSCode, Theia based IDEs, and so on.

How can you publish to Open VSX Registry?

The docs to publish an extension can be found here. This process is straightforward and shouldn't take too long. Essentially, you need an authentication token and to execute the command ovsx publish to publish your plugin or - not suggested - upload that via web interface.

This would also fix #6.

Note:
You could also use a GitHub action that allows publishing to Open VSX and the Microsoft Marketplace, HaaLeo/publish-vscode-extension does this nicely, just "install", then setup necessary tokens an when you want to do a release just create and push a tag.

Markdown preview traps keybindings/focus

Hi! This is an awesome VSCode extension, thanks a lot for it, I use it everyday.

I faced an issue that doesn't allow me to effectively use common keybindings when I'm supposedly focusing on the tab that contains the preview (I hope this is your domain, but feel free to indicate me who to ping if this has nothing to do with the extension itself).

How to reproduce:

  1. Open a tab for a markdown file
  2. Use CTRL + KV to open the preview side-to-side
  3. Use CTRL + 1 to focus the .md file
  4. Use CTRL + 2 to focus the preview
  5. Use CTRL + 1 to focus the .md file
  6. Use CTRL + 2 to focus the preview
  7. Keep doing this until the focus seems to get trapped into the preview

I find it strange because the focus appears to be trapped in the preview tab, but it actually doesn't listen for other keybindings such as CTRL + W that should close the tab.

Again, thank you very much for this awesome software.

Update `CHANGELOG` for `0.2.0` release

Its a bit empty in regards to the 0.2.0 release in the extension page in VS Code:

Skaฬˆrmavbild 2022-02-16 kl  15 53 55

No biggie, but thought I could just as well post a nudge about it as its neat to get to know that a lovely footnotes extension is now included ๐ŸŽ‰

Also, OT-question: Any reason why this extension is at a 0.x release line rather than a stable >=1.x line? See https://semver.org/#spec-item-4

Markdown files open in Preview mode

Not sure if this is intentional or not but when I open my markdown files they are opening first in Preview mode by default. This may be fine for some folks but I feel they should open in edit mode by default with the ability to then view the file in Preview mode.

If there is a setting to turn this on/off please advise. Thx.

Are these extensions really required to run remotely?

I use WSL2 frequently, but I prefer keeping extensions installed in windows only if possible. I can understand if some of these need to run remotely, but considering they just change how markdown is rendered, I'm not sure if it's necessary.

image
image

Code Block Syntax Highlighter

There seems to be an issue with the code block syntax highlighter.
For example this markdown:

```EditorConfig
[*.{cs,vb}]
dotnet_naming_rule.private_members_with_underscore.symbols  = private_fields
dotnet_naming_rule.private_members_with_underscore.style    = prefix_underscore
dotnet_naming_rule.private_members_with_underscore.severity = suggestion

dotnet_naming_symbols.private_fields.applicable_kinds           = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_style.prefix_underscore.capitalization = camel_case
dotnet_naming_style.prefix_underscore.required_prefix = _
```

Renders like this...
in a GitHub Issue:
GitHub Issue
and like this in Markdown Preview:
Markdown Preview
If I change the Language Tag from EditorConfig to INI it shows some highlighting though
INI tag

Are you using a different highlighter than GitHub or is this the default Markdown syntax style?
GitHub is using Linguist according to this page https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting

markdown.previewFrontMatter setting in README.md is out of date

According to the microsoft/vscode#66312 the "markdown.previewFrontMatter": "show" setting is no longer specified. Thus, the README.md when installing the GitHub Markdown Preview extension pack is misdirecting users to a non-existent setting.

It just causes a hiccup when installing the extension pack, which is needless. I suggest we could remove the comment about the setting, and none the wiser.

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.