-
Notifications
You must be signed in to change notification settings - Fork 297
Documentation
The documentation for the PWABuilder repository lives in the docs sub-directory, and can be found at docs.pwabuilder.com.
Contributing to the docs is easy:
-
Open an issue on the PWA Builder issue board.
-
Fork the pwa-docs repository to your personal GitHub account.
-
Create a branch off main for your changes. Use the issue number and a descriptive branch name. For example, if I'm addressing Issue #1234, I would call my branch
1234-fix-quickstart-typos
-
Make your changes. See the writing guidelines below for more details on style conventions.
-
Run the docs locally to double-check your changes. More information on working with Docsify is included below.
-
Open a Pull Request into the
pwa-builder/pwa-docs
repository. -
Wait for your changes to be reviewed. Someone may request changes or merge or your changes!
Make sure any new or edited documentation follows these guidelines:
-
Write clear, simple sentences that get the point across.
-
Double-check for grammar, punctuation, and spelling.
-
Break up long text blocks with line breaks, images, or code snippets.
-
If you reference somewhere else in the documentation, link to it.
-
If your article needs context and the information already exists in the documentation, feel free to use a link.
-
When referencing outside materials, prioritize official Microsoft Docs or MDN resources.
-
Use a single H1 header (#) at the top of your article for the title.
-
For any subsections that you want included on the sidebar, use a H2 header (##). Docsify will automatically include H2 headers on the sidebar.
-
If you want to header a section that you don't want included on the sidebar use a H3 header (###) or smaller. Docsify is configured to not include H3 or smaller.
-
Keep your headers short and descriptive and organize your sections in a logical order.
-
Place all images in the assets subdirectory specific to that article. If you are creating a new article, create a new directory for that article.
-
Keep images a reasonable size and keep smaller displays in mind. Set widths for your images with html.
-
Provide alt text for all images.
-
Place all images in
<div>
tags with a class ofdocs-image
to enable global image styling.
For example:
<div class="docs-image">
<img src="..." width=500 alt="...">
</div>
-
Use code snippets when you can! The documentation has a copy code plugin that makes it easy for readers to use snippets. They also break up text and make the documentation more practical.
-
Make sure to add context to any snippets - don't expect the reader to fully understand standalone code.
-
If your list is a step-by-step, use a numerical list.
-
If your list is related items, but not a step-by-step, use a bulleted list.
-
Add a line break in between list items to format them with a bit more breathing room.
PWABuilder docs are built with Docsify! Here are some quick tips for working with Docsify.
In order to run the docs locally, you can install the docsify-cli with NPM:
npm i docsify-cli -g
Once you have the CLI installed, you can run the docs locally by running:
docsify serve docs
Where docs
is the docs directory at the root of pwa-docs
.
Docsify automatically iterates through subdirectories to add any .md
files to the docs. To add a page, create a new Markdown file in the proper subdirectory for whichever tool you are adding documentation for. If you add a PWA Starter page, it could be found at localhost:3000/#/starter/new-page
.
Once you have your file created, you can add it to the sidebar by editing _sidebar.md
in the docs
directory.
All of the custom styling is done through docsify-themeable, which exposes custom CSS properties to edit the appearance of the docs. All properties can be found in the global.css
file.