Skip to content

Commit 1714c98

Browse files
authored
Merge pull request #911 from honzajavorek/honzajavorek/contributing
feat: improvements to the contributing guide
2 parents 8a5d1a7 + 4bfb837 commit 1714c98

File tree

2 files changed

+35
-33
lines changed

2 files changed

+35
-33
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,41 @@
22

33
## Architecture
44

5-
Apify documentation consists of six different repositories:
5+
Apify documentation consists of the following top-level areas:
66

7+
- **Academy** - Collection of mostly platform-independent courses on scraping techniques.
8+
- **Platform** - The main docs on how to use Apify as a product.
9+
- **API** - API reference and API client libraries docs, i.e. interacting with the platform from outside.
10+
- **SDK** - SDK libraries docs, i.e. interacting with the platform from code which runs inside it.
11+
- **CLI** - Tool for building code for the platform, and for interacting with the platform from outside.
12+
13+
Thus the source code of the docs is spread across six different repositories:
14+
15+
- apify-docs (this repository)
716
- apify-client-js
817
- apify-client-python
918
- apify-sdk-js
1019
- apify-sdk-python
1120
- apify-cli
12-
- apify-docs (this repository)
1321

14-
The main documentation content for Platform docs and Academy is inside the `./sources` directory. Every project repository then has its own Docusaurus instance and is available on a URL prefix (used as the `baseUrl` in Docusaurus) that's routed via nginx reverse proxy to the main domain. All those Docusaurus instances are deployed to GH pages on push.
15-
16-
We use a shared Docusaurus theme published to NPM as `@apify/docs-theme`, which is automatically synced in all the repositories via CI.
22+
The main documentation content for Platform docs and Academy is inside the `./sources` directory. Every project repository has its own [Docusaurus](https://docusaurus.io/) instance and is available on a URL prefix (used as the `baseUrl` in Docusaurus) that's routed via nginx reverse proxy to the main domain. All those Docusaurus instances are deployed to GH pages on push.
1723

1824
### Shared theme
1925

20-
The `@apify/docs-theme` is a Docusaurus theme package with custom components and styles to be used in all the Apify Docusaurus instances.
26+
We use a shared Docusaurus theme published to npm as `@apify/docs-theme`. It contains custom components and styles to be used in all the Apify Docusaurus instances.
2127
Aside from the regular Docusaurus theme interface, it also exports the common parts of the Docusaurus config, such as the navbar contents, URL, `og:image`, etc.
2228

23-
The theme is available on npm as `@apify/docs-theme` and can be installed in any Docusaurus instance by running `npm install @apify/docs-theme`.
29+
#### Theme synchronization
2430

25-
#### Publishing the theme
31+
The theme can be installed in any Docusaurus instance by running `npm install @apify/docs-theme`. It is automatically synced in all the existing repositories via CI.
2632

2733
A GitHub Action automatically publishes the theme to npm whenever any changes are pushed to the `master` branch. However, this only happens if you update the version in the `package.json` file manually - if the current version already exists on npm, the publish will be skipped.
2834

2935
Additionally, if there are any changes to the `apify-docs-theme` folder detected, the GitHub action will invoke docs builds in all the subprojects to make sure that all the pages are using the latest theme version. This is done in the `rebuild-docs` job. This job utilizes a matrix strategy to run the builds in parallel. The actual rebuild is initiated by the `workflow_dispatch` event in the respective repositories. Because of this, the `GITHUB_TOKEN` env var has to be replaced by the PAT token stored in the `GH_TOKEN` secret - the original token doesn't have the necessary permissions to trigger the workflows in other repositories.
3036

3137
### Redirects
3238

33-
[Here](./nginx.conf), you can find the production version of the Nginx configuration that handles the serving of content from all the different repositories. It also handles redirects from old URLs to new ones so that we don't lose any SEO juice.
39+
In [`./nginx.conf`](./nginx.conf) you can find the production version of the Nginx configuration that handles the serving of content from all the different repositories. It also handles redirects from old URLs to new ones so that we don't lose any SEO juice.
3440

3541

3642
### API reference
@@ -40,9 +46,8 @@ The `./sources/platform/api_v2` directory contains the source file for the API r
4046
#### Local testing
4147

4248
1. Install Apiary gem `gem install apiaryio`
43-
2. After that, you can:
44-
- Open the generated doc with the command: `apiary preview --path="./sources/platform/api_v2/api_v2_reference.apib"`
45-
- Log into [Apiary](https://apiary.io/) to get the document analyzed for warnings (there is no automatic linter)
49+
2. Open the generated doc with the command: `apiary preview --path="./sources/platform/api_v2/api_v2_reference.apib"`
50+
3. Log into [Apiary](https://apiary.io/) to get the document analyzed for warnings (there is no automatic linter)
4651

4752
#### Pre-release testing
4853

@@ -52,13 +57,11 @@ After updating the API docs, you should ALWAYS log into [Apiary](https://apiary.
5257

5358
The homepage menu card items are in the `docs/homepage_content.json` file. The cards aim to suit three types of use cases:
5459

55-
- Beginners and people who just want to use the Actors (**Get started**, **Use Actors and scrapers**).
56-
57-
- Experienced Actor and platform users (**Reduce blocking**, **Use platform features**).
58-
59-
- Actor builders and advanced users (**Build Actors**, **Advanced tutorials and debugging**).
60+
- **Get started**, **Use Actors and scrapers** - Beginners and people who just want to use the Actors.
61+
- **Reduce blocking**, **Use platform features** - Experienced Actor and platform users.
62+
- **Build Actors**, **Advanced tutorials and debugging** - Actor builders and advanced users.
6063

61-
Each item has its own JSON object, in which "cardItem" is the title and "href" is the link. If the link leads to outside the Apify Docs site, add the `"isExternalLink": true` property. For local links, just use the article's path. E.g. `"/tutorials/apify-scrapers/web-scraper"`.
64+
Each item has its own JSON object, in which `cardItem` is the title and `href` is the link. If the link leads to outside the Apify Docs site, add the `"isExternalLink": true` property. For local links, just use the article's path. E.g. `"/tutorials/apify-scrapers/web-scraper"`.
6265

6366
In the title (`cardItem`), don't just give the article's name. Phrase the title in a way that answers a question or fulfills a goal the user might have.
6467

@@ -130,7 +133,7 @@ And add a record to `/etc/hosts` to map the `docs.apify.loc` hostname to localho
130133

131134
## Linting
132135

133-
### Markdownlint
136+
### Markdown and code
134137

135138
The **apify-docs** repo contains both Markdown and JavaScript/TypeScript files. We have two commands for linting them:
136139

@@ -141,13 +144,13 @@ For Markdown, we use the [markdownlint](https://github.com/DavidAnson/markdownli
141144

142145
For JavaScript, we use the [ESLint Markdown plugin](https://github.com/eslint/eslint-plugin-markdown).
143146

144-
### Vale
147+
### Prose
145148

146-
Apart from `markdownlint` we also utilize Vale as linting solution for prose. You can either use Vale as a CLI tool (for more information how to set it up go [here](https://vale.sh/docs/vale-cli/installation/)) or you can use Vale with a VSCode [extension](https://marketplace.visualstudio.com/items?itemName=ChrisChinchilla.vale-vscode). The rulesets that Vale will utilize while linting can be found within `.github/styles` directory.
149+
Apart from `markdownlint` we also utilize [Vale](https://github.com/errata-ai/vale) as linting solution for prose. You can either use Vale as a CLI tool (for more information how to set it up go [here](https://vale.sh/docs/vale-cli/installation/)) or you can use Vale with a VSCode [extension](https://marketplace.visualstudio.com/items?itemName=ChrisChinchilla.vale-vscode). The rulesets that Vale will utilize while linting can be found within `.github/styles` directory.
147150

148151
#### Exceptions for Vale
149152

150-
If Vale catches some specific words that you feel that should not be subjected to linting you can add them to the `accept.txt` found within the `.github/styles/Vocab/Docs` directory. For more information hw it works visit Vale [docs](https://vale.sh/docs/topics/vocab/).
153+
If Vale catches some specific words that you feel that should not be subjected to linting you can add them to the `accept.txt` found within the `.github/styles/Vocab/Docs` directory. For more information how it works visit Vale [docs](https://vale.sh/docs/topics/vocab/).
151154

152155
## Pull requests
153156

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This repository is the home of Apify's documentation, which you can find at [doc
1111
> [!IMPORTANT]
1212
> Before you contribute to Apify documentation with your first pull request, please read the following 2 articles:
1313
>
14-
> - [Contributing guidelines](CONTRIBUTING.md), where you learn about the project structure, local development, testing, and setting up the [redirects](./CONTRIBUTING.md#redirects) to make sure we keep our SEO juice 🍊.
14+
> - [Contributing guidelines](CONTRIBUTING.md), where you learn about the project structure, local development, testing, and setting up redirects.
1515
> - [Style guide](#style-guide), here below 👇, where you learn how to keep the documentation style consistent.
1616
1717
## Style guide
@@ -41,20 +41,19 @@ Instead, try to be more descriptive, for example:
4141
- For consistency, use **bold** to highlight UI text when dealing with UI-focused documentation (for example, Apify Console).
4242
- For consistency, use _italics_ to emphasize text.
4343
- For inline `code` examples, use **back-ticks** (\` \`).
44-
- For multi-line code examples, use code fences and specify the language. Preferably, specify the title as well.
45-
- Within platform documentation, always use [Code tabs](README.md#code-tabs) and declare the language.
44+
- For multi-line code examples, use code fences and specify the language. Preferably, specify the title as well. Within platform documentation, always use [Code tabs](README.md#code-tabs) and declare the language.
4645

47-
```markdown
48-
\`\`\`js showLineNumbers title='foo.js'
46+
``````markdown
47+
```js showLineNumbers title='foo.js'
4948

50-
const docsAreCool = require('coolDocs'); <br/>
51-
...<br/>
52-
return docsAreCool;<br/>
49+
const docsAreCool = require('coolDocs'); <br/>
50+
...<br/>
51+
return docsAreCool;<br/>
5352

54-
\`\`\`
55-
```
53+
```
54+
``````
5655

57-
Check out [Markdown features](https://docusaurus.io/docs/markdown-features) in the Docusaurus docs for more information.
56+
Check out [Markdown features](https://docusaurus.io/docs/markdown-features) in the Docusaurus docs for more information.
5857

5958
### Admonitions
6059

0 commit comments

Comments
 (0)