Creating a Blog with Jekyll and GitHub Pages


layout: post title: “Markdown Guide for Technical Blogging” category: markdown date: 2025-04-06 excerpt: “A comprehensive guide to writing technical blog posts using Markdown” —

Markdown Guide for Technical Blogging

This guide will show you how to write effective technical blog posts using Markdown.

Table of Contents

  1. Basic Markdown Syntax
  2. Code Blocks and Syntax Highlighting
  3. Technical Documentation Features
  4. Diagrams and Charts
  5. Best Practices

Basic Markdown Syntax

Headers

# H1 - Main Title
## H2 - Section
### H3 - Subsection
#### H4 - Sub-subsection

Text Formatting

**Bold text**
*Italic text*
~~Strikethrough~~
`inline code`

Lists

Ordered lists:

1. First item
2. Second item
   1. Sub-item
   2. Sub-item

Unordered lists:

- Item
- Another item
  - Sub-item
  - Sub-item
[Link text](URL)
![Alt text](image-url)

<!-- Reference style -->
[link-id]: URL
[Link text][link-id]

Code Blocks

Syntax Highlighting

```python
def hello_world():
    print("Hello, World!")
```

```javascript
function greet(name) {
    console.log(`Hello, ${name}!`);
}
```

```sql
SELECT * FROM users WHERE active = true;
```

Code Block with Line Numbers


<figure class="highlight"><pre><code class="language-python" data-lang="python"><table class="rouge-table"><tbody><tr><td class="gutter gl"><pre class="lineno">1
2
3
4
</pre></td><td class="code"><pre><span class="k">def</span> <span class="nf">factorial</span><span class="p">(</span><span class="n">n</span><span class="p">):</span>
    <span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
        <span class="k">return</span> <span class="mi">1</span>
    <span class="k">return</span> <span class="n">n</span> <span class="o">*</span> <span class="n">factorial</span><span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
</pre></td></tr></tbody></table></code></pre></figure>

Code with Output

```bash
$ python hello.py
Hello, World!
```

Technical Documentation

Tables

| Parameter | Type | Description |
|-----------|------|-------------|
| name | string | User's name |
| age | integer | User's age |
| email | string | User's email |

Blockquotes

> **Note:** Important information here
> 
> Multiple lines can be used

Definition Lists

Term
: Definition here
: Another definition

Another term
: Its definition

Task Lists

- [x] Completed task
- [ ] Pending task
- [ ] Future task

Diagrams

Mermaid Diagrams

```mermaid
graph TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Great!]
    B -->|No| D[Debug]
    D --> B
```

PlantUML (if supported)

```plantuml
@startuml
class User {
  +name: string
  +email: string
  +login()
}
@enduml
```

Best Practices

1. Document Structure

---
layout: post
title: "Your Technical Post"
date: 2024-04-05
categories: [programming, tutorial]
tags: [python, web-dev]
---

# Main Title

Brief introduction (1-2 paragraphs)

## Table of Contents

## First Section

### Subsection

## Conclusion

2. Code Examples

  • Always specify the language for syntax highlighting
  • Include comments in code blocks
  • Show both code and output when relevant
# This is a simple example
def greet(name):
    """
    Greets the user with their name
    """
    return f"Hello, {name}!"

3. Technical Writing Tips

  1. Use Clear Headers
    • Make sections easily scannable
    • Keep hierarchy logical
  2. Code Formatting
    • Use inline code for:
      • Variable names
      • File names
      • Short commands
  3. Visual Elements
    • Add diagrams for complex concepts
    • Include screenshots when needed
    • Use tables for structured data

4. Common Patterns

API Documentation

## API Endpoint

`GET /api/v1/users`

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| page | int | No | Page number |

### Response

```json
{
    "users": [],
    "total": 0
}

#### Tutorial Steps

```markdown
## Step 1: Installation

1. First, install the package:
   ```bash
   npm install package-name
  1. Configure your settings:
    const config = {
      // settings here
    };
    

Step 2: Usage


### 5. SEO Optimization

- Use descriptive titles
- Include relevant tags
- Structure content with proper headings
- Add meta descriptions in front matter

```yaml
---
layout: post
title: "Complete Guide to Python Virtual Environments"
description: "Learn how to create, activate, and manage Python virtual environments for better dependency management"
tags: [python, virtualenv, programming]
---

Advanced Features

Mathematical Equations

Using LaTeX syntax (if supported by your Jekyll setup):

Inline equation: $E = mc^2$

Block equation:
$$
\frac{n!}{k!(n-k)!} = \binom{n}{k}
$$

Footnotes

Here's a sentence with a footnote[^1].

[^1]: This is the footnote content.

Abbreviations

*[HTML]: Hyper Text Markup Language
*[CSS]: Cascading Style Sheets

Use HTML and CSS in your document.

Resources

Conclusion

This guide covers the essential Markdown features for technical blogging. Remember to:

  • Structure your content logically
  • Use appropriate formatting for code and technical content
  • Include visual aids when helpful
  • Follow consistent formatting patterns

Keep practicing and refer back to this guide as needed!