Skip to content

Commit ff08402

Browse files
committed
update why
1 parent 840f163 commit ff08402

13 files changed

+244
-16
lines changed

apps/docs/api-reference/generate-document.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ title: 'Generate Document'
33
openapi: 'POST /api/documents/{documentId}'
44
---
55

6-
This endpoint is for generating a document based on a template you've published to a team. To publish a document, see the [publish command](/cli#htmldocs-publish-file).
6+
This endpoint is for generating a document based on a template you've published to a team. To publish a document, see the [publish command](a/cli#htmldocs-publish-file).
77

88
You can find the ids of your published documents in the [dashboard](https://htmldocs.com/dashboard).

apps/docs/api-reference/generate-html.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ openapi: 'POST /api/generate'
55

66
This endpoint allows you to generate a PDF document directly from HTML content, without needing to publish a template first.
77

8-
For generating documents from published templates, see the [Generate Document](/api-reference/generate-document) endpoint instead.
8+
For generating documents from published templates, see the [Generate Document](/api/generate-document) endpoint instead.

apps/docs/api-reference/openapi.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@
271271
"bearerAuth": {
272272
"type": "http",
273273
"scheme": "bearer",
274-
"description": "API key or authentication token"
274+
"bearerFormat": "API-Key",
275+
"description": "API key for authentication. Use format: Bearer <api-key>"
275276
}
276277
}
277278
}

apps/docs/introduction.mdx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,41 @@
22
title: htmldocs
33
sidebarTitle: Introduction
44
icon: "hand-wave"
5-
description: 'Build and generate PDF documents with React and TypeScript'
65
---
76

8-
## Why
7+
htmldocs is a modern typesetting toolkit that lets you build document templates using React and JSX - the same way you build web applications. Create reusable components, use props for dynamic content, and leverage the entire JavaScript ecosystem:
98

10-
It's 2025 and the process of creating and generating PDF documents is still stuck in the past. Whether you're still manually editing documents in Word, trying to wrangle LaTeX to fit your use-case, or frustrated with outdated tools like `wkhtmltopdf`, it's about time we re-thought how we build documents with modern web technologies.
9+
```jsx
10+
function Invoice({ customer, items, total }) {
11+
return (
12+
<Document size="A4" orientation="portrait" margin="0.75in">
13+
<Footer position="bottom-center">
14+
Page {currentPage}
15+
</Footer>
16+
17+
<Page style={{ padding: '1rem' }}>
18+
<h1>Invoice for {customer.name}</h1>
19+
{items.map(item => (
20+
<LineItem {...item} />
21+
))}
22+
<Total amount={total} />
23+
</Page>
24+
</Document>
25+
);
26+
}
27+
```
28+
29+
With htmldocs, you can:
30+
31+
- Build document templates using **React components** and **JSX syntax**
32+
- Use your favorite JavaScript libraries - from date formatting to charting
33+
- Style documents with modern CSS and frameworks like **Tailwind**
34+
- Generate professional-quality PDFs at scale with precise typesetting
35+
- Preview changes in real-time with hot-reloading as you develop
36+
- Share components and styles across your documents for consistent branding
37+
- Version control your templates just like you do with code
38+
39+
Whether you're still manually editing documents in Word, trying to wrangle LaTeX to fit your use-case, or frustrated with outdated tools like `wkhtmltopdf`, htmldocs provides a developer-friendly solution that brings document generation into the modern era.
1140

1241
<CardGroup cols={2}>
1342
<Card

apps/docs/mint.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
]
5656
},
5757
{
58-
"group": "Guides",
58+
"group": "Usage",
5959
"pages": [
60-
"guides/static-content",
61-
"guides/template-variables",
62-
"guides/publishing-to-the-cloud"
60+
"usage/static-content",
61+
"usage/template-variables",
62+
"usage/publishing-to-the-cloud"
6363
]
6464
},
6565
{

apps/docs/quickstart.mdx

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: 'Quickstart'
3+
description: 'Start building awesome documentation in under 5 minutes'
4+
---
5+
6+
## Setup your development
7+
8+
Learn how to update your docs locally and deploy them to the public.
9+
10+
### Edit and preview
11+
12+
<AccordionGroup>
13+
<Accordion icon="github" title="Clone your docs locally">
14+
During the onboarding process, we created a repository on your Github with
15+
your docs content. You can find this repository on our
16+
[dashboard](https://dashboard.mintlify.com). To clone the repository
17+
locally, follow these
18+
[instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)
19+
in your terminal.
20+
</Accordion>
21+
<Accordion icon="rectangle-terminal" title="Preview changes">
22+
Previewing helps you make sure your changes look as intended. We built a
23+
command line interface to render these changes locally. 1. Install the
24+
[Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the
25+
documentation changes locally with this command: ``` npm i -g mintlify ```
26+
2. Run the following command at the root of your documentation (where
27+
`mint.json` is): ``` mintlify dev ```
28+
</Accordion>
29+
</AccordionGroup>
30+
31+
### Deploy your changes
32+
33+
<AccordionGroup>
34+
35+
<Accordion icon="message-bot" title="Install our Github app">
36+
Our Github app automatically deploys your changes to your docs site, so you
37+
don't need to manage deployments yourself. You can find the link to install on
38+
your [dashboard](https://dashboard.mintlify.com). Once the bot has been
39+
successfully installed, there should be a check mark next to the commit hash
40+
of the repo.
41+
</Accordion>
42+
<Accordion icon="rocket" title="Push your changes">
43+
[Commit and push your changes to
44+
Git](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository#about-git-push)
45+
for your changes to update in your docs site. If you push and don't see that
46+
the Github app successfully deployed your changes, you can also manually
47+
update your docs through our [dashboard](https://dashboard.mintlify.com).
48+
</Accordion>
49+
50+
</AccordionGroup>
51+
52+
## Update your docs
53+
54+
Add content directly in your files with MDX syntax and React components. You can use any of our components, or even build your own.
55+
56+
<CardGroup>
57+
58+
<Card title="Style Your Docs" icon="paintbrush" href="/settings/global">
59+
Add flair to your docs with personalized branding.
60+
</Card>
61+
62+
<Card
63+
title="Add API Endpoints"
64+
icon="square-code"
65+
href="/api-playground/configuration"
66+
>
67+
Implement your OpenAPI spec and enable API user interaction.
68+
</Card>
69+
70+
<Card
71+
title="Integrate Analytics"
72+
icon="chart-mixed"
73+
href="/analytics/supported-integrations"
74+
>
75+
Draw insights from user interactions with your documentation.
76+
</Card>
77+
78+
<Card
79+
title="Host on a Custom Domain"
80+
icon="browser"
81+
href="/settings/custom-domain/subdomain"
82+
>
83+
Keep your docs on your own website's subdomain.
84+
</Card>
85+
86+
</CardGroup>

apps/docs/guides/static-content.mdx renamed to apps/docs/usage/static-content.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Inside HTML/React components, static files are served directly from the `/static
1515
## Server-Side Usage
1616
When reading files server-side (like in document templates), use `process.env.DOCUMENTS_STATIC_PATH` to access files in your static directory:
1717

18+
<Warning>
19+
Server-side files only work in local development and are not supported yet using the API. <br />
20+
If you'd like to see this feature, please leave a comment on the <b>#feature-requests</b> channel in Slack.
21+
</Warning>
22+
1823
```tsx
1924
import fs from 'node:fs'
2025
import path from 'path'

packages/htmldocs/build-preview-server.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import fs from 'node:fs';
33

44
const nextBuildProcess = spawn('next', ['build'], {
55
detached: true,
6-
stdio: "inherit"
6+
stdio: "inherit",
7+
env: { ...process.env }
78
});
89

910
process.on('SIGINT', () => {

0 commit comments

Comments
 (0)