Skip to content

Commit cb15978

Browse files
tonurdidix21
authored andcommitted
Enable specifying title header style, default being setext
1 parent eebd079 commit cb15978

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mdutils/mdutils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class MdUtils:
4040
- **author:** it is the author fo the Markdown file.
4141
- **header:** it is an instance of Header Class.
4242
- **textUtils:** it is an instance of TextUtils Class.
43-
- **title:** it is the title of the Markdown file. It is written with Setext-style.
43+
- **title:** it is the title of the Markdown file. It is written with Setext-style unless otherwise specified.
4444
- **table_of_contents:** it is the table of contents, it can be optionally created.
4545
- **file_data_text:** contains all the file data that will be written on the markdown file.
4646
"""
4747

48-
def __init__(self, file_name: str, title: str = "", author: str = ""):
48+
def __init__(self, file_name: str, title: str = "", author: str = "", title_header_style: str = "setext"):
4949
"""
5050
5151
:param file_name: it is the name of the Markdown file.
@@ -58,7 +58,7 @@ def __init__(self, file_name: str, title: str = "", author: str = ""):
5858
self.file_name = file_name
5959
self.author = author
6060
self.textUtils = TextUtils
61-
self.title = str(Header(level=1, title=title, style=HeaderStyle.SETEXT))
61+
self.title = str(Header(level=1, title=title, style=HeaderStyle[title_header_style.upper()]))
6262
self.table_of_contents = ""
6363
self.file_data_text = ""
6464
self._table_titles = []

0 commit comments

Comments
 (0)