Hinode logo
  • About 
  • Docs 
  • Components 
  • Guides 
  • Releases 
  •  
Docs
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License
  • Getting Started
    • Introduction
    • Commands
    • Hosting and Deployment
    • Upgrading
    • Private Modules and Packages
    • Contribute
    • Troubleshooting
  • Content
    • Content Management
    • Content Organization
    • Typography
    • Links and Cross-References
    • Images and Figures
    • Tables
    • Icons
  • Configuration
    • Layout
    • Colors
    • Color Modes
    • Fonts
    • Languages
    • Navigation
    • Documentation
    • Analytics
    • Modules
    • Cookie Consent
    • Digital Asset Managers
  • Components
    • Abbr
    • Accordion
    • Alert
    • Animation
    • Args
    • Badge
    • Breadcrumb
    • Button
    • Button Group
    • Card
    • Card Group
    • Carousel
    • Collapse
    • Command Prompt
    • Docs
    • Example
    • File
    • Icon
    • Image
    • Ins
    • Kbd
    • Link
    • Map
    • Mark
    • Navbar
    • Navs and Tabs
    • Persona
    • Release
    • Spinner
    • Sub
    • Sup
    • Table
    • Timeline
    • Toast
    • Tooltip
    • Video
  • Advanced Settings
    • Overview
    • Styles
    • Scripts
    • Icons
    • Partial Development
    • Module Development
    • Server Headers
    • Server-Side Redirection
  • About
    • Credits
    • License

Command Prompt

Share via
Hinode
Link copied to clipboard

The command shortcode generates terminal output for either Bash, PowerShell, or SQL shell languages.

On this page
Overview   Arguments   Examples   Bash   PowerShell   SQL  

Overview  

Added in v0.5.0   

The command shortcode generates terminal output for either bash, powershell, or sql shell languages. The following example generates a block with a default bash command prompt.

export MY_VAR=123
markdown
{{< command >}}
export MY_VAR=123
{{< /command >}}

Arguments  

The shortcode supports the following arguments:

Name Type Required Default Comment
class string Class attribute of the command element.
host string Host to add to the prompt, e.g. localhost.
prompt string Prompt override, e.g. PS C:\Users\User>.
shell select bash Type of shell. Supported values: [bash, powershell, sql].
user string User to add to the prompt, e.g. user.
Name Type Required Default
class string
Class attribute of the command element.
host string
Host to add to the prompt, e.g. localhost.
prompt string
Prompt override, e.g. PS C:\Users\User>.
shell select bash
Type of shell. Supported values: [bash, powershell, sql].
user string
User to add to the prompt, e.g. user.

Examples  

Change the style and language of your command prompt with shortcode arguments.

Bash  

Specify user and host to add the user context to the prompt. In addition, use (out) to specify an output line and use \ to denote a line continuation.

export MY_VAR=123
echo "hello"
hello
echo one \
two \
three
one two three
echo "goodbye"
goodbye
markdown
{{< command user="user" host="localhost" >}}
export MY_VAR=123
echo "hello"
(out)hello
echo one \
two \
three
(out)one two three
echo "goodbye"
(out)goodbye
{{< /command >}}

PowerShell  

Set the shell argument to powershell to generate a PowerShell terminal. Override the prompt to add a directory if needed. Use the backtick ` symbol to denote a line continuation.

Write-Host `
'Hello' `
'from' `
'PowerShell!'
Hello from PowerShell!
Write-Host 'Goodbye from PowerShell!'
Goodbye from PowerShell!
markdown
{{< command prompt="PS C:\Users\User>" shell="powershell" >}}
Write-Host `
'Hello' `
'from' `
'PowerShell!'
(out)Hello from PowerShell!
Write-Host 'Goodbye from PowerShell!'
(out)Goodbye from PowerShell!
{{< /command >}}

SQL  

Set the shell argument to sql to generate a SQL terminal. Use the (con) suffix to denote a line continuation.

set @my_var = 'foo';
set @my_other_var = 'bar';
CREATE TABLE people (
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL
);
Query OK, 0 rows affected (0.09 sec)
insert into people
values ('John', 'Doe');
Query OK, 1 row affected (0.02 sec)
select *
from people
order by last_name;
+------------+-----------+
| first_name | last_name |
+------------+-----------+
| John       | Doe       |
+------------+-----------+
1 row in set (0.00 sec)
markdown
{{< command prompt="mysql>" shell="sql" >}}
set @my_var = 'foo';
set @my_other_var = 'bar';
CREATE TABLE people ((con)
first_name VARCHAR(30) NOT NULL,(con)
last_name VARCHAR(30) NOT NULL(con)
);
(out)Query OK, 0 rows affected (0.09 sec)
insert into people(con)
values ('John', 'Doe');
(out)Query OK, 1 row affected (0.02 sec)
select *(con)
from people(con)
order by last_name;
(out)+------------+-----------+
(out)| first_name | last_name |
(out)+------------+-----------+
(out)| John       | Doe       |
(out)+------------+-----------+
(out)1 row in set (0.00 sec)
{{< /command >}}
• Update to Hinode v0.27.13 (b6f5054)
On this page:
Overview   Arguments   Examples   Bash   PowerShell   SQL  
Command Prompt
Command Prompt
Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5.
Code licensed MIT, docs CC BY-NC 4.0
Currently v0.29.3
Privacy | Cookies
 
Links
Home 
About 
Docs 
Components 
Releases 
Guides
Getting Started 
Developing Modules 
Optimization 
Versioning 
Community
Issues   
Discussions   
Contribute 
Hinode
Code copied to clipboard