Giter Site home page Giter Site logo

bypikod / vscode-markdown-alert Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 0.0 319 KB

VS Code Admonition Box Syntax Preview Support for Markdow

Home Page: https://marketplace.visualstudio.com/items?itemName=yahyabatulu.vscode-markdown-alert

License: MIT License

TypeScript 20.99% JavaScript 66.51% CSS 12.50%
markdown markdown-it markdown-it-plugin visual-studio-code vscode vscode-extension vscode-markdown

vscode-markdown-alert's Introduction

VS Code Markdown Alert

This is a VS Code extension that allows you to preview GitHub's alert syntax for markdown files. This feature first introduced in this discussion post. And this extension is the first implementation of this feature in VS Code.

You can install the extension from VS Code Marketplace.

Syntax below,

> [!NOTE]
> Hello, world!

should look like this,

Note

Hello, world!

And this it looks like in VS Code via this extension,

Example

How does it work?

For those who are interested in how this extension works, here is a brief explanation.

VS Code uses a javascript library named markdown-it to render markdown files. This library allows you to add custom rules to the markdown parser. This extension adds a custom rule to the parser to render GitHub's alert syntax using markdown-it-github-alert plugin of Markdown-it which is also written by me.

For further information, you can check out the source code of this extension and the plugin.

Contribute

Contribution

We welcome and appreciate contributions from the community! To contribute to this project, follow these steps:

  • Fork the repository.
  • Create a new branch for your feature or bug fix.
  • Make your changes and ensure they pass any existing tests.
  • Open a pull request with a clear title and description.
  • Participate in the code review process.

Thank you for helping make this project better!

Copyright

This project is licensed under the terms of the MIT License.

You are free to use this project in compliance with the MIT License. If you decide to use, modify, or redistribute this software, you must include a copy of the original license and copyright notice in all copies or substantial portions of the software.

For more information about the MIT License, visit: MIT License.

Enjoy!

vscode-markdown-alert's People

Contributors

bypikod avatar naveandice avatar

Stargazers

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

Watchers

 avatar

Forkers

jsanchezio

vscode-markdown-alert's Issues

Failed to display alerts correctly

The extension fails to display the Alert markdown extension correctly. For instance, given

> [!IMPORTANT]
> - **Foo**: _bar_ baz

It should look like

Important

  • Foo: bar baz

But the extension fails to display it correctly.

Request textDocument/documentLink failed

Every time that I open a quote block the following error is logged in the Markdown Language Server:

[Error - 3:24:58 PM] Request textDocument/documentLink failed.
  Message: Request markdown/parse failed with message: Cannot read properties of undefined (reading 'type')
  Code: -32603 

This only happen if the yahyabatulu.vscode-markdown-alert extension is enabled.

Github admonition can't be nested within other elements

With Update - 14 November 2023 Github disable support for admonition in nested elements...

Update - 14 November 2023
[...]
Prevent alerts from being nested within other elements.

Source

It would be nice, if we could also disable it for this extension to have the same behaviour as on Github.

[Bug] GitHub "Alert" Syntax Formatting Problem

Note

I follow the issue from mjbvz/vscode-github-markdown-preview-style#135; therefore, I paste the content here, if no expected, I can close this issue ASAP.

Issue with GitHub "Alert" Syntax in New Markdown Preview

While using this extension, the GitHub "alert" syntax experiences formatting issues during rendering, as demonstrated in the video below. This requires some adjustments. Despite this, the extension is a great solution to address my issue microsoft/vscode#214732 in VSCode.

Screen.Recording.2024-06-10.at.1.47.07.PM.mov

Expected:

Screenshot 2024-06-10 at 1 52 22 PM

The current effect:

Screenshot 2024-06-10 at 1 52 38 PM

related: #4

Thanks a lot!!!

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.