Markdown indentation (2023)

When you're writing in Markdown, indentation can make your doc source more readable. Indentation can also affect the file's readability when it's rendered in HTML. This doc covers how to handle parent (first-level), child (second-level), and grandchild (third-level) lists. We'll also demonstrate how to insert spaces to incorporate code blocks, images, and nested lists within a set of procedures.

List indentation

Lists are a great way to explain procedures (numbered steps) or simply itemize items (bulleted lists). While single-level lists are pretty straightforward, when you start nesting them, you can run into indentation issues. Take a look at these list topics in this section:

  • First-level lists (parents)
  • Indentation for child lists

First-level lists (parents)

For first-level lists introduced by a left-justified introductory sentence, we follow this Markdown standard: left-justify all first-level list items. When you publish your document, the Markdown library will indent the first-level list items for you:

Here is a basic list written as left-justified but indented at the time of publication:

* Item 1

* Item 2

This is rendered like this:

Indentation for child lists

For child or grandchild lists, insert four spaces (or two, two-space tabs) to precede the bullet point or number. While you can use three spaces to indent child lists, we recommend the four space or two tab method, as they render lists more consistently and are easier to type.

In the sections that follow, you'll see examples of how to indent various child lists.

Important

Do not use two-space indentation for any level of list items. While these work in some contexts, they are not predictable. See our two-space examples.

Four-space indentation for child lists (recommended)

We recommend the following spacing in your Markdown because it uses multiples of two spaces:

1. Item 1

2. Item 2

* Item 2a

* Item 2b

The Markdown is rendered like this:

Problems with two-space indentation for lists

While there are some cases where two-space indentation works, such as indenting images or for parent and child bullet lists, your results for numbered lists and other cases can unpredictable. Here are some examples of two-space indentation of a child list. Note that the Markdown library doesn't indent either of these child lists.

A child bullet list:

1. Item 1

2. Item 2

* Item 2a

* Item 2b

Note that it renders the child bullets, but they are not indented:

A child numbered list:

1. Item 1

(Video) Mark Your Indent With IndentLine For Vim

2. Item 2

1. Item 2a

2. Item 2b

Note that the Markdown converter can't tell the indented list is a child:

Bullets nested in numbered lists

When you nest bulleted lists under number lists, indent each child list by four spaces. Look at this Markdown example where a child bullet under step #4 is only indented two spaces:

The process consists of four activities:

1. Review AQM dashboard and KPI trends: Here you and the stakeholders will look at the AQM KPIs and identify their week over week trends. The team should identify areas where KPIs are not improving and develop strategies to drive improvement.

2. Identify achievements, challenges, and opportunities: Here you and the stakeholders will map the current state of alert quality to business impact, identifying areas where improvement has resulted in better business outcomes and areas where problems are impacting business outcomes.

3. Incident policy review: Using the AQM dashboard, you and the stakeholders will identify the noisiest incident policies. Once identified, those policies should be evaluated as detailed in step 4 below.

4. Alert policy recommendations: In this step, you and the stakeholders will review the noisiest policies using the following criteria:

* Do the alerts have any business impact?

* Are the policies properly configured?

* Are they telling us something about the resource that needs to be fixed?

* Are the policies necessary? Do they have business impact?

* Are the thresholds set properly?

5. Technical recommendations: Here, you and the stakeholders will review any technical recommendations, including:

* Are there application / system problems for engineering to review?

* Are there poorly constructed policies that need to be fixed?

* Are there instrumentation gaps?

This Markdown with two-space indentation renders like this:

Here is the same Markdown content but with four spaces preceding the bullets:

The process consists of four activities:

1. Review AQM dashboard and KPI trends: Here you and the stakeholders will look at the AQM KPIs and identify their week over week trends. The team should identify areas where KPIs are not improving and develop strategies to drive improvement.

(Video) The Dreaded Markdown Indented Code Blocks, Twig Templates, Dev Server CLI—Eleventy 🎈 Weekly №14

2. Identify achievements, challenges, and opportunities: Here you and the stakeholders will map the current state of alert quality to business impact, identifying areas where improvement has resulted in better business outcomes and areas where problems are impacting business outcomes.

3. Incident policy review: Using the AQM dashboard, you and the stakeholders will identify the noisiest incident policies. Once identified, those policies should be evaluated as detailed in step 4 below.

4. Alert policy recommendations: In this step, you and the stakeholders will review the noisiest policies using the following criteria:

* Do the alerts have any business impact?

* Are the policies properly configured?

* Are they telling us something about the resource that needs to be fixed?

* Are the policies necessary? Do they have business impact?

* Are the thresholds set properly?

5. Technical recommendations: Here, you and the stakeholders will review any technical recommendations, including:

* Are there application / system problems for engineering to review?

* Are there poorly constructed policies that need to be fixed?

* Are there instrumentation gaps?

The Markdown with four space indentation renders like this:

Indentation of consecutive procedures

Consecutive procedures behave as you might expect in Markdown, as long as they're left-justified. However, when you indent consecutive procedures, such as inside a collapser, Markdown sometimes does some unusual formatting. The following example shows how you'd set up two left-justified, consecutive lists in Markdown (outside of a collapser):

To add or delete tags via the UI:

1. Select a monitored entity, like a monitored app or host.

2. Near the entity's name at the top of the page, select the **See metadata and manage tags** menu.

3. In the menu that pops up, add or delete a tag.

4. For APM agents, restart your service.

You can also add or delete tags associated with a NRQL alert condition. To add or delete condition tags via the UI:

1. Navigate to a condition.

2. Near the condition's name at the top of the form, click **Manage tags**.

3. In the menu that pops up, add or delete a tag.

(Video) #6 — Lists — Ordered, Unordered, Bullets and Nesting — Mastering Markdown

However, inside a collapser where you're already indenting the content, Markdown can get confused about how to format the indentations:

  • Markdown doesn't indent the introductory sentences for the second procedure.
  • Markdown starts the numbering of the second procedure based on the last number of the first procedure.

Here's an example of how the Markdown for same consecutive procedures are indented inside of a collapser.

<CollapserGroup>

<Collapser

id="incorrect-formatting"

title="Two consecutive lists with incorrect formatting"

>

When you add tags via the UI or API, this occurs at the entity level. This means that, for example, if you have multiple APM agents monitoring a single entity and apply a tag via the UI, that tag is available for all data coming from that entity.

To add or delete tags via the UI:

1. Select a monitored entity, like a monitored app or host.

2. Near the entity's name at the top of the page, select the **See metadata and manage tags** menu.

3. In the menu that pops up, add or delete a tag.

4. For APM agents, restart your service.

You can also add or delete tags associated with a NRQL alert condition. To add or delete condition tags via the UI:

1. Navigate to a condition.

2. Near the condition's name at the top of the form, click **Manage tags**.

3. In the menu that pops up, add or delete a tag.

To manage tags via API: see our [NerdGraph tagging docs](/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). For a guide to using our CLI to automate tagging, see [our developer site](https://developer.newrelic.com/automate-workflows/5-mins-tag-resources/).

</Collapser>

</CollapserGroup>

When the Markdown is rendered, the introduction for the second procedure isn't indented (see "You can also add...") and note how the numbering for the second procedure starts at 5:

To avoid this unfortunate indentation and numbering, insert a second blank line feed so you have two line feeds separating the introductory sentence of the second procedure from the last numbered item of the first list. Here's how that markup looks:

(Video) Learn Markdown in 30 minutes!

Here is how this Markdown is rendered in HTML:

Code snippets in procedures

When you have a code snippet in a numbered list, indent snippets so they match the indentation of their parent steps (typically two spaces). Also, we recommend you use even-numbered indentation (with tabs composed of two spaces) like this:

Here is how this Markdown is rendered:

Image indentation

Images under list items should be indented the same as their parents. This shows the reader that the image is directly tied to that list item. Here's an example where the first image doesn't use the same indentation as the parent list item. The second image is indented correctly:

1. First, New Relic gathers all relevant incidents. This includes incidents where [decision-logic steps 1 and 2](#build-decision) are true, and that are also within the defined time window in advanced settings.

<img

title="topology-1.png"

alt="New Relic topology explained 1"

src={styleguideIndentsandImagesIncorrectExample}

/>

<figcaption>

In this example, all of the incidents in the dotted-line selection have met these requirements: they've gone through the [decision logic in steps 1 and 2](#build-decision), and all contextual comparisons made in [decision logic step 2](#build-decision) are true.

</figcaption>

2. Next, we attempt to associate each incident to a vertex in your [topology graph](#create-topology-graph) using a vertex's defining attributes and the available attributes on the incident.

<img

title="topology-2.png"

alt="New Relic topology explained 2"

src={styleguideIndentsandImagesCorrectExample}

/>

<figcaption>

Here's an example of the steps for associating incidents with the information in the topology graph.

</figcaption>

Here is how it is rendered. Note that the first image should have been indented under the step:

(Video) #8 — Code Blocks + Syntax Highlighting — Mastering Markdown

FAQs

How do you indent in Markdown code? ›

To format a code block in Markdown, indent every line of the block by at least four spaces. An indented code block cannot interrupt a paragraph, so you must insert at least one blank line between a paragraph the indented code block that follows.

How do I indent without formatting in Markdown? ›

Markdown Indent Without Bullet

In Markdown, you can indent a paragraph by using four spaces at the beginning of the line. However, if you want to indent a paragraph without creating a bullet, you can use two spaces.

Should Markdown be 2 or 4 spaces? ›

TL;DR : markdown list are rendered normally when using 4 white spaces but not when using 2 white spaces as indentation.

How do you set a Markdown spacing? ›

In Markdown, you can add space between two lines by pressing Enter/Return key.

How do you insert an indent? ›

To indent the first line of a paragraph, put your cursor at the beginning of the paragraph and press the tab key. When you press Enter to start the next paragraph, its first line will be indented.

How do I automatically indent a code? ›

Press Ctrl+Shift+P to open Command Palette. Type in settings and select Open User Settings. In Search settings box, input indent to search for settings related to indentation. Select full in Editor: Auto Indent section.

How do I indent only part of a text? ›

Create a hanging indent
  1. Select the text where you want to add a hanging indent.
  2. Go to Home > Paragraph dialog launcher. > Indents and Spacing.
  3. Under Special, select Hanging. You can adjust the depth of the indent using the By field.
  4. Select OK.

How do you indent without pressing? ›

On most computers, you can create a hanging indent by selecting the line you want indented and then holding down the Ctrl and T buttons at the same time. If you are using a Mac, press Cmd T instead.

Do I indent 4 spaces? ›

Four spaces should be used as the unit of indentation. The exact construction of the indentation (spaces vs. tabs) is unspecified.

Does space matter in Markdown? ›

Just write text white space doesn't matter.

What is the two space rule in Markdown? ›

It doesn't require two spaces before a newline to make paragraphs. Paragraphs in Markdown are defined by two consecutive newlines (i.e. there must be a blank line in between the paragraphs). The "two spaces" syntax is for line breaks, i.e. <br> tags.

What is the difference between tab and spaces in Markdown? ›

Always use spaces characters where two (2) spaces are used for indentation. The usage of tab characters is disallowed. A tab could be a different number of columns depending on the environment, but a space is always one column. Adhering to this rule increases the code readability and maintainability significantly.

What is Markdown style formatting? ›

What is Markdown? Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. Created by John Gruber in 2004, Markdown is now one of the world's most popular markup languages. Using Markdown is different than using a WYSIWYG editor.

How do I add tab space in Markdown? ›

Type nbsp to add a single space. Type ensp to add 2 spaces. Type emsp to add 4 spaces. You can use non-breaking space ( nbsp ) 4 times to insert a tab.

How do I add a tab Indentation? ›

Set tab stops and paragraph indents in Microsoft Word
  1. Select one paragraph or a group of paragraphs that you want to adjust.
  2. On the Page Layout or Layout tab, in the Paragraph group, choose Paragraph Settings.
  3. Choose the Indents and Spacing tab, choose your settings, and then click OK.

How do you indent 0.5 on the first line? ›

Click on the drop-down box and select the "First line" option. Choose the amount you want the lines indented by. You can change this in the "By:" box. Half an inch (0.5”) is the standard indent size.

Where is the indent tab? ›

From the Home tab, Paragraph group, select the dialog box launcher; Check that the Indents and Spacing tab is selected; In the Indentation section set the indent value you require.

How do I increase indent alignment? ›

Using the Increase Indent Button

Under the "Home" tab, in the "Alignment" group, click the "Increase Indent" icon (right-facing arrow pointing towards lines that resemble text). Each time you click the button, the selected text will indent further to the right.

How many spaces is an indent? ›

That blank space is the indent. Although the size of an indent varies according to the style guide used (such as the Chicago Manual of Style, MLA, or APA Style), the standard indent is the equivalent of five typed spaces—or about one-half inch.

How do I turn on auto indent? ›

Controlling Automatic Indenting
  1. Display the Word Options dialog box. ...
  2. At the left side of the dialog box click Proofing.
  3. Click AutoCorrect Options button. ...
  4. Make sure the AutoFormat As You Type tab is displayed. ...
  5. Make sure the Set Left- and First-Indent with Tabs and Backspaces option is cleared.
May 18, 2019

What is the fastest way to indent a code? ›

Should You Use Tab or Space to Indent? Technically, it is fine to either indent using the tab key or with the space bar. Indenting once with the tab key means just pressing the tab key once. Indenting once with the space bar means pressing the space bar 4 times.

Why should I indent my code? ›

In computer programming languages, indentation formats program source code to improve readability. Programming languages make use of indentation to define program structure . Programmers use indentation to understand the structure of their programs to human readers.

How do you indent without indenting a whole paragraph? ›

Just hold down the Ctrl key when you press Tab at the start of the first line: this causes Word to insert a Tab character, rather than indenting the whole paragraph.

How do you indent a whole section? ›

Indenting a Whole Paragraph

To do so, select the paragraph you want to indent. In the Layout tab on the ribbon bar, click the Indent Left arrow upwards within the Paragraph section. Continue to click the up arrow to increase the depth of the indent.

How do you indent and outdent? ›

Click the task row that you want to indent or outdent. To indent the task, press Alt + Shift + Right arrow. To outdent the task, press Alt + Shift + Left arrow.

Is indent the same as tab? ›

Like indents, tabs are placed on the Ruler and control the placement of text: The Left tab is used as the First Line indent; it moves the first line of the paragraph into the tab location. The Middle tab centers the entire paragraph on the tab location on the Ruler.

Can you skip a line instead of indenting? ›

Manuscript format is to indent the first line of each new paragraph (and to double space). Don't skip lines when doing this, unless you're indicating a larger break in the story. This is the industry standard, so editors and agents are expecting it.

What is the rule for indenting? ›

Indent the first line of each paragraph of text 0.5 in. from the left margin. Use the tab key or the automatic paragraph-formatting function of your word-processing program to achieve the indentation (the default setting is likely already 0.5 in.). Do not use the space bar to create indentation.

What is the best indent size? ›

Typically, a first-line indent should be no smaller than the current point size, or else it'll be hard to notice. It should be no bigger than four times the point size, or else the first line will seem disconnected from the left edge. So a paragraph set in 12 point should have a first-line indent of 12–48 points.

How many spaces is a 0.5 indent? ›

Indent each line of a new paragraph one tab space, which should be set at 1.27 cm or 0.5 in (American Psychological Association, 2020, p. 45).

Why is Markdown so popular? ›

You can write rich formatted content extremely quickly (compared to writing directly in HTML tags) You can read Markdown easily in plain text before rendered by HTML. It doesn't interrupt your workflow with the need to click buttons. It's platform-agnostic so your content is not tied to the format of your editor.

Is Markdown the best way to take notes? ›

If you're making technical notes or documents, Markdown is super easy when working with formatted code, images and links. It can easily be converted to Word, HTML or PDF. Nowadays it's used by GitHub and lots of others popular tools.

Is Markdown worth learning? ›

Markdown Is Easy to Read

Reading through a bunch of HTML while trying to focus on the content of the writing is a difficult task. Markdown's minimal formatting means that you can still focus on the words without the formatting getting in the way.

Can two spaces be used as a delimiter? ›

In direct answer to you question: No, you cannot specify 2 spaces as a delimiter. You can use SET search and replace to change 2 spaces into some unique character, but determining a unique character that will never appear in your description or command line is easier said then done.

Is Double space 1 inch margins? ›

Use double-spacing throughout the entire paper. Leave 1 inch margins on the top, bottom, and each side. Indent the first word of each paragraph 1/2 inch from the left margin.

Should I use two spaces? ›

While some may believe that either way is right, Microsoft formally settled the space debate in 2020 and sided with everyone who thinks one space is correct, not two. The creator of Microsoft Word updated the software so that two spaces between sentences would be considered an error.

How do you indent text in code? ›

You can indent elements by moving them two spaces to the right. This will make your code more readable by other developers and shows the relationship between the child and parent HTML elements.

How do I add a tab space in Markdown? ›

Type nbsp to add a single space. Type ensp to add 2 spaces. Type emsp to add 4 spaces. You can use non-breaking space ( nbsp ) 4 times to insert a tab.

How do you indent a script? ›

Ctrl+T and Ctrl+M indents the whole paragraph including the first word and the second line of the indented paragrah is wrapped under the first word.

What is the indent command? ›

The indent command reformats a C program as specified by flags entered with the command. If you only specify the InputFile parameter, the reformatted file is written back into the InputFile parameter and a backup copy of the InputFile parameter is written in the current directory with a . BAK filename suffix.

How do I add an indent to a text box? ›

Highlight all the text (other than the first line of the paragraph) you want to indent. Click the Home tab, and then click the Paragraph dialog box launcher. Under Indentation, in the Before text box, click the arrow to approximately . 5".

How do I add a tab space? ›

The &nbsp; character entity used to denote a non-breaking space which is a fixed space. This may be perceived as twice the space of a normal space. It is used to create a space in a line that cannot be broken by word wrap.

How do you give a tab space? ›

  1. Type &nbsp; to add a single space.
  2. Type &ensp; to add 2 spaces.
  3. Type &emsp; to add 4 spaces.

What is the fastest way to indent? ›

The fastest way to indent is to use the Tab key. An alternative method is to use one of the Indent commands. With these commands, you can either increase or decrease the indent. To indent using the Tab key: Place the insertion point at the very beginning of the line you want to indent, then press the Tab key.

How do you indent good? ›

The Chicago Manual of Style

Chicago recommends that writers indent the first line of a new paragraph by hitting the tab key. You hit the tab key between three and seven times to provide the proper space between the first line and the left margin.

Videos

1. Top 10 Markdown Formatting You Need To Know
(Steven Lipton)
2. You Might Not Need a Vim Plugin to Visualize Line Indents
(Nick Janetakis)
3. How to format Twitch Panels Text with Markdown (Tutorial)
(Gael LEVEL)
4. How to create html presentations with markdown files
(PatomackCodes)
5. Lint Markdown in VS Code | Extension Highlight
(Bald. Bearded. Builder.)
6. From Markdown To Groff - Groff Tutorial 1
(Gavin Freeborn)

References

Top Articles
Latest Posts
Article information

Author: Dan Stracke

Last Updated: 04/09/2023

Views: 5311

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Dan Stracke

Birthday: 1992-08-25

Address: 2253 Brown Springs, East Alla, OH 38634-0309

Phone: +398735162064

Job: Investor Government Associate

Hobby: Shopping, LARPing, Scrapbooking, Surfing, Slacklining, Dance, Glassblowing

Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.