Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.

Commit 1a7153f

Browse files
authored
updating readme ahead of 0.4.0 release (#539)
* updating readme ahead of 0.4.0 release Signed-off-by: Brian Fitzpatrick <[email protected]> * updates per PR feedback and demo suggestions Signed-off-by: Brian Fitzpatrick <[email protected]>
1 parent eb1147c commit 1a7153f

File tree

6 files changed

+116
-4
lines changed

6 files changed

+116
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
</p><br/>
1717

18-
<p align="center"><img src="./images/open-new-terminal-example.gif" alt="Three Step Didact Tutorial Example" width="100%"/></p><br/>
18+
<p align="center"><img src="./images/didact-sample-tutorial-30-APR-2021.gif" alt="CLI Tutorial Example" width="100%"/></p><br/>
1919

2020
# Didact offers two avenues to success
2121

@@ -44,9 +44,11 @@
4444

4545
![Open New Terminal Example](./images/open-new-terminal-example.gif)
4646

47-
## Additional Details
47+
## Available Documentation (Updated!)
4848

49-
Check out the Wiki pages [here](https://github.com/redhat-developer/vscode-didact/wiki/Welcome-to-Didact!) for details about how to use Didact, write your first tutorial, format links, and much more.
49+
Our documentation started in these [wiki pages](https://github.com/redhat-developer/vscode-didact/wiki/Welcome-to-Didact!) but are now located in GitHub pages [here](https://redhat-developer.github.io/vscode-didact/). Included are details about all of Didact's capabilities and many examples to get you started.
50+
51+
>Note: The [wiki pages](https://github.com/redhat-developer/vscode-didact/wiki/Welcome-to-Didact!) are deprecated and will be removed in a future release. Please use the [GitHub pages](https://redhat-developer.github.io/vscode-didact/) from release 0.4.0 forward.
5052
5153
For a list of available commands, check out the [Command Reference](examples/commands.reference.md).
5254

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# The Command Line Interface (CLI) for Linux
2+
3+
If you've written any kind of program on a computer, you've probably had to deal with a command line interface (CLI). Usually you interact with your computer's CLI in a terminal window, typing commands and examining the results. VS Code has a built-in terminal (also known as the integrated terminal) that we will use to explore the CLI a bit.
4+
5+
Let's open an integrated terminal in VS Code and see what we can do!
6+
7+
## A Word about ▶️ and `^ execute` Links
8+
9+
[![Powered by Didact](https://raw.githubusercontent.com/redhat-developer/vscode-didact/master/icon/powered240x40.png)](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact){.imageRight}
10+
11+
This tutorial is Powered by Didact, which means that links have super powers! If you click a ▶️ link, it will type some text for you at the command line but not execute it. You will have to hit Enter to activate the command. If you click a `^ execute` link, the link will not only it will activate a command (like a menu item or toolbar button) or type some text at the command line, but execute it as well. We will use these links to automate some of the commands for you. Feel free to follow these steps yourself! But the links are there to help if you need them.
12+
13+
## Getting Started with Echo
14+
15+
Before we get too complicated, let's start up a terminal and go through a few basics. If you're in VS Code, you can use the `Terminal->New Terminal` menu. ([^ execute](didact://?commandId=vscode.didact.startTerminalWithName&text=newTerminal "Open a new terminal inside VS Code")).
16+
17+
Now that we have a terminal window, go ahead and type `echo hello world` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$echo%20hello%20world)), then hit Enter. You should see your greeting `hello world` show up on the very next line in the terminal window!
18+
19+
Echo comes in handy when looking at various system variables or adding quick debugging messages in scripts.
20+
21+
If you want to learn more about the `echo` command, you can also type `man echo` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$man%20echo)) to get the manual page of documentation detailing all the cool things you can do with the command.
22+
23+
You should see that `-n` is an optional flag that means "do not output the trailing newline". When you're done reading the manual page, hit the `q` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$q)) key to exit.
24+
25+
Try the following commands, hit enter, and watch the results to see how each differs. (The `^ execute` link types the text and hits Enter if you just want to see what happens!)
26+
27+
1. `echo "hello world"` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=newTerminal$$echo%20%22hello%20world%201%22))
28+
2. `echo -n hello world 2` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=newTerminal$$echo%20-n%20hello%20world%202))
29+
3. `echo hello world 3 -n` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=newTerminal$$echo%20hello%20world%203%20-n))
30+
4. `echo "hello world 4" -n` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=newTerminal$$echo%20%22hello%20world%204%22%20-n))
31+
5. `echo "-n hello world 5"` ([^ execute](didact://?commandId=vscode.didact.sendNamedTerminalAString&text=newTerminal$$echo%20%22-n%20hello%20world%205%22))
32+
33+
## Creating Directories and Files
34+
35+
The next thing that we do all the time at the command line is create directories (sometimes known as folders) and files. Let's go over the commands `mkdir`, `cd`, `touch`, `pwd`, and `ls`.
36+
37+
### The `pwd` command
38+
39+
First, let's see what your current directory is. Type `pwd` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$pwd)) at the command line and hit Enter.
40+
41+
You should see something like `/home` followed by your user name and the directory of your VS Code workspace. For example: `/home/myuser/demo`.
42+
43+
### The `mkdir` command
44+
45+
Let's create a sub-directory, or a directory within our current directory, named `practice` with the command `mkdir practice`. ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$mkdir%20practice))
46+
47+
### The `ls` command
48+
49+
To see what files and sub-directories are in a particular directory, you can use the `ls` command. To verify that our `practice` directory was created successfully, let's type `ls` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$ls)) in our practice directory and press Enter.
50+
51+
You should see that there's now a directory called `practice` in this directory.
52+
53+
### The `cd` command
54+
55+
Now, to move into that directory, let's type `cd practice`. ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$cd%20practice))
56+
57+
Remember that `pwd` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$pwd)) command from earlier? Let's try that again and you should see `/practice` tacked on at the end.
58+
59+
We can also run the `ls` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$ls)) command to see if there's anything in our new directory. It's empty, so let's create a file to make it less lonely!
60+
61+
### The `touch` command
62+
63+
Next we can use the `touch` command to create a new, empty file. Type `touch example.txt` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$touch%20example.txt)) and press Enter to create a file named `example.txt`.
64+
65+
If we run the `ls` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$ls)) command again, you should see your new file!
66+
67+
## Reading the Contents of a File
68+
69+
Creating empty files isn't all that fun, but there are other commands we can use to put some text into them and view them as well!
70+
71+
Remember the `echo` command? Let's use it in a new way!
72+
73+
Type `echo "some sample text" > sample.txt`, ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$echo%20%22some%20sample%20text%22%20%3E%20sample.txt)) and hit Enter. This creates a new file and puts some text into it from the start.
74+
75+
We can then use the `cat` command to show the file contents. Type `cat sample.txt` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$cat%20sample.txt)) to print out the contents of our file. You should see `Some example text` show up on the very next line!
76+
77+
## Further Exploration
78+
79+
These are just a few of the commands you can use at the command line. Use the `man intro` ([▶️](didact://?commandId=vscode.didact.sendNamedTerminalAStringNoLF&text=newTerminal$$man%20intro)) command to get a more in depth exploration of what's available!

docs/available-demos.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Available Didact Demo and Example Files
2+
3+
The following is a collection of available demos and examples.
4+
5+
(Work in progress)
6+
7+
## Registering a tutorial via link
8+
9+
The `Didact: Process VS Code link from web` can process two kinds of `vscode://` links:
10+
11+
* A link to start a Didact file such as `vscode://redhat.vscode-didact?https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/examples/requirements.example.didact.md` [link](vscode://redhat.vscode-didact?https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/examples/requirements.example.didact.md)
12+
* A link to register a Didact file such as `vscode://redhat.vscode-didact?commandId=vscode.didact.registry.addUri&&https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/examples/requirements.example.didact.md&&name=Requirements%20Example&&category=From%20The%20Web` [link](vscode://redhat.vscode-didact?commandId=vscode.didact.registry.addUri&&https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/examples/requirements.example.didact.md&&name=Requirements%20Example&&category=From%20The%20Web)
13+
14+
>Note: For now only the `vscode.didact.registry.addUri` command can be called in this manner, but it leaves the door open to be able to handle other commands in the future.
15+
16+
>Also Note: `vscode://` links work great from web pages and when viewed in the VS Code Markdown viewer or Didact windows, but get hidden in GitHub markdown-provided links on the web at present which is why we have implemented this copy/paste approach.
17+
18+
If you copy one of these links to the clipboard (or click on an active link if available), Didact uses the `vscode.didact.processVSCodeLink` in conjunction with a custom url handler to process them. To access this command via the Command Palette, open the palette via `Ctrl+Shift+P` or `F1` and find the command `Didact: Process VS Code link from web`. If the link is on the clipboard, it will automatically try to process it. If not, you can paste the link into the input field that appears.
19+
20+
## Demo Files
21+
22+
Each demo entry includes a name, description, link to source, and a `vscode://` link that you can copy into your VS Code/Che workspace to register it locally.
23+
24+
### CLI Basics Example
25+
26+
The CLI Basics demo shows basic terminal commands using Didact links. Some links execute automatically while others simply type the text in the terminal for the user and they have to explicitly hit Enter.
27+
28+
* Source: https://github.com/redhat-developer/vscode-didact/blob/master/demos/markdown/cli-basics.didact.md
29+
* VS Code link to start tutorial without registering: `vscode://redhat.vscode-didact?https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/demos/markdown/cli-basics.didact.md` [link](vscode://redhat.vscode-didact?https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/demos/markdown/cli-basics.didact.md)
30+
* VS Code link to register tutorial: `vscode://redhat.vscode-didact?commandId=vscode.didact.registry.addUri&&https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/demos/markdown/cli-basics.didact.md&&name=CLI%20Basics&&category=Examples` [link](vscode://redhat.vscode-didact?commandId=vscode.didact.registry.addUri&&https=raw.githubusercontent.com/redhat-developer/vscode-didact/master/demos/markdown/cli-basics.didact.md&&name=CLI%20Basics%20for%20Linux&&category=Examples)

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,4 @@ Let's get started!
7070
* [Troubleshooting](https://redhat-developer.github.io/vscode-didact/troubleshooting)
7171
* [FAQ](https://redhat-developer.github.io/vscode-didact/FAQ)
7272
* [Technical Details](https://redhat-developer.github.io/vscode-didact/tech-details)
73+
* [Available Demos and Examples](https://redhat-developer.github.io/vscode-didact/available-demos)
1.87 MB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
},
157157
{
158158
"command": "vscode.didact.processVSCodeLink",
159-
"title": "Didact: Process VSCode link from web"
159+
"title": "Didact: Process VS Code link from web"
160160
},
161161
{
162162
"command": "vscode.didact.copyTextToCLI",

0 commit comments

Comments
 (0)