OC logo
Libraries Home Start Researching Subject Guides Services About Us
Skip to Main Content

AI Literacy

Prompt Crafting with Markdown

Markdown makes your prompts clearer, more organized, and easier for AI to understand and follow.

Why Use Markdown in Prompts?

  • Structure - Clear hierarchy and organization
  • Readability - Easy to scan and understand
  • Emphasis - Highlight important parts
  • Examples - Format code and samples cleanly
  • Templates - Create reusable prompt structures

Basic Prompt Structure with Markdown

The Template

# Task: [Clear title]

## Context
Brief background and setting

## Requirements
- Specific requirement 1
- Specific requirement 2
- Specific requirement 3

## Format
Expected output structure

## Examples
Sample inputs/outputs

## Constraints
- Length limits
- Style guidelines
- What to avoid

Practical Examples

Example 1: Content Creation Prompt

# Task: Write Social Media Posts

## Context
You are a social media manager for a sustainable fashion brand targeting millennials.

## Requirements
- Create **3 Instagram posts**
- Focus on *sustainability* and *style*
- Include relevant hashtags
- Engaging, conversational tone

## Format
For each post:
**Caption:** [Main text]
**Hashtags:** [5-8 relevant hashtags]
**Call-to-action:** [What should users do?]

## Example Output
**Caption:** Just dropped our new recycled cotton collection! 🌱
**Hashtags:** #SustainableFashion #EcoStyle #SlowFashion #GreenLiving
**Call-to-action:** Shop the collection - link in bio!

## Constraints
- Maximum 150 words per caption
- Include at least one emoji
- No controversial topics

Example 2: Code Review Prompt

# Task: Code Review and Optimization

## Context
Review this Python function for a data processing pipeline.

## Code to Review
```python
def process_data(data):
    results = []
    for item in data:
        if item > 0:
            results.append(item * 2)
    return results

Review Criteria

  1. Performance - Can it be optimized?
  2. Readability - Is it clear and well-structured?
  3. Error Handling - What edge cases are missing?
  4. Best Practices - Any Python conventions violated?

Expected Output Format

Issues Found

  • Issue 1: [Description]
  • Issue 2: [Description]

Suggested Improvements

# Improved code here

Explanation

Brief explanation of changes and benefits.


### Example 3: Analysis Prompt

```markdown
# Task: Competitive Analysis Report

## Context
Analyze three competitors in the meal delivery space: DoorDash, Uber Eats, and Grubhub.

## Analysis Framework
Compare across these dimensions:
1. **Market Position**
2. **Key Features**
3. **Pricing Strategy**
4. **User Experience**
5. **Strengths & Weaknesses**

## Output Format
### [Competitor Name]
- **Market Position:** Brief description
- **Key Features:** 
  - Feature 1
  - Feature 2
  - Feature 3
- **Pricing:** Strategy overview
- **UX Highlights:** What stands out
- **Strengths:** Top 2-3 advantages
- **Weaknesses:** Top 2-3 disadvantages

### Summary Table
| Aspect | DoorDash | Uber Eats | Grubhub |
|--------|----------|-----------|---------|
| Market Share | % | % | % |
| Key Differentiator | X | Y | Z |

## Constraints
- Focus on ***current*** market data (2024-2025)
- Keep each section under 100 words
- Include specific examples where possible

Advanced Markdown Techniques for Prompts

Using Nested Lists for Complex Instructions

## Task Breakdown
1. **Research Phase**
   - Gather primary sources
   - Identify key stakeholders
   - Note any conflicting information

2. **Analysis Phase**
   - Compare different perspectives
   - Identify patterns and trends
   - Draw preliminary conclusions

3. **Synthesis Phase**
   - Create unified narrative
   - Address contradictions
   - Provide recommendations

Using Blockquotes for Context or Examples

## Background
The client mentioned:
> "We need something that feels premium but approachable, 
> professional but not stuffy. Think Apple meets local coffee shop."

This suggests they want:
- **Premium feel** without being intimidating
- **Professional quality** with personality
- **Accessible** to everyday users

Using Code Blocks for Templates

## Email Template Required
Please create emails following this structure:

Subject: [Action-oriented subject line]

Hi [Name],

[Personal opening - reference previous interaction]

[Main message - 2-3 sentences max]

[Clear call-to-action]

Best regards, [Signature]


## Best Practices

### Do ✅
- Use **bold** for critical requirements
- Use *italics* for emphasis and nuance
- Structure with clear headers (`##`, `###`)
- Include concrete examples in code blocks
- Use lists for multiple items or steps
- Add horizontal rules (`---`) to separate major sections

### Don't ❌
- Overuse formatting - it loses impact
- Create deeply nested structures (keep to 3 levels max)
- Use markdown just for decoration
- Forget to test your formatting
- Make headers too long or vague

## Template for Any Prompt

```markdown
# Task: [One clear sentence]

## Context
[2-3 sentences about the situation]

## Specific Requirements
- [ ] Requirement 1
- [ ] Requirement 2  
- [ ] Requirement 3

## Success Criteria
What does "good" look like?

## Format/Template
Expected structure of output

## Examples
[Show, don't just tell]

## Additional Notes
Any special considerations

Remember: Markdown in prompts isn't about making things look pretty - it's about making your intentions crystal clear to the AI.

Simple Markdown Guide

Markdown is a lightweight way to format text using simple symbols. It's widely used for documentation, README files, and online content.

Basic Text Formatting

Headers

Use # for headers. More # = smaller header.

# Big Header (H1)
## Medium Header (H2)
### Small Header (H3)

Text Styles

  • Bold text: Wrap with **text** or __text__
  • Italic text: Wrap with *text* or _text_
  • Bold and italic: Use ***text***
  • ~~Strikethrough~~: Use ~~text~~

Lists

Bullet Lists

Use -, *, or +:

- Item one
- Item two
- Item three

Numbered Lists

Use numbers with periods:

1. First item
2. Second item
3. Third item

Links and Images

Links

[Link text](https://example.com)
[Link with title](https://example.com "Hover text")

Images

![Alt text](image-url.jpg)
![Alt text](image-url.jpg "Image title")

Code

Inline Code

Use backticks: code here

Code Blocks

Use triple backticks:

```
Your code here
```

Code with Language

```python
print("Hello, World!")
```

Other Useful Elements

Quotes

Use > for blockquotes:

> This is a quote
> It can span multiple lines

Horizontal Line

Use --- or ***:

---

Tables

| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Row 1    | Data     | More     |
| Row 2    | Data     | More     |

Quick Reference

Element Syntax
Bold **text**
Italic *text*
Link [text](url)
Image ![alt](url)
Code `code`
Quote > quote
Header # H1 ## H2 ### H3

Tips for Success

  • Preview your work - Most editors show live previews
  • Keep it simple - Don't overuse formatting
  • Be consistent - Pick one style and stick to it
  • Practice - Try writing a simple document to get comfortable

Markdown works almost everywhere: GitHub, Reddit, Discord, documentation sites, and many text editors. Once you learn it, you'll use it everywhere!