Lists

Create ordered, unordered, and nested lists in your Mordoc documentation using markdown syntax.

Lists

Lists organize information into easy-to-scan, structured formats. Mordoc supports ordered (numbered), unordered (bulleted), and nested lists.

Unordered Lists

Create bullet-point lists using -, *, or +:

Markdown
- First item
- Second item
- Third item

Result:

  • First item
  • Second item
  • Third item

Alternative Markers

All three markers produce identical output:

Markdown
- Item with dash
* Item with asterisk
+ Item with plus

Choose one style and be consistent throughout your documentation.

Ordered Lists

Create numbered lists using numbers followed by periods:

Markdown
1. First step
2. Second step
3. Third step

Result:

  1. First step
  2. Second step
  3. Third step

Automatic Numbering

Markdown automatically numbers items sequentially. You can use 1. for all items:

Markdown
1. First item
1. Second item (will render as 2)
1. Third item (will render as 3)

This makes reordering items easier without renumbering.

Starting numbers matter. If you start with 3., the list will begin at 3, not 1.

Nested Lists

Create hierarchical lists by indenting with 2-4 spaces or one tab:

Nested Unordered Lists

Markdown
- Main item
  - Nested item
  - Another nested item
    - Deeply nested item
- Another main item

Result:

  • Main item
    • Nested item
    • Another nested item
      • Deeply nested item
  • Another main item

Nested Ordered Lists

Markdown
1. First step
   1. Sub-step one
   2. Sub-step two
2. Second step
   1. Sub-step one
   2. Sub-step two

Result:

  1. First step
    1. Sub-step one
    2. Sub-step two
  2. Second step
    1. Sub-step one
    2. Sub-step two

Mixed Lists

Combine ordered and unordered lists:

Markdown
1. Main task
   - Subtask (unordered)
   - Another subtask
2. Another main task
   - First subtask
     1. Detailed step
     2. Another detailed step
   - Second subtask

Result:

  1. Main task
    • Subtask (unordered)
    • Another subtask
  2. Another main task
    • First subtask
      1. Detailed step
      2. Another detailed step
    • Second subtask

List Items with Multiple Paragraphs

Add multiple paragraphs to a list item by indenting:

Markdown
1. First item with multiple paragraphs.

   This is the second paragraph for the first item. It needs to be indented.

2. Second item.

   Another paragraph here.

Result:

  1. First item with multiple paragraphs.

    This is the second paragraph for the first item. It needs to be indented.

  2. Second item.

    Another paragraph here.

Lists with Code Blocks

Include code blocks in list items:

Markdown
1. Install the package:

   ```bash
   npm install mordoc
  1. Configure your project:

    Json
    {
      "title": "My Docs"
    }
Result:

1. Install the package:

   ```bash
   npm install mordoc
  1. Configure your project:

    Json
    {
      "title": "My Docs"
    }

Lists with Other Elements

Markdown
- [Installation Guide](/get-started/creating-project)
- [Configuration Reference](/configuration/sidenav)
- [Deployment Instructions](/deployment/build)

Result:

Lists with Emphasis

Markdown
- **Bold item**: Description here
- *Italic item*: Another description
- `Code item`: Technical term

Result:

  • Bold item: Description here
  • Italic item: Another description
  • Code item: Technical term

Lists with Images

Markdown
1. First step:
   
   ![Screenshot](/images/step1.png)

2. Second step:
   
   ![Screenshot](/images/step2.png)

Task Lists

Create checkboxes with task list syntax:

Markdown
- [ ] Incomplete task
- [x] Completed task
- [ ] Another incomplete task

Result:

  • [ ] Incomplete task
  • [x] Completed task
  • [ ] Another incomplete task
Interactive Checkboxes

Task lists render as checkboxes in the documentation. They're perfect for checklists, prerequisites, and progress tracking.

Definition Lists

For term-definition pairs, use HTML:

HTML
<dl>
  <dt>Term 1</dt>
  <dd>Definition of term 1</dd>
  
  <dt>Term 2</dt>
  <dd>Definition of term 2</dd>
</dl>

Best Practices

When to Use Unordered Lists

Use bullet points when:

  • Order doesn't matter
  • Listing features or options
  • Showing related items
  • Creating quick reference lists
Markdown
## Key Features

- Fast build times
- Beautiful themes
- Easy customization
- Full markdown support

When to Use Ordered Lists

Use numbered lists when:

  • Steps must follow a sequence
  • Priority or ranking matters
  • Creating instructions or tutorials
  • Showing progression
Markdown
## Installation Steps

1. Download the installer
2. Run the installation wizard
3. Configure your settings
4. Launch the application

Nesting Guidelines

  1. Limit Depth: Avoid nesting more than 3 levels deep
  2. Use Consistently: Maintain consistent indentation (2 or 4 spaces)
  3. Stay Logical: Nested items should relate to their parent
  4. Consider Alternatives: Deep nesting may indicate need for subsections

Writing List Items

Do:

  • Start with capital letters for complete sentences
  • Use parallel structure (all sentences or all phrases)
  • Keep items concise
  • Use punctuation consistently

Don't:

  • Mix complete sentences with fragments
  • Make items too long (consider breaking into paragraphs)
  • Use inconsistent punctuation
  • Nest excessively

Common Patterns

Feature Lists

Markdown
## What Mordoc Offers

- **Easy Setup**: Get started in minutes with npx
- **Markdown-First**: Write in familiar markdown syntax
- **Deploy Anywhere**: No vendor lock-in
- **Customizable**: Full control over styling

Step-by-Step Instructions

Markdown
## Deployment Checklist

1. Run build command:
   ```bash
   npm run build
  1. Test the production build locally
  2. Upload dist/ folder to your server
  3. Configure your domain DNS
  4. Verify the site is live
### Prerequisites

```markdown
## Before You Begin

Ensure you have:

- [ ] Node.js 18+ installed
- [ ] Git installed and configured
- [ ] A code editor (VS Code recommended)
- [ ] Basic markdown knowledge

Comparison Lists

Markdown
## Mordoc vs. Alternatives

**Mordoc Advantages:**
- Deploy to any infrastructure
- No monthly fees
- Complete source code access
- Unlimited customization

**Other Tools:**
- Locked to specific platforms
- Subscription required
- Limited customization
- Proprietary formats

Troubleshooting Lists

Markdown
## Common Issues

1. **Build fails**
   - Check Node.js version (18+ required)
   - Verify all dependencies installed
   - Review error messages in console

2. **Pages not appearing**
   - Confirm file is in `content/en/`
   - Check `sidenav.yaml` configuration
   - Ensure file has `.md` extension

Spacing and Formatting

Tight Lists

Lists without blank lines between items:

Markdown
- Item one
- Item two
- Item three

Loose Lists

Lists with blank lines (adds more spacing):

Markdown
- Item one

- Item two

- Item three

Troubleshooting

List Not Rendering

  • Ensure space after - or number
  • Check indentation is consistent
  • Verify no extra characters before markers

Incorrect Nesting

  • Use 2-4 spaces or one tab for each level
  • Maintain consistent indentation
  • Align nested items under parent text

Numbers Not Sequential

  • Remove custom numbering if you want auto-numbering
  • Check for blank lines breaking the list
  • Ensure proper indentation for nested lists

Mixing tabs and spaces can cause rendering issues. Choose one and be consistent throughout your documentation.

Examples

Complete Documentation Section

Markdown
# Getting Started Guide

## Prerequisites

Before beginning, ensure you have:

- [ ] Node.js 18 or higher
- [ ] npm or yarn package manager
- [ ] Git for version control
- [ ] Code editor installed

## Installation Steps

1. Create a new project:

   ```bash
   npx create-mordoc-app my-docs
  1. Navigate to the project:

    Bash
    cd my-docs
  2. Start the development server:

    Bash
    npm run dev
  3. Open your browser to http://localhost:3000

Project Structure

Your new project contains:

  • config/: Configuration files
    • sidenav.yaml: Navigation structure
    • site.json: Site metadata
    • styles/: Theme customization
  • content/: Markdown documentation
    • en/: English language content
  • public/: Static assets
    • images/: Image files
    • icons/: Icon files

Next Steps

After installation, you can:

  1. Customize your site configuration
  2. Add your own content
  3. Modify the theme and colors
  4. Deploy to your hosting platform
## Next Steps

- [Tables](/syntax-components/tables) - Display structured data in tables
- [Code Blocks](/syntax-components/code-blocks) - Add syntax-highlighted code
- [Callouts](/syntax-components/callouts) - Create styled alert boxes