Open/close tabs from content¶
You can include links in your content to open and close files in tabs and highlight lines of text similar to what is available in the open tabs dialog.
Syntax Summary¶
The syntax is as follows and actions can be chained together using, separated by a ;.
`
[Hyperlink text](open_file file1 file2; cmd ls -al)
`
Opening directives¶
open_file file1 file2 fileN panel=A where panel is optional, in which case the default panel (A) will be used if not specified.
open_preview file panel=A where panel is optional, in which case the default panel (A) will be used if not specified.
open_terminal command panel=A where command (a system command) is optional and where panel is optional, in which case the default panel (A) will be used if not specified.
cmd systemcommand argument1 argument2 argumentN
open_tutor file panel=A to open visualiser and where panel is optional, in which case the default panel (A) will be used if not specified.
open_vm panel=A to open virtual machine and where panel is optional, in which case the default panel (A) will be used if not specified.
open_preview https://{{domain5000}} panel=A to open preview of the box (on port 5000 in this example) where panel is optional, in which case the default panel (A) will be used if not specified.
open_preview https://www.codio.com panel=A to open defined website where panel is optional, in which case the default panel (A) will be used if not specified.
Closing directives¶
close_all closes all tabs in all panels, except the Guide itself.
close_all panel=A closes all tabs in panel A.
close_file file1 closes file1 in all panels
close_file file1 file2 fileN panel=A where panel is optional, in which case the default panel (A) will be used.
close_preview behaves like close_file for preview tabs.
close_terminal behaves like close_file for terminal tabs.
close_tutor file panel=A where visualiser is closed for file open in panel A
Important - spaces and ; in file names and commands¶
If any of your files contain a space in the name, enclose the file name in double quotes.
open_file “file name.txt”
If you use cmd and the command has a ; character in it, then you should also use quotes.
cmd “cp file1 file2; cp file3 file4”
Examples¶
Open a file file.txt
`
[Click here](open_file file.txt)
`
Open a file file.txt in panel B
`
[Click here](open_file file.txt panel=B)
`
Open a file file.txt in panel B, with a code reference and highlight 3 lines
`
[Click here](open_file file.txt panel=B ref="some text in your code" count=3)
`
Open files file.txt and file2.txt
`
[Click here](open_files file.txt file2.txt)
`
Open a file file.txt and preview of file.txt in panel C
`
[Click here](open_file file.txt; open_preview file.txt panel=C)
`
Run a command then open a preview of file.txt in panel C
`
[Click here](cmd cp source.txt target.txt; open_preview file.txt panel=C)
`
Open a Terminal window in panel B
`
[Click here](open_terminal panel=C)
`
Close file.txt and open a preview file.txt
`
[Click here](close_file file.txt; open_preview file.txt)
`
Close all open files, previews and terminals in all panels, then open a file file.txt
`
[Click here](close_all; open_file file.txt)
`
Close all open files, previews and terminals, then open a file file.txt
`
[Click here](close_all; open_file file.txt)
`
Close all open files, previews and terminals that are in panel C, then open a file file.txt
`
[Click here](close_all panel=C; open_file file.txt)
`