API Reference
Main Module
Main module.
- Copyright
2018-present Reece Dunham.
- License
MIT, see LICENSE for more details.
- area4.divider(number)
Get the divider you requested.
- Parameters
number (int) – The divider number (can’t be 0).
- Returns
The requested divider.
- Return type
- Raises
ValueError – If you request an invalid divider.
- Example
area4.divider(3)
will return ‘…………’
- area4.make_div(unit, length=24, start='', end='', literal_unit=False)
Generate a custom divider.
- Parameters
unit (str) – A repeating unit.
length (Optional[int]) – The maximum length (won’t be exceeded) (default: 24).
start (Optional[str]) – Starting string.
end (Optional[str]) – Ending string.
literal_unit (Optional[bool]) – If
True
, it will not try to break unit down into smaller repeating subunits. Defaults toFalse
.
- Returns
A new, custom divider.
- Return type
- Example
custom_div = make_div(unit='=-', length=40, start='<', end='=>')
Note
The generated string will be terminated at the specified length regardless of if all the input strings have been fully replicated. A unit > 1 length may not be able to be replicated to extend to the full length. In this situation, the string will be shorter than the specified length. Example: unit of 10 characters and a specified length of 25 will contain 2 units for a total length of 20 characters.
Utilities
Utilities module.
- Copyright
2018-present Reece Dunham.
- License
MIT, see LICENSE for more details.
- area4.util.get_divider_character(divider_id)
Get the character the divider is made of.
- Parameters
divider_id (int) – The divider’s number.
- Returns
The character.
- Return type
- Raises
ValueError – If you request an invalid divider.
- Example
Get what divider 7 is made of:
get_divider_character(7) # returns '='.
- area4.util.get_raw_file()
Get the raw divider file in a string array.
- Returns
The array.
- Return type
List[str]
- area4.util.html_horizontal(closing_tag=True)
Get HTML horizontal divider.
- area4.util.markdown_horizontal()
Get Markdown horizontal divider.
- Returns
The divider.
- Return type