# base.py

**Path:** `src/thedoc/parsers/base.py`

## Classes

### DocItem

Represents a documentation item.

---

### BaseParser

Base class for language-specific parsers.

---

## Methods

### DocItem.__post_init__

Initialize optional fields.

```python
__post_init__(self)
```

---

### BaseParser.__init__

Initialize the parser.

```python
__init__(self, root_path)
```

**Parameters:**

* `root_path`: The root path of the project to parse.

---

### BaseParser.parse_file

Parse a single file and extract documentation items.

```python
parse_file(self, file_path)
```

**Parameters:**

* `file_path`: Path to the file to parse.

---

### BaseParser.get_file_extensions

Get the file extensions this parser can handle.
List of file extensions (e.g., ['.py', '.pyx']).

```python
get_file_extensions(self)
```

---

### BaseParser.is_supported_file

Check if the given file is supported by this parser.

```python
is_supported_file(self, file_path)
```

**Parameters:**

* `file_path`: Path to the file to check.

---

### BaseParser.parse_directory

Parse all supported files in a directory recursively.

```python
parse_directory(self, directory)
```

**Parameters:**

* `directory`: Path to the directory to parse.

---

## Modules

### base

Base parser for code analysis.

---

