question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add vscode-markdown command to convert selected text into collapsible section

See original GitHub issue

What is the problem?

Add a new vscode command to convert selected text into a collapsible section.

How can I reproduce it?

Feature doesn’t exists

Is there any error message in the console?

No Error

Feature Request Details

Given a text section, a vscode command can be used to convert a text area to a collapsible area. For e.g.

To convert the following text in markdown syntax

Hidden Block

> echo "hello world!"

to the collapsible section, we need to surround this text with the following tags which enable the above text to be rendered as collapsible section

<details> <summary>Expand</summary> <p>

Hidden Block

> echo "hello world!"

</p> </details>

which is rendered as follows:

Expand

Hidden Block

> echo "hello world!"

A vscode command similar to generate Table of Contents can be useful TOC Command

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
yzhang-ghcommented, Aug 30, 2020

This can be easily done by defining a user snippet (with TM_SELECTED_TEXT variable). Also see here.

0reactions
tfgacommented, Nov 8, 2020

VSCode doesn’t insert \t in this case: it inserts spaces.
FYI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to add a collapsible section in markdown. - gists · GitHub
selectionEnd, 'select'); })();. Click in an editable text field; Click the bookmarklet and it will insert the minimalist snippet at your current cursor ......
Read more >
How do I collapse sections of code in Visual Studio Code for ...
This is bound to the above remove command: Ctrl + K Ctrl + . Code folding by regions has arrived with v1.17. Folding...
Read more >
collapsible-markdown-headers - Visual Studio Marketplace
This extension provides a command that can insert the required snippet for converting any text collapsible. I prefer to use it with headers...
Read more >
How to: Collapse and Hide Sections of Code - Visual Basic
The #Region directive enables you to collapse and hide sections of code in Visual Basic files. The #Region directive lets you specify a ......
Read more >
Getting Started with VSCode and Markdown Step-By-Step ...
Key Command Command id ⌘X (Windows, Linux Ctrl+X) Cut line (empty selection) editor.action.clipboardCutA... ⌘C (Windows, Linux Ctrl+C) Copy line (empty selection) editor.action.clipboardCopy... ⇧⌘K (Windows, Linux Ctrl+Shift+K)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found