diff --git a/src/gotenberg_client/_convert/chromium.py b/src/gotenberg_client/_convert/chromium.py index 1473943..4e176f3 100644 --- a/src/gotenberg_client/_convert/chromium.py +++ b/src/gotenberg_client/_convert/chromium.py @@ -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 @@ -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: