Skip to content

Commit

Permalink
Merge pull request #31 from takumisoft68/feature/snipeet_to_tips
Browse files Browse the repository at this point in the history
add tips of snippet
  • Loading branch information
takumisoft68 authored Sep 10, 2021
2 parents c4f5b79 + f0c204f commit 34f3a4e
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 39 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

All notable changes to the "markdowntable" extension will be documented in this file.

### 0.7.0 (2021/xx/xx)
### 0.7.0 (2021/09/11)

- [Add] snippet to generate simple table, typing `table` to trigger
- [Add] Add tips for snippet suggestion to generate simple table

### 0.6.0 (2021/06/15)

Expand Down
14 changes: 2 additions & 12 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,8 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Copyright 2021 takumisoft68

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
89 changes: 82 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Markdown table features.

| Title | Command | Default Keybinding | In the Editor Right Click Menu |
| :-------------------------------------- | :---------------------------------- | :----------------- | :---------------------------------- |
| Generate a simple table. | **snippet**: `table` | | No |
| Format all tables. | markdowntable.format | Shift + Alt + F | Yes |
| Convert TSV to table. | markdowntable.tsvToTable | Shift + Alt + T | Yes (only when selecting range) |
| Navigate to next cell. | markdowntable.nextCell | Tab | No |
Expand All @@ -23,8 +22,6 @@ Markdown table features.

## 2. Demo

Typing `table` to generate a simple table with snippet, and than go further.

### 2.1. Navigate to next cell (with auto format & auto insert row)

Key binding to `Tab`.
Expand Down Expand Up @@ -89,7 +86,85 @@ Key binding to `Shift + Alt + F`.
| markdowntable.alignColumnHeader | Align column header in the table when formatting | boolean | true |
| markdowntable.alignData | Align data in the table when formatting | boolean | true |

## 4. Policy
## 4. Tips

### 4.1. Add a snippet to create a simple table

You can define user snippets.

- References
- [Snippets in Visual Studio Code (Official document)](https://code.visualstudio.com/docs/editor/userdefinedsnippets)
- Steps to add a snippet **table** to the global scope
1. Open snippet file
1. Select User Snippets under File > Preferences (Code > Preferences on macOS)
1. Select markdown.json or markdown under New Global Snippets file
1. Add the following, and save file

```json
{
"Insert a simple table": {
"prefix": "table",
"body": [
"|${0:title} | |",
"| - | - |",
"| | |"
],
"description": "Insert a simple table"
}
}
```

- Step to add a snippet **table** to the project scope
1. Create ".vscode/markdown.code-snippets" in your project directory
1. Add the following, and save file
- Syntax is almost the same as global, scope option is additional

```json
{
"Insert a simple table": {
"prefix": "table",
"scope": "markdown",
"body": [
"|${0:title} | |",
"| - | - |",
"| | |"
],
"description": "Insert a simple table"
}
}
```

### 4.2. Enable snippets suggestion

By default, the snippets suggestion is disabled in markdown.
You need to enable it to use.

- References
- [User and Workspace Settings (Official document)](https://code.visualstudio.com/docs/getstarted/settings)
- Step to enable snippets suggestion to the global scope
1. Open user settings file
- Windows %APPDATA%\Code\User\settings.json
- macOS $HOME/Library/Application Support/Code/User/settings.json
- Linux $HOME/.config/Code/User/settings.json
1. Add the following, and save file

```json
"[markdown]": {
"editor.quickSuggestions": true
}
```

- Step to enable snippets suggestion to the project stope
1. Create (or open if already exist) ".vscode/settings.json" in your project directory
1. Add the following, and save file

```json
"[markdown]": {
"editor.quickSuggestions": true
}
```

## 5. Policy

What's focused on.

Expand All @@ -100,16 +175,16 @@ What's focused on.
- Support full-width characters
- Because author is Japanese

## 5. Release Notes
## 6. Release Notes

- See [changelog](CHANGELOG.md).

## 6. Links
## 7. Links

- [Source Code](https://github.com/takumisoft68/vscode-markdown-table)
- [Marketplace](https://marketplace.visualstudio.com/items?itemName=TakumiI.markdowntable)
- [VSX]

## 7. License
## 8. License

Apache 2.0, See [LICENSE](LICENSE) for more information.
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publisher": "TakumiI",
"displayName": "Markdown Table",
"description": "A minimal extension for markdown table. Add features to edit markdown table.",
"version": "0.6.0",
"version": "0.7.0",
"repository": {
"type": "git",
"url": "https://github.com/takumisoft68/vscode-markdown-table"
Expand Down Expand Up @@ -31,12 +31,6 @@
],
"main": "./out/extension.js",
"contributes": {
"snippets": [
{
"language": "markdown",
"path": "./snippets/markdown.json"
}
],
"commands": [
{
"command": "markdowntable.format",
Expand Down
11 changes: 0 additions & 11 deletions snippets/markdown.json

This file was deleted.

0 comments on commit 34f3a4e

Please sign in to comment.