code-lc4ri
code-lc4ri: Markdown + LC4RI for VS Code
vscode
vscode-extension
typescript
nodejs
lc4ri
markdown
Demo
Do you often use "jupyter notebook" when choosing a documentation tool for your operations manual?
But, this include problems
- document used splited to like a card. So, when insert document, insert card every. I don't fit in this operation.
- In case of operation of the order, I have to switch the cards up and down. I wish to edit like a text editer.
- I wish to use ecosystem(lint tool, etc). But, not easy preparation.
jupyter is very excellent tool, but I know more usefull for text edit. it's VSCode!
My idea is, Markdown + LC4RI on VSCode's ecosystem is more better solution!
Advantages
This extention, usually write markdown document. and additional commands can be executed.
- write document on markdown format.
- list format on markdown is can run command.
- command output to auto apply to document.
- can use variable.
Installation
Visual Studio Marketplace
download vsix from release page.
save vsix file, install how to.
uninstall
uninstalld extension.
use case
recommendation
set keybindings.json, enable it's shortcut do.
[
{
"key": "ctrl+shift+a",
"command": "extension.lc4ri",
"args": "code-lc4ri: LC4RI for VS Code"
}
]
Basic. You can write markdown usually, but it's can run following.
run this extension, line search, if match rule line, run commands. start line is editor's cursor position.
- ls
note) If not exists code section after list, will create code section and output to it.
note) Tab indents means, If command success is next indent run. (AND rule)
- ls existsfile.txt
- rm existsfile.txt
If "ls existsfile.txt" is success, next indent run.
horizon line
If you write horizon line, split commands.
- ls
***
- uname
note) In this case, run command to the horizon line.
variable
number list is create variable value.
1. uname
create variable {1}.
- echo {1}
variable {1} output.
note) variable can use 1-9 integer.
/home/pi/code-lc4ri/code-lc4ri-0.5.0.vsix
v0.5: "config file" support!
This extension easier use, support config file.
sample setting
json format.
{
"timeout": 10000,
"template": {
"linux": "ssh user@192.168.0.1 {COMMAND}"
},
"changeWord": {
"#HOME#": "/home/user"
}
}
file create
If does not exist, it will be created in the following folder.
- Windows
- %USERPROFILE%/.code-lc4ri/config.json
- ex) C:\Users(USER NAME).code-lc4ri\config.json
- Other OS
- $HOME/.code-lc4ri/config.json
- ex) /home/user/.code-lc4ri/config.json
file load
When VSCode run, loading config.
options
options detail following.
timeout
This option is the timeout time when the command is executed.
Units are in milliseconds.
10000 -> 10 seconds.
template
This option is default commands template, and can be defined on a per-OS.
For example, you want to execute every commands on SSH destination.
In case of can set this option.
"OS type":"template"
"OS Type" is following.
process.platform
{COMMAND} included the original commands.
"linux": "ssh user@192.168.0.1 {COMMAND}"
- normal
- define
- ssh user@192.168.0.1 "{COMMAND}"
- execute commands
chageWord
This option is convert keywords list.
If server address changes often, If you don't want to use commands that are dangerous to execute.
In case of can set this option.
Defines a set of words before and after conversion.
"pre word": "after word"
- normal
- define
- execute commands
v0.6: executed time auto print.
It can be used as evidence of execution time.
LICENSE
MIT License
Contributors