Skip to main content

Slash Commands

Slash commands are used to quickly add components to the content.

When starting a new line in Dhub editor you should see a suggestion like this:

After typing a single / (forward slash) a menu will pop-up with all the available commands:

Picking a slash command

After typing /, click on any option in the menu and editor will add that component.

For instance, after clicking on Heading 2, the current line will be a heading with larger font than body text.

tip

Headings are not to be overlooked - they're used to divide content into semantic sections and play a huge role for SEO.
For example, there should be only one Heading 1 per page.

A very quick way to add components is to continue typing after the / and search for a command. Then hit Enter and voilà, the component is added to the editor!

For example:

  • typing /img will show Image and Inline Image components.

  • /h2 will show Heading 2

  • /table will show Table component

  • /callout will allow to add a Callout component

tip

There's no need type the full command name. To write content fast use short versions, like /tbl to find Table or /quo for a Quote.

No need to memorize these, the search is fuzzy. Both /h2 or /hd2 would work.

info

You can use up and down arrow keys to select a command in the list. Once selected, press Enter to add it to the content.

Changing current component

Let's say we wrote /callout and added it to the document. But then changed our minds and decided that a regular text is fine

To change the Callout back to regular text, go to the start of the line and type /text :

After pressing Enter or clicking the Text option in the slash command menu, the callout will be changed to regular text.

tip

This works with other components too. This allows to quickly switch simple text to Callout or Quote, or Heading and etc.

List of all commands

Below is a list of all available slash commands in Dhub editor. This list is always growing so be sure to check back later for new stuff!

/text

ComponentSlash commandDescription
Text/textStart a paragraph of plain text
Divider/dividerVisually divide your content
Heading 1/heading 1 or /h1The largest heading
Heading 2/heading 2 or /h2Heading level 2
Heading 3/heading 3 or /h3Heading level 3
Heading 4/heading 4 or /h4Heading level 4
Heading 5/heading 5 or /h5Heading level 5
Heading 6/heading 6 or /h6Heading level 6
Bulleted list/bullet or /blt or /listCreate a bulleted list for unordered items

Numbered list

/number or /nmbCreate a numbered list for ordered items
Quote/quote or /qtAdd a quotation
Code block/code or /cd

Create a code snippet

Image/image or /imgAdd standalone image which can take full width of the content.
Inline image/inline or /iimgAdd image which flows along with the text. Useful for smaller images like icons.
Callout/callout or /call

Add a more prominent block of text.

Table/table or /tblStructure your data into a table
Embedded MDX/embed or /mdx

Embed code directly into Markdown.

Useful for adding custom code like <iframe> or <video> to tell Dhub to not interpret this code and leave it as-is.

Frontmatter variables/front or /vars

Insert frontmatter variables at the top of the document.

This is sometimes used to set the document title, author, date of publishing and other fields.