# heading

URL: /patitas/api/lexer/classifiers/heading/
Section: classifiers
Description: ATX heading classifier mixin.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/lexer/classifiers/heading/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fclassifiers%2Fheading%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fclassifiers%2Fheading%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fclassifiers%2Fheading%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fclassifiers%2Fheading%2Findex.txt)

Module

#
`lexer.classifiers.heading`

ATX heading classifier mixin.

1Class

## Classes

`HeadingClassifierMixin`

2

▼

Mixin providing ATX heading classification.

Mixin providing ATX heading classification.

#### Methods

Internal Methods
2

▼

`_make_token`

6

`Token (/patitas/api/tokens/#Token)`

▼

Create token with raw coordinates. Implemented by Lexer.

`def _make_token(self, token_type: TokenType, value: str, start_pos: int, *, start_col: int | None = None, end_pos: int | None = None, line_indent: int = -1) -> Token`

##### Parameters

Name
Type
Description

`token_type`
`—`

`value`
`—`

`start_pos`
`—`

`start_col`
`—`

Default:`None`

`end_pos`
`—`

Default:`None`

`line_indent`
`—`

Default:`-1`

##### Returns

`Token (/patitas/api/tokens/#Token)`

`_try_classify_atx_heading`

3

`Token (/patitas/api/tokens/#Token) | None`

▼

Try to classify content as ATX heading.

ATX headings start with 1-6 # characte…

`def _try_classify_atx_heading(self, content: str, line_start: int, indent: int = 0) -> Token | None`

Try to classify content as ATX heading.

ATX headings start with 1-6 # characters followed by space/tab/newline/end.
Trailing # sequences are removed if preceded by space.

##### Parameters

Name
Type
Description

`content`
`—`

Line content with leading whitespace stripped

`line_start`
`—`

Position in source where line starts

`indent`
`—`

Number of leading spaces (for line_indent)

Default:`0`

##### Returns

`Token (/patitas/api/tokens/#Token) | None`

Token if valid heading, None otherwise.
