Skip to content

Commit dffa5ec

Browse files
committed
improve
1 parent 7fa741d commit dffa5ec

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

_includes/additional_parameters.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
| Name | Type | Description |
2+
|:-------------|:------------------|:------|
3+
| **google_fonts** | `String` | [Google fonts](/parameters/google_fonts/) to be loaded. Example: `Roboto`. Multiple fonts can be loaded like this: `Roboto|Open Sans` |
4+
| **selector** | `String` | A [CSS selector](/guides/selector/) for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg` |
5+
| **ms_delay** | `Integer` | The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time. [Learn more](/parameters/ms_delay/). |
6+
| **device_scale** | `Double` | Controls the image resolution by adjusting the pixel ratio. Minimum: `1`, Maximum: `3`. Higher values increase image quality and file size. For example, `2` will double the resolution. [Learn more](/parameters/device_scale/). |
7+
| **render_when_ready** | `Boolean` | Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](/parameters/render_when_ready/). |
8+
| **full_screen** | `Boolean` | When set to true, the API will generate an image of the entire height of the page. |
9+
| **viewport_width** | `Integer` | Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |
10+
| **viewport_height** | `Integer` | Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |

getting-started/using-the-api.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,7 @@ The create image endpoint accepts the following parameters. Accepted as either `
5656

5757
Optional parameters for greater control over your image.
5858

59-
| Name | Type | Description |
60-
|:-------------|:------------------|:------|
61-
| **google_fonts** | `String` | [Google fonts](/parameters/google_fonts/) to be loaded. Example: `Roboto`. Multiple fonts can be loaded like this: `Roboto|Open Sans` |
62-
| **selector** | `String` | A [CSS selector](/guides/selector/) for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg` |
63-
| **ms_delay** | `Integer` | The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time. [Learn more](/parameters/ms_delay/). |
64-
| **device_scale** | `Double` | Controls the image resolution by adjusting the pixel ratio. Minimum: `1`, Maximum: `3`. Higher values increase image quality and file size. For example, `2` will double the resolution. [Learn more](/parameters/device_scale/). |
65-
| **render_when_ready** | `Boolean` | Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](/parameters/render_when_ready/). |
66-
| **full_screen** | `Boolean` | When set to true, the API will generate an image of the entire height of the page. |
67-
| **viewport_width** | `Integer` | Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |
68-
| **viewport_height** | `Integer` | Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |
59+
{% include additional_parameters.md %}
6960

7061
<hr>
7162

parameters/index.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,19 @@ The create image endpoint accepts the following parameters. Accepted as either `
1919

2020
| Name | Type | Description |
2121
|:-------------|:------------------|:------|
22-
| **html**<span class="text-red-200">*</span> | `String` | This is the HTML you want to render. You can send an HTML snippet \(`<div>Your content</div>`\) or an entire webpage. |
22+
| **html** | `String` | This is the HTML you want to render. You can send an HTML snippet \(`<div>Your content</div>`\) or an entire webpage. |
2323
| **css** | `String` | The CSS for your image. When using with `url` it will be injected into the page. |
24-
| **url**<span class="text-red-200">*</span> | `String` | The fully qualified URL to a public webpage. Such as `https://htmlcsstoimage.com`. When passed this will override the html param and will generate a screenshot of the url. |
24+
| **url** | `String` | The fully qualified URL to a public webpage. Such as `https://htmlcsstoimage.com`. When passed this will override the html param and will generate a screenshot of the url. |
2525

26-
{% include hint.md title="Required params" text="For creating an image, either `url` or `html` are required. `css` is optional." %}
26+
{% include hint.md title="Required params" text="† Either `url` OR `html` is required, but not both. `css` is optional." %}
2727

2828
<hr>
2929

3030
### Additional parameters
3131

3232
Optional parameters for greater control over your image.
3333

34-
| Name | Type | Description |
35-
|:-------------|:------------------|:------|
36-
| **google_fonts** | `String` | [Google fonts](/guides/using-google-fonts/) to be loaded. Example: `Roboto`. Multiple fonts can be loaded like this: `Roboto|Open Sans` |
37-
| **selector** | `String` | A [CSS selector](/guides/selector/) for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg` |
38-
| **ms_delay** | `Integer` | The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time. [Learn more](/parameters/ms_delay/). |
39-
| **device_scale** | `Double` | This adjusts the pixel ratio for the screenshot. Minimum: `1`, Maximum: `3`. [Learn more](/parameters/device_scale/). |
40-
| **render_when_ready** | `Boolean` | Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](/parameters/render_when_ready/). |
41-
| **full_screen** | `Boolean` | When set to true, the API will generate an image of the entire height of the page. |
42-
| **viewport_width** | `Integer` | Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |
43-
| **viewport_height** | `Integer` | Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either. |
34+
{% include additional_parameters.md %}
4435

4536
<hr>
4637

0 commit comments

Comments
 (0)