Skip to content

Commit 906cb1d

Browse files
committed
update repo to styled components
1 parent 633a1d8 commit 906cb1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+22252
-31499
lines changed

CONTRIBUTING.md

+135-23
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22

33
When contributing to this repository, please first discuss the change you wish to make at [Issues](https://github.com/postmanlabs/postman-docs/issues).
44

5-
Please note we have a [code of conduct](https://www.postman.com/code-of-conduct), please follow it in all your interactions with the project.
5+
We have a [code of conduct](https://www.postman.com/code-of-conduct) that you're expected to follow in all your interactions with the project.
66

7-
## Development Process
7+
## Development process
88

99
### Prerequisites
1010

11-
This site was built with Node.js v14.17.1. We recommend installing and using [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js. After you install nvm, use it to set your node version to v14.17.1.
11+
This site is built with Node.js v14.17.1. We recommend installing and using [nvm](https://github.com/nvm-sh/nvm), a version manager for Node.js. After you install nvm, use it to set your node version to v14.17.1.
1212

13-
**Note for Mac users**: If you are using a Mac with an Apple M1 chip, you may need to create a Rosetta version of Terminal in order to correctly download both nvm and the dependencies needed by this GitHub repo. For more information, see this guide on [creating a Rosetta terminal](https://www.courier.com/blog/tips-and-tricks-to-setup-your-apple-m1-for-development). After you create a Rosetta terminal, use it to install nvm, then proceed with the rest of the workflow outlined here.
13+
**Note for Mac users**: If you are using a Mac with an Apple M1 chip, you may need to create a Rosetta version of Terminal to download nvm and the dependencies needed by this GitHub repo. For more information, see this guide on [creating a Rosetta terminal](https://www.courier.com/blog/tips-and-tricks-to-setup-your-apple-m1-for-development). After you create a Rosetta terminal, use it to install nvm, then proceed with the rest of the workflow outlined here.
1414

15-
### Troubleshooting Local Development
15+
### Troubleshooting local development
1616

1717
If you run into issues when running the Learning Center locally, try the following:
1818

19-
1. Check the Node.js version (`node -v`) to ensure you are now using `v14.17.1`. If not, enter `nvm use v14.17.1`.
19+
1. Check the Node.js version (`node -v`) to ensure you are using `v14.17.1`. If not, enter `nvm use v14.17.1`.
2020
1. Enter `rm -rf node_modules; npm i` to remove all existing packages and perform a fresh install.
2121
1. Enter `gatsby clean` to clear the cache.
2222

23-
We have found this to clear the bulk of local development issues. If you still have issues running the Learning Center locally, feel free to [open an issue](https://github.com/postmanlabs/postman-docs/issues).
23+
If you still have issues running the Learning Center locally, feel free to [open an issue](https://github.com/postmanlabs/postman-docs/issues).
2424

2525
### Workflow
2626

2727
We follow [Git Flow](https://guides.github.com/introduction/flow/) for changes to this repository. If you're not familiar with using git and GitHub on the command line, [GitHub Desktop](https://desktop.github.com) is an easier alternative.
2828

2929
1. Fork this repo to create a copy hosted on your GitHub account. The Fork button is in the top right of the page.
30-
* If you're a collaborator on the repo you can instead just create a branch.
30+
* If you're a collaborator on the repo you can instead create a branch.
3131
1. Clone down your copy of this repo onto your local machine: `git clone <YOUR GITHUB REPO URL>`
3232
1. Navigate to the new directory git created: `cd postman-docs`
3333
1. Check out the `develop` branch: `git checkout develop`
3434
1. Run `npm install` to add all dependencies.
3535
1. Create a new branch for your work based on develop: `git checkout -b <YOUR BRANCH NAME>` Your branch name should be something descriptive of the changes you wish to make, and can include the issue number this change is associated with. Example: `feature/1234-update-mock-api-docs`
3636
1. Make your changes. The Learning Center's documentation is built from the `.md` files in the `/src/pages/docs` folder of the repo.
37-
1. Check your files against our markdown guidelines by running `npm run test:mdlint` and resolve any errors.
37+
1. Check your files are valid markdown by running `npm run test:mdlint` and resolve any errors.
3838
1. When you're ready to apply your changes, push your changed files to your forked repo:
3939
* `git add <FILENAMES OF CHANGED FILES>`
4040
* `git commit -m "<YOUR COMMIT MESSAGE>"` Your commit message should be descriptive of the changes you made.
@@ -55,21 +55,21 @@ Your pull request will be reviewed and we'll get back to you!
5555

5656
When your PR is opened it will run GitHub Actions which will lint the markdown files to ensure that they follow our [guidelines](https://github.com/DavidAnson/vscode-markdownlint).
5757

58-
Upon approval your PR will be merged into develop for further verification and then merged into master upon final approval. Please delete your branch once it's been merged to develop to help maintain a clean repository.
58+
Upon approval your PR will be merged into develop for further verification and then merged into production upon final approval. Please delete your branch once it's been merged to develop to help keep a clean repository.
5959

6060
[homepage]: https://learning.postman.com
6161

6262
> __Staff and Repo Collaborators__: Please only push to `develop` when changes are ready to publish. The `develop` branch is intended only as a last check to see edits live on the web in a production type build environment before publishing—changes shouldn't sit on the `develop` branch for long before pushing to `master`.
6363
6464
## Adding/Editing Links
6565

66-
If you would like to add, edit, or replace links you are welcome to do so. There are two types of links in the docs, and formatting them correctly is important to help reduce 3xx redirects and broken links:
66+
If you would like to add, edit, or replace links you are welcome to do so. There are two types of links in the docs, and using a correct format is important to help reduce 3xx redirects and broken links.
6767

6868
### Internal links to docs
6969

7070
When creating or editing an internal link (a link that points to a Learning Center doc), be sure to:
7171

72-
* use a relative URL. Example: `/docs/collaborating-in-postman/collaboration-intro/`
72+
* use a relative URL. Example: `/docs/collaborating-in-postman/working-with-your-team/collaboration-overview/`
7373
* use a trailing slash to keep our app from creating unnecessary 302 redirects. (See example of trailing slash above.)
7474
* use a leading slash to keep the doc page from 404'ing. (See example of leading slash above.)
7575
* `npm run dev` the app and check links you have added / edited to ensure they work correctly.
@@ -83,7 +83,7 @@ When creating or editing an external link (a link that points to sources outside
8383
* Strip off any UTM parameters or unnecessary query strings or tracking at the end of URLs. Example: `?utm_source=blog&utm_medium=internal&utm_campaign=exampleCampaign`
8484
* As a best practice for accessibility, add titles to external links to help the visitor understand the purpose of the link and why they will be taken away from the Learning Center. Example: `[Postman API Platform](https://www.postman.com/api-platform/ "Visit the Postman website to learn more about the Postman API Platform")`
8585

86-
## Adding/Editing Images
86+
## Adding and editing images
8787

8888
If you would like to add, edit, or replace images you are welcome to do so. There are two ways in which you can achieve this:
8989

@@ -98,12 +98,12 @@ Images hosted by Postman should always be referenced as follows:
9898
https://assets.postman.com/postman-docs/<filename>.png
9999
```
100100

101-
## Adding/Editing Code Blocks
101+
## Adding and editing code blocks
102102

103103
If you would like to add, edit or replace Markdown code blocks you are welcome to do so. There are two things in which you need to know:
104104

105-
* We use Prism.js via a Gatsby plugin [gatsby-remark-prismjs](https://www.gatsbyjs.com/plugins/gatsby-remark-prismjs/#usage-in-markdown "See usage in markdown documentation")
106-
* Immediately following the opening 3 backticks ` ``` ` should be the language declaration. See the following example:
105+
* We use Prism.js in a Gatsby plugin [gatsby-remark-prismjs](https://www.gatsbyjs.com/plugins/gatsby-remark-prismjs/#usage-in-markdown "See usage in markdown documentation")
106+
* Add a language declaration after the opening three backticks ` ``` ` For example:
107107

108108
```markdown
109109
```json
@@ -129,16 +129,16 @@ For a list of supported languages by the Prism syntax highlighter, [read more](h
129129

130130
Please note that Algolia search won't work when running the app locally. If you wish to search when running the app locally, you are welcome to use your own Algolia API keys and index the app in your own Algolia account. You can find an `env.example` file in the repo that shows you what keys you require to run Algolia search.
131131

132-
## Right Sidebar - Recent Blog Posts
132+
## Right sidebar - recent blog posts
133133

134-
The right sidebar has a feature flag for pulling in up to three contextual, recent blog posts based on a tag. This functionality and flag can be found in the frontmatter of the doc `.md` files. It utilizes our webhook and backend-for-frontend (BFF) service to source the latest 100 blog posts from blog.postman.com.
134+
The right sidebar has a feature flag for pulling in up to three contextual, recent blog posts based on a tag. This functionality and flag can be found in the front matter of the doc `.md` files. It utilizes our webhook and backend-for-frontend (BFF) service to source the latest 100 blog posts from blog.postman.com.
135135

136136
Two example docs using `dynamic_blog`:
137137

138-
* /docs/running-collections/intro-to-collection-runs.md
139-
* /docs/running-collections/scheduling-collection-runs.md
138+
* `/docs/running-collections/intro-to-collection-runs.md`
139+
* `/docs/running-collections/scheduling-collection-runs.md`
140140

141-
### To Use the Dynamic Blog Posts Feature
141+
### Using the dynamic blog posts feature
142142

143143
#### For internal Postman contributors
144144

@@ -147,13 +147,125 @@ You need to get the `.env.development` file from Marketing Engineering, and plac
147147
* If you don't have this file or are an external contributor, the app will still build, but the Recent Blogs section in right sidebar will be hidden / blank (this is expected behavior).
148148
* The `.env.development` file is for internal use only.
149149

150-
## Run checks locally
150+
#### Updating from hard-coded blog links to dynamic
151+
152+
Open the doc file `.md` that you want to edit right sidebar, and look for `contextual_links` in front matter. Look for the presence of existing recent Blogs posts like:
153+
154+
~~~~
155+
- type: subtitle
156+
name: "Blog Posts"
157+
- type: link
158+
name: "Check for broken links on your website using a Postman Collection"
159+
url: "https://blog.postman.com/check-for-broken-links-on-your-website-using-a-postman-collection/"
160+
~~~~
161+
162+
Replace with:
163+
164+
~~~~
165+
- type: dynamic_blog
166+
name: "Blog Posts"
167+
blog_tag: "PUT_TAG_NAME_HERE"
168+
~~~~
169+
170+
NOTE: `type: link` and `type: url` are being replaced with `blog_tag: “PUT_TAG_NAME_HERE”`
171+
172+
#### Adding new dynamic links
173+
174+
Open doc file that you want edit right sidebar, and add:
175+
176+
~~~~
177+
- type: dynamic_blog
178+
name: "Blog Posts"
179+
blog_tag: "PUT_TAG_NAME_HERE"
180+
~~~~
181+
182+
### blog_tag is an enum
183+
184+
The list of acceptable values for `blog_tag` are the slugs for tags in the blog. The `blog_tag` value is a string and only accepts one tag. To yield contextual posts for your doc page, use one of the following machine-readable blog tags in use today:
185+
186+
* `api-development`
187+
* `api-network`
188+
* `automation`
189+
* `aws`
190+
* `case-study`
191+
* `collections`
192+
* `continuous-delivery`
193+
* `data`
194+
* `developers`
195+
* `documentation`
196+
* `enterprise-plan`
197+
* `graphql`
198+
* `integrations`
199+
* `monitors`
200+
* `newman`
201+
* `news`
202+
* `openapi`
203+
* `postman`
204+
* `postman-community`
205+
* `public-workspaces`
206+
* `rest-api`
207+
* `security`
208+
* `state-of-the-api`
209+
* `testing`
210+
* `tutorials`
211+
* `visualizer`
212+
* `workflow`
213+
* `workspaces`
214+
215+
NOTE: these tags pull from the latest 100 blog posts. We display **up to 3** blog posts for that tag. A return of zero or malformed tag enum will collapse / hide section.
216+
217+
## Running checks locally
151218

152219
Before creating a PR we STRONGLY recommend to running the following test locally to check that all changes will pass our linters:
153220

154221
* `npm run test` -> runs the Unit testing
155-
* `npm run test:mdlint` -> runs the Markdownlinter
222+
* `npm run test:mdlint` -> runs the Markdown linter
156223
* `npm run test:lint` -> runs the ESlinter
157224
* `npm run test:url` -> checks if acceptable image URL has been added
158225
* `npm run test:update` -> updates the test snapshots
159226
* `npm run dev` -> runs a server on http://localhost:8000/ so you can view changes locally
227+
228+
## Checking style with Vale
229+
230+
[Vale](https://vale.sh) is an open-source, command-line linter for prose. When run, it works like a code linter, generating a list of warnings for writing issues in content. But instead of static code analysis, Vale checks the prose within documents against predefined style guides. There are several predefined style guides, or you can also develop your own. Postman uses two predefined style guides (Microsoft and write-now), plus there are several of our rules and a configuration file included in this repo.
231+
232+
To use Vale, you must install it. Then you can run Vale to check your work for style errors.
233+
234+
### Installing Vale
235+
236+
1. Install brew:
237+
238+
```
239+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
240+
```
241+
242+
(See [https://brew.sh/](https://brew.sh/) for more info)
243+
244+
1. Install the app (macOS):
245+
246+
```
247+
brew install vale
248+
```
249+
250+
1. Download the third-party styles. Run this in the root of your `postman-docs` repo:
251+
252+
```
253+
build/pm-get-vale-styles
254+
```
255+
256+
1. Run `vale ls-config` to make sure everything works. It will output your config as a JSON, or an error.
257+
258+
### Running Vale
259+
260+
To run Vale on all files in the repo:
261+
262+
```
263+
vale .
264+
```
265+
266+
You can also run on one file, or one directory:
267+
268+
```
269+
vale src/pages/docs/developer/runtime-library.md
270+
vale src/pages/docs/developer
271+
```

DOCS_STYLE_GUIDE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ For more advanced topics, if someone doesn't have the required skills to carry o
2525

2626
Avoid unnecessary tech jargon, but don't simplify either. Try to strike a balance between supporting people regardless of skill level and using accurate industry terms (since readers will need to know these in order to apply what they learn).
2727

28-
Postman learners speak lots of different languages, but right now our docs are only available in English. Use clear, concise sentences so that people reading in a second language can follow along. :earth_africa::earth_americas::earth_asia:
28+
Postman learners speak lots of different languages, but our docs are only available in English. Use clear, concise sentences so that people reading in a second language can follow along. :earth_africa::earth_americas::earth_asia:
2929

3030
## Language style
3131

32-
The documentation in the [learning center](https://learning.postman.com/docs) is intended to help people learn how to use Postman, so use practical instructional language wherever possible. Be specific, and "__show, don't tell__."
32+
The documentation in the [Postman Learning Center](https://learning.postman.com/docs) is intended to help people learn how to use Postman, so use practical instructional language wherever possible. Be specific, and "__show, don't tell__."
3333

3434
---
3535

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@
1414
## License
1515

1616
[Apache License 2.0](LICENSE)
17+
![Postman logo](https://assets.getpostman.com/common-share/postman-github-logo.png "Postman logo")
18+
19+
# Postman Labs Docs
20+
21+
## Resources
22+
23+
* [Download Postman](https://www.postman.com/downloads/)
24+
* [Download Postman Desktop Agent](https://www.postman.com/downloads/postman-agent/)
25+
* [Postman Release Notes](https://www.postman.com/downloads/release-notes)
26+
* [Postman Integrations](https://www.postman.com/integrations/)
27+
* [The Postman API](https://www.postman.com/postman/workspace/postman-public-workspace/documentation/12959542-c8142d51-e97c-46b6-bd77-52bb66712c9a/)
28+
* [Postman community](https://community.postman.com/) on Discourse
29+
30+
## License
31+
32+
[Apache License 2.0](LICENSE)

0 commit comments

Comments
 (0)