Skip to content

Commit d9fbd32

Browse files
author
Ondrej Machala
committed
docs: streamline README with framework examples
1 parent 55730ba commit d9fbd32

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,52 @@ The manual fix is tedious: open browser, navigate, log in, screenshot, crop, sav
4949
npx heroshot
5050
```
5151

52-
That's it. First time, a browser opens with a visual picker. Navigate to your app, click on elements you want to capture, name them, close when done.
52+
First run opens a browser with a visual picker. Click what you want, name it, done. Screenshots land in `heroshots/`, config saves to `.heroshot/config.json`. Next run regenerates everything headlessly.
5353

54-
Your screenshots land in `heroshots/` and a config is saved to `.heroshot/config.json`.
54+
## Use in Your Docs
5555

56-
Next time you run `npx heroshot`, it regenerates everything headlessly. No browser, no clicking - just fresh screenshots.
56+
**VitePress**
5757

58-
## What Makes It Useful
58+
```ts
59+
// .vitepress/config.ts
60+
import { heroshot } from 'heroshot/plugins/vite';
61+
export default defineConfig({ vite: { plugins: [heroshot()] } });
62+
```
5963

60-
**Point and click, not CSS selectors.** The visual picker figures out how to find elements. You just click what you want.
64+
```vue
65+
<Heroshot name="dashboard" alt="Dashboard" />
66+
```
6167

62-
**Light and dark mode in one go.** If your site has themes, heroshot captures both variants automatically. One config, two screenshots.
68+
**Docusaurus**
6369

64-
**Desktop, tablet, mobile from one definition.** Add `"viewports": ["desktop", "tablet", "mobile"]` and get all three sizes. Combined with both color schemes, that's 6 screenshots from one entry.
70+
```js
71+
// docusaurus.config.js
72+
plugins: [['heroshot/plugins/docusaurus', {}]];
73+
```
6574

66-
**Log in once, capture forever.** First time, log into your app manually. Heroshot encrypts and saves your session. Headless runs are already authenticated - no login scripts needed.
75+
```mdx
76+
import { Heroshot } from 'heroshot/docusaurus';
77+
<Heroshot name="dashboard" alt="Dashboard" />
78+
```
79+
80+
**MkDocs**
81+
82+
```bash
83+
pip install heroshot
84+
```
85+
86+
```yaml
87+
# mkdocs.yml
88+
plugins:
89+
- macros:
90+
modules: [heroshot]
91+
```
92+
93+
```jinja
94+
{{ heroshot("dashboard", "Dashboard overview") }}
95+
```
6796

68-
**CI-ready.** Export your session key, add it to GitHub secrets, run `heroshot` in a workflow. Screenshots update automatically.
97+
One component/macro, all variants - light/dark mode switches automatically, responsive sizes via srcset.
6998

7099
## Automated Updates
71100

0 commit comments

Comments
 (0)