Skip to content

Commit 059ac24

Browse files
committed
further additions to README & CONTRIBUTING
1 parent c1ccad5 commit 059ac24

File tree

2 files changed

+114
-20
lines changed

2 files changed

+114
-20
lines changed

CONTRIBUTING.md

Lines changed: 98 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,64 @@
2626
3. Run `npm install`
2727
4. Start development server: `npm start`
2828

29+
This will be enough to work on Platform, Academy and, OpenAPI. If you want to work on entire documentation set you need to join them using Nginx.
30+
31+
#### Join all repositories with Nginx
32+
33+
1. Clone all the repositories
34+
2. Run `npm start:dev` instead of `npm start` from the main repository
35+
3. Run `npm start -- --port <number>` to start docusaurus instance on specific port, refer to the table for each repo port
36+
37+
|Repository|Port|
38+
|:---|:---|
39+
|apify-docs|3000|
40+
|apify-client-js|3001|
41+
|apify-client-python|3002|
42+
|apify-sdk-js|3003|
43+
|apify-sdk-python|3004|
44+
|apify-cli|3005|
45+
46+
4. To serve them together, setup the Nginx server with the following config
47+
48+
```nginx
49+
server {
50+
listen 80;
51+
server_name docs.apify.loc;
52+
location / {
53+
proxy_pass http://localhost:3000;
54+
}
55+
location /api/client/js {
56+
proxy_pass http://localhost:3001;
57+
}
58+
location /api/client/python {
59+
proxy_pass http://localhost:3002;
60+
}
61+
location /sdk/js {
62+
proxy_pass http://localhost:3003;
63+
}
64+
location /sdk/python {
65+
proxy_pass http://localhost:3004;
66+
}
67+
location /cli {
68+
proxy_pass http://localhost:3005;
69+
}
70+
}
71+
```
72+
73+
5. Add a record to `/etc/hosts`, which maps the `docs.apify.loc` to a localhost:
74+
75+
```text
76+
127.0.01 docs.apify.loc
77+
```
78+
79+
You should be able to open https://docs.apify.loc in your browser and run all the repositories jointly as one project.
2980
## Style guide
3081

3182
### Language guidelines
3283

3384
- Use US English
3485
- Write in inclusive language
35-
- Avoid directional language (like "left" or "right")
86+
- Avoid directional language (like "left" or "right" or instead of "see" use "check out")
3687
- Use active voice whenever possible
3788

3889
### Formatting conventions
@@ -41,12 +92,13 @@
4192

4293
- use *Bold* for UI elements
4394
- use **Italics** for emphasis
44-
- use `code` for inline code
95+
- use `code` for inline code, by using back-ticks (\`\`\)
4596
- use code blocks with language specification
97+
- usd [code tabs](https://docusaurus.io/docs/markdown-features/tabs) whenever you want to include examples of implementation in more than one language
4698

4799
2. Documentation elements:
48100

49-
- Use admonitions
101+
- Use [admonitions](https://docusaurus.io/docs/2.x/markdown-features/admonitions) to emphasize cruciac information, available admonitions are:
50102
- note
51103
- tip
52104
- info
@@ -55,15 +107,25 @@
55107
- Implement code tabs for multiple languages
56108
- Include proper metadata in front matter
57109

110+
Example of proper usage and formatting:
111+
112+
```text
113+
:::note Your Title Here
114+
115+
Your important message here.
116+
117+
:::
118+
```
119+
58120
3. Screenshots:
59121

60122
- Use light theme when taking screenshots
61123
- Include meaningful alt texts
62124
- Use red indicators
63125

64-
### Metadata best practices
126+
### Front matter metadata best practices
65127

66-
- Keep descriptions between 140-160 characters
128+
- Keep descriptions between 140 and 160 characters
67129
- Avoid repetitive keywords
68130
- Use action-oriented phrasing
69131
- Exclude the word "documentation" in descriptions
@@ -110,7 +172,7 @@ The API reference documentation at docs.apify.com is built directly froum our Op
110172
1. Navigate to `apify-api/openapi/components/schemas`
111173
2. Create a new file named after your schema
112174
3. Define the schema structure
113-
4. Reference schea using `$ref` in other files
175+
4. Reference schema using `$ref` in other files
114176

115177
Example schema
116178

@@ -127,11 +189,11 @@ properties:
127189
#### Path documentation
128190

129191
1. Navigate to `apify-api/openapi/paths`
130-
2. Create YAML file following the URL structure
192+
2. Create YAML file following the URL structure replacing `/` with `@`
131193
3. Place path parameters in curly braces (e.g., {queueId})
132194
4. Add path reference to openapi.yaml
133195

134-
Example path structure:
196+
Example addition to `openapi.yaml` file:
135197

136198
```yaml
137199
'/requests-queues':
@@ -140,6 +202,26 @@ Example path structure:
140202
$ref: './paths/request-queues/request-queues@{queueId}.yaml'
141203
```
142204

205+
Example YAML file `request-queues@{queueId}.yaml` in the `paths/request-queues` folder :
206+
207+
```yaml
208+
get:
209+
tags:
210+
- Request Queues
211+
summary: Get a Request Queue
212+
operationId: requestQueues_get
213+
description: |
214+
You can have a markdown description here.
215+
parameters:
216+
responses:
217+
'200':
218+
'401':
219+
x-code-samples:
220+
- lang: PHP
221+
source:
222+
$ref: ../code_samples/PHP/customers/get.php
223+
```
224+
143225
#### Operation ID conventions
144226

145227
Operation IDs must follow this format:
@@ -156,6 +238,14 @@ Examples:
156238
- `/requests-queues/{queueId}` PUT -> `requestQueue_put`
157239
- `/acts/{actorId}/runs` POST -> `act_runs_post`
158240

241+
#### Code samples
242+
243+
1. Navigate to the `openapi/code_samples` folder
244+
2. Navigate to the `<language>` sub-folder
245+
3. Navigate to the `path` folder, and add ref to the code sample
246+
247+
Add languages by adding new folders at the appropriate path level.
248+
159249
#### Submitting changes
160250

161251
1. Make your changes following the guidelines above

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
## Overview
66

7-
This repository is the home of Apify's documentation, available at [docs.apify.com](https://docs.apify.com/). The documentation uses [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
7+
This repository is the home of Apify's documentation, available at [docs.apify.com](https://docs.apify.com/). The documentation uses [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) & [Docusaurus](https://docusaurus.io/).
88

9-
### Documentation structure
9+
## Documentation structure
10+
11+
Our documentation ecosystem consists of:
1012

1113
- **Platform documentation**: Located in the [/sources](https://github.com/apify/apify-docs/tree/master/sources) directory
14+
- **Academy**: Platform-independent courses on scraping technique. Located in the [/sources](https://github.com/apify/apify-docs/tree/master/sources) directory
1215
- **API documentation**:
1316
- **OpenAPI documentation**: [OpenAPI reference](https://docs.apify.com/api/v2)
1417
- [JavaScript/Node.js](https://docs.apify.com/api/client/js/)
@@ -29,11 +32,11 @@ Before contributing, read these essential resources:
2932

3033
Our documentation consists of these main sections:
3134

32-
1. **Academy**: Platform-independent courses on scraping techniques
33-
2. **Platform**: Main documentation for using Apify as a product
34-
3. **API**: API reference and client libraries documentation
35-
4. **SDK**: SDK libraries documentation
36-
5. **CLI**: Documentation for building code and platform interaction
35+
1. **Academy**: Collection of mostly platform-independent courses on scraping techniques.
36+
2. **Platform**: Main documentation for using Apify as a product.
37+
3. **API**: API reference and client libraries documentation.
38+
4. **SDK**: SDK libraries documentation.
39+
5. **CLI**: Documentation for building code and platform interaction.
3740

3841
### Source Repositories
3942

@@ -44,13 +47,14 @@ Our documentation consists of these main sections:
4447
- apify-sdk-python
4548
- apify-cli
4649

47-
### Homepage structure
50+
## Architecture
4851

49-
The homepage menu cards (in `docs/homepage_content.json`) serve three user categories:
52+
Our documentation is built using:
5053

51-
1. **Beginners**: Get started, Use Actors and scrapers
52-
2. **Experienced Users**: Reduce blocking, Use platform features
53-
3. **Advanced Users**: Build Actors, Advanced tutorials and debugging
54+
- **Docusaurus**: Powers our documentation platform
55+
- **Shared Theme**: Custom `@apify/docs-theme` package
56+
- **Automated Deployment**: CI/CD pipeline for continuous updates
57+
- **Nginx routing**: Handles subdomain routing and redirects
5458

5559
## Need help
5660

0 commit comments

Comments
 (0)