Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Version Directives Ahead of 2.0.0 Release #113

Merged
merged 4 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions snakemd/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def add_block(self, block: Block) -> Block:

doc.add_block(Heading("Python is Cool!"), 2))

.. versionadded:: 0.14.0
replaces :func:`add_element`

:param Block block: a markdown block (e.g., Table, Heading, etc.)
:return: the Block added to this Document
"""
Expand Down Expand Up @@ -78,9 +75,6 @@ def add_heading(self, text: str, level: int = 1) -> Heading:

doc.add_heading("Welcome to SnakeMD!")

.. versionadded:: 0.13.0
replaces :func:`add_header`

:param str text: the text for the heading
:param int level: the level of the heading from 1 to 6
:return: the Heading added to this Document
Expand All @@ -98,9 +92,6 @@ def add_paragraph(self, text: str) -> Paragraph:

doc.add_paragraph("Mitochondria is the powerhouse of the cell.")

.. versionchanged:: 0.2.0
Returns Paragraph generated by this method instead of None.

:param str text: any arbitrary text
:return: the Paragraph added to this Document
"""
Expand All @@ -117,9 +108,6 @@ def add_ordered_list(self, items: Iterable[str]) -> MDList:

doc.add_ordered_list(["Goku", "Piccolo", "Vegeta"])

.. versionchanged:: 0.2.0
Returns MDList generated by this method instead of None.

:param Iterable[str] items: a "list" of strings
:return: the MDList added to this Document
"""
Expand All @@ -136,9 +124,6 @@ def add_unordered_list(self, items: Iterable[str]) -> MDList:

doc.add_unordered_list(["Deku", "Bakugo", "Kirishima"])

.. versionchanged:: 0.2.0
Returns MDList generated by this method instead of None.

:param Iterable[str] items: a "list" of strings
:return: the MDList added to this Document
"""
Expand All @@ -155,8 +140,6 @@ def add_checklist(self, items: Iterable[str]) -> MDList:

doc.add_checklist(["Okabe", "Mayuri", "Kurisu"])

.. versionadded:: 0.10.0

:param Iterable[str] items: a "list" of strings
:return: the MDCheckList added to this Document
"""
Expand Down Expand Up @@ -187,13 +170,6 @@ def add_table(
0
)

.. versionchanged:: 0.2.0
Returns Table generated by this method instead of None.
.. versionchanged:: 0.4.0
Added optional alignment parameter
.. versionchanged:: 0.11.0
Added optional indentation parameter

:param Iterable[str] header: a "list" of strings
:param Iterable[Iterable[str]] data: a "list" of "lists" of strings
:param Iterable[Table.Align] align: a "list" of column alignment values;
Expand All @@ -216,11 +192,6 @@ def add_code(self, code: str, lang: str = "generic") -> Code:

doc.add_code("x = 5")

.. versionchanged:: 0.2.0
returns Paragraph generated by this method instead of None
.. versionchanged:: 0.15.0
returns Code block generated by this method instead of Paragraph

:param str code: a preformatted code string
:param str lang: the language for syntax highlighting
:return: the Code block added to this Document
Expand All @@ -238,9 +209,6 @@ def add_quote(self, text: str) -> Paragraph:

doc.add_quote("Welcome to the Internet!")

.. versionchanged:: 0.2.0
Returns Paragraph generated by this method instead of None.

:param str text: the text to be quoted
:return: the Paragraph added to this Document
"""
Expand All @@ -257,8 +225,6 @@ def add_horizontal_rule(self) -> HorizontalRule:

doc.add_horizontal_rule()

.. versionadded:: 0.2.0

:return: the HorizontalRule added to this Document
"""
hr = HorizontalRule()
Expand All @@ -278,12 +244,6 @@ def add_table_of_contents(self, levels: range = range(2, 3)) -> TableOfContents:

doc.add_table_of_contents()

.. versionchanged:: 0.2.0
Fixed a bug where table of contents could only be rendered once.

.. versionchanged:: 0.8.0
Added optional levels parameter

:param range levels: a range of heading levels to be included in the table of contents
:return: the TableOfContents added to this Document
"""
Expand All @@ -299,13 +259,6 @@ def scramble(self) -> None:
"""
random.shuffle(self._contents)
logger.debug(f"Scrambled document")

def _get_file_name(self) -> str:
"""
A helper function for generating the file name.
"""
file_name = f"{'-'.join(self._name.split())}{self._ext}"
return file_name

def dump(self, name: str, dir: str | os.PathLike = "", ext: str = "md", encoding: str = "utf-8") -> None:
"""
Expand All @@ -319,9 +272,6 @@ def dump(self, name: str, dir: str | os.PathLike = "", ext: str = "md", encoding

doc.dump("README")

.. versionadded:: 0.13.0
Replaces the :func:`output_page` method

:param str name: the name of the markdown file to output without the file extension
:param str | os.PathLike dir: the output directory for the markdown file; defaults to ""
:param str ext: the output file extension; defaults to "md"
Expand Down
Loading