Skip to content

Commit

Permalink
Adds doc strings here too
Browse files Browse the repository at this point in the history
  • Loading branch information
stumpylog committed Sep 30, 2024
1 parent d616d85 commit 007be40
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/gotenberg_client/_convert/chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,15 @@ def index(self, index: Path) -> Self:

def string_index(self, index: str) -> Self:
"""
Provides the given string data as the index HTML for conversion
Provides the given string data as the index HTML for conversion.
Args:
index (str): The HTML content to be used as the index file.
Returns:
Self: This object itself for method chaining.
"""

self._add_in_memory_file(index, name="index.html", mime_type="text/html")
return self

Expand All @@ -56,12 +63,23 @@ def resource(self, resource: Path, *, name: Optional[str] = None) -> Self:
self._add_file_map(resource, name=name)
return self

def string_resource(self, resource: str, *, name: str, mime_type: Optional[str] = None) -> Self:
def string_resource(self, resource: str, name: str, mime_type: Optional[str] = None) -> Self:
"""
Provides the given string data, with the provided name, for the index HTML file to reference during conversion
Adds a string resource to the conversion process.
The provided string data will be made available to the index HTML file during conversion,
using the specified name and MIME type.
Args:
resource (str): The string data to be added as a resource.
name (str): The name to assign to the resource.
mime_type (Optional[str]): The MIME type of the resource (optional).
Returns:
Self: This object itself for method chaining.
"""
self._add_in_memory_file(resource, name=name, mime_type=mime_type)

self._add_in_memory_file(resource, name=name, mime_type=mime_type)
return self

def resources(self, resources: List[Path]) -> Self:
Expand Down

0 comments on commit 007be40

Please sign in to comment.