Skip to content

DOC Add info for links to docs and images for modules #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion en/10_Contributing/02_Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,18 @@ Code for an Alert box:

### Links to documentation

Links to other pages in the documentation uses the URL slug, *not* the file name.
When updating documentation for [`silverstripe/developer-docs`](https://github.com/silverstripe/developer-docs/), which is the content repository for [`docs.silverstripe.org`](https://docs.silverstripe.org), links to other pages in the documentation should use the URL slug, not the file name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When updating documentation for [`silverstripe/developer-docs`](https://github.com/silverstripe/developer-docs/), which is the content repository for [`docs.silverstripe.org`](https://docs.silverstripe.org), links to other pages in the documentation should use the URL slug, not the file name.
When updating documentation for [`silverstripe/developer-docs`](https://github.com/silverstripe/developer-docs/), which is the content repository for [`docs.silverstripe.org`](https://docs.silverstripe.org), links to other pages in the documentation should use the URL slug (e.g. `/contributing/documentation/`), not the file name.


When updating docs that are in a modules `docs/en` folder, and will be shown in the "Optional features" section of `docs.silverstripe.org`, and are also intended to be readible on GitHub, then links to other pages should use a relative path to the file name, not the URL slug.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When updating docs that are in a modules `docs/en` folder, and will be shown in the "Optional features" section of `docs.silverstripe.org`, and are also intended to be readible on GitHub, then links to other pages should use a relative path to the file name, not the URL slug.
When updating docs that are in a module's `docs/en/` folder, and will be shown in the "Optional features" section of `docs.silverstripe.org`, and are also intended to be readible on GitHub, then links to other pages within that module should use a relative path to the file name, not the URL slug. Links to documentation outside that module should use a full URL without the version number (e.g. `https://docs.silverstripe.org/en/contributing/documentation/`). API doc links should still be used in the format described below.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, put this note below the bits about "Relative documentation links" and "Absolute documentation links" below which are specific to docs in silverstripe/developer-docs.


Relative documentation links are prefixed with `./` for pages in the same directory, or `../` for pages in parent directories. For example `[contributing code](./code)` becomes [contributing code](./code) and `[getting started](../getting_started)` becomes [getting started](../getting_started).

Absolute documentation links are preferred for pages which aren't in the same directory or one level up. The language and version number are ommitted. For example `[managing lists](/developer_guides/model/lists/)` becomes [managing lists](/developer_guides/model/lists/).

### Images

Add images, such as screenshots, to an `_images` directory which should usually be located at `docs/en/_images`. Use relative links these files and use the markdown syntax `![Some alt text](_images/some-file.jpg)`. You must include alt text. Adding images this way will work correctly on both markdown added to `silverstripe/developer-docs`, and also to `docs/en` folder for a module that dispays on both `docs.silverstripe.org` and GitHub.

### Links to API documentation

API documentation is linked in a special way. Give some examples for classes, methods, properties.
Expand Down