Skip to content

RyoKikuchi99/markdown-auto-headings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Auto Headings

Overview

This program adds specific prefix and number automatically to a markdown document due to the depth of headings.

Usage

generate_auto_headings(
    markdown_text: str,
    prefix: str,
    delimiter: str,
    heading_start_pos: int):

The input text is defined as follows:

input_text = (
    "# Introduction\n"
    "## Section 1\n"
    "### Subsection 1.1\n"
    "## Section 2\n"
    "### Subsection 2.1\n"
    "### Subsection 2.2\n"
)

Call generate_auto_headings like this:

output = generate_auto_headings(input_text, 'A', '-', 1)
print(output)

The output text shall be:

# [A-1] Introduction
## [A-1-1] Section 1
### [A-1-1-1] Subsection 1.1
## [A-1-2] Section 2
### [A-1-2-1] Subsection 2.1
### [A-1-2-2] Subsection 2.2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages