mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #4280 from SpiritLevel/patch-2
Update 03_Documentation.md
This commit is contained in:
commit
f52ac775f5
@ -3,45 +3,36 @@ summary: Writing guide for contributing to SilverStripe developer and CMS user h
|
|||||||
|
|
||||||
# Contributing documentation
|
# Contributing documentation
|
||||||
|
|
||||||
Documentation for a software project is a continued and collaborative effort, we encourage everybody to contribute, from
|
Documentation for a software project is a continued and collaborative effort. We encourage everybody to contribute in any way they can, from simply fixing spelling mistakes, to writing recipes, to reviewing existing documentation and translating it to another language.
|
||||||
simply fixing spelling mistakes, to writing recipes, reviewing existing documentation, and translating the whole thing.
|
|
||||||
|
|
||||||
Modifying documentation requires basic [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) and
|
Modifying documentation requires basic [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) and
|
||||||
[Markdown](http://daringfireball.net/projects/markdown/) knowledge, and a GitHub user account.
|
[Markdown](http://daringfireball.net/projects/markdown/) knowledge, and a GitHub user account.
|
||||||
|
|
||||||
## Editing online
|
## Editing online
|
||||||
|
|
||||||
The easiest way of making a change to the documentation is by clicking the "Edit this page" link at the bottom of the
|
The easiest way of editing any documentation is by clicking the "Edit this page" link at the bottom of the
|
||||||
page you want to edit. Alternatively, you can find the appropriate .md file in the
|
page you want to edit. Alternatively, locate the appropriate .md file in the
|
||||||
[github.com/silverstripe/silverstripe-framework](https://github.com/silverstripe/silverstripe-framework/tree/master/docs/)
|
[github.com/silverstripe/silverstripe-framework](https://github.com/silverstripe/silverstripe-framework/tree/master/docs/) repository and press the "edit" button. **You will need a free GitHub account to do this**.
|
||||||
repository and press the "edit" button. **You will need a free GitHub account to do this**.
|
|
||||||
|
|
||||||
|
|
||||||
* After you have made your change, describe it in the "commit summary" and "extended description" fields below, and
|
* After editing the documentation, describe your changes in the "commit summary" and "extended description" fields below then press "Commit Changes".
|
||||||
press "Commit Changes".
|
* After that you will see a form to submit a Pull Request: "[pull requests](http://help.github.com/pull-requests/)". You should be able to adjust the version your
|
||||||
* After that you will see form to submit a Pull Request. You should be able to adjust the version your document ion change is for and then submit the form. Your changes
|
* documentation changes are for and then submit the form. Your changes will be sent to the core committers for approval.
|
||||||
will be sent to the core committers for approval.
|
|
||||||
|
|
||||||
<div class="warning" markdown='1'>
|
<div class="warning" markdown='1'>
|
||||||
You should make the changes in the lowest branch they apply to. For instance, if you fix a spelling issue that you
|
You should make your changes in the lowest branch they apply to. For instance, if you fix a spelling issue that you found in the 3.1 documentation, submit your fix to that branch in Github and it'll be copied to the master (3.2) version of the documentation automatically. *Don't submit multiple pull requests*.
|
||||||
found in the 3.1 documentation, submit your fix to that branch in Github and it'll be copied to the master (3.2)
|
|
||||||
version of the documentation automatically. *Don't submit multiple pull requests*.
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Editing on your computer
|
## Editing on your computer
|
||||||
|
|
||||||
If you prefer to edit the content on your local machine, you can "[fork](http://help.github.com/forking/)" the
|
If you prefer to edit content on your local machine, you can "[fork](http://help.github.com/forking/)" the
|
||||||
[github.com/silverstripe/silverstripe-framework](http://github.com/silverstripe/silverstripe-framework) and
|
[github.com/silverstripe/silverstripe-framework](http://github.com/silverstripe/silverstripe-framework) and
|
||||||
[github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms) repositories and send us
|
[github.com/silverstripe/silverstripe-cms](http://github.com/silverstripe/silverstripe-cms) repositories, and send us "[pull requests](http://help.github.com/pull-requests/)" to incorporate your changes. If you have previously downloaded SilverStripe or a module, chances are that you already have these repositories on your machine.
|
||||||
"[pull requests](http://help.github.com/pull-requests/)". If you have downloaded SilverStripe or a module, chances are
|
|
||||||
that you already have these repositories on your machine.
|
|
||||||
|
|
||||||
The documentation is kept alongside the source code in the `docs/` subfolder of any SilverStripe module, framework or
|
The documentation is kept alongside the source code in the `docs/` subfolder of any SilverStripe module, framework or CMS folder.
|
||||||
CMS folder.
|
|
||||||
|
|
||||||
<div class="warning" markdown='1'>
|
<div class="warning" markdown='1'>
|
||||||
If you submit a new feature or an API change, we strongly recommend that your patch includes updates to the necessary
|
If you submit a new feature or an API change, we strongly recommend that your patch includes updates to the necessary documentation. This helps prevent our documentation from getting out of date.
|
||||||
documentation. This helps prevent our documentation from getting out of date.
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Repositories
|
## Repositories
|
||||||
@ -52,44 +43,38 @@ documentation. This helps prevent our documentation from getting out of date.
|
|||||||
|
|
||||||
## Source control
|
## Source control
|
||||||
|
|
||||||
In order to balance editorial control with effective collaboration, we keep documentation alongside the module source
|
In order to balance editorial control with effective collaboration, we keep documentation alongside the module source code, e.g. in `framework/docs/`, or as code comments within PHP code. Contributing documentation is the same process as providing any other patch (see [Contributing code](code)).
|
||||||
code, e.g. in `framework/docs/`, or as code comments within PHP code. Contributing documentation is the same process as
|
|
||||||
providing any other patch (see [Contributing code](code)).
|
|
||||||
|
|
||||||
## What to write
|
## What to write
|
||||||
|
|
||||||
See [what to write (jacobian.org)](http://jacobian.org/writing/great-documentation/what-to-write/) for an excellent
|
See [what to write (jacobian.org)](http://jacobian.org/writing/great-documentation/what-to-write/) for an excellent introduction to the different types of documentation. Also see [producing OSS: "documentation"](http://producingoss.com/en/getting-started.html#documentation) for good rules of thumb
|
||||||
introduction to the different types of documentation, and
|
|
||||||
[producing OSS: "documentation"](http://producingoss.com/en/getting-started.html#documentation) for good rules of thumb
|
|
||||||
for documenting open source software.
|
for documenting open source software.
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
* Keep documentation lines to 120 characters.
|
* Keep documentation lines to 120 characters.
|
||||||
* Don't duplicate: Search for existing places to put your documentation. Do you really require a new page, or just a new paragraph
|
* Don't duplicate: Search for existing places to put your documentation. Do you really require a new page, or just a new paragraph of text somewhere?
|
||||||
of text somewhere?
|
|
||||||
* Use PHPDoc in source code: Leave low level technical documentation to code comments within PHP, in [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) format.
|
* Use PHPDoc in source code: Leave low level technical documentation to code comments within PHP, in [PHPDoc](http://en.wikipedia.org/wiki/PHPDoc) format.
|
||||||
* API and developer guides complement each other: Both forms of documenting source code (API and Developer Guides) are valuable resources.
|
* API and developer guides are two forms of source code documentation that complement each other.
|
||||||
* Provide context: Give API documentation the "bigger picture" by referring to developer guides inside your PHPDoc.
|
* API documentation should provide context, ie, the "bigger picture", by referring to developer guides inside your PHPDoc.
|
||||||
* Make your documentation findable: Documentation lives by interlinking content, so please make sure your contribution doesn't become an
|
* Make your documentation easy to find: Documentation lives by interlinking content so please make sure your contribution doesn't become an inaccessible island. At the very least, put a link to your should on the index page in the same folder. A link to your page can also appear
|
||||||
inaccessible island. Your page should at least be linked on the index page in the same folder. It can also appear
|
|
||||||
as "related content" on other resource (e.g. `/tutorials/site_search` might link to `/developer_guides/forms/introduction`).
|
as "related content" on other resource (e.g. `/tutorials/site_search` might link to `/developer_guides/forms/introduction`).
|
||||||
|
|
||||||
## Writing style
|
## Writing style
|
||||||
|
|
||||||
* Write in second plural form: Use "we" instead of "I". It gives the text an instructive and collaborative style.
|
* Write in second person plural form: Use "we" instead of "I". It gives the text an instructive and collaborative style.
|
||||||
* It's okay to address the reader: For example "First you'll install a webserver" is good style.
|
* It's okay to address the reader: For example "First you'll install a webserver" is good style.
|
||||||
* Write in an active and direct voice.
|
* Write in an active and direct voice.
|
||||||
* Mark up correctly: Use preformatted text, emphasis and bold to make technical writing more "scannable".
|
* Mark up correctly: Use preformatted text. Emphasis and bold make technical writing more easily "scannable".
|
||||||
* Avoid FAQs: FAQs are not a replacement of a coherent, well explained documentation. If you've done a good job
|
* Avoid FAQs: FAQs are not a replacement for coherent, well explained documentation. If you've done a good job
|
||||||
documenting, there shouldn't be any "frequently asked questions" left.
|
documenting, there shouldn't be any "frequently asked questions" left.
|
||||||
* "SilverStripe" should always appear without a space, use two capital S’.
|
* "SilverStripe" should always appear without a space with both "S"s capitalised.
|
||||||
* Use simple language and words. Avoid uncommon jargon and overly long words.
|
* Use simple language and words. Avoid uncommon jargon and overly long words.
|
||||||
* Use UK English and not US English. SilverStripe is proudly a New Zealand open source project we use the UK spelling and forms of English. The most common of these differences are -ize vs -ise, or -or vs our (eg color vs colour).
|
* Use UK English and not US English. SilverStripe is proudly a New Zealand open source project we use the UK spelling and forms of English. The most common of these differences are -ize vs -ise, or -or vs our (eg color vs colour).
|
||||||
* We use sentence case for titles so only capitalise the first letter of the first word of a title. Only exceptions to this are when using branded (e.g. SilverStripe), acronyms (e.g. PHP) and class names (e.g. ModelAdmin).
|
* We use sentence case for titles so only capitalise the first letter of the first word of a title. The only exceptions to this are when using brand names (e.g. SilverStripe), acronyms (e.g. PHP) and class names (e.g. ModelAdmin).
|
||||||
* Use gender neutral language throughout the document, unless referencing a specific person. Use them, they, their, instead of he and she, his or her.
|
* Use gender neutral language throughout the document, unless referencing a specific person. Use them, they, their, instead of he and she, his or her.
|
||||||
* URLs: is the end of your sentence is a URL, you don't need to use a full stop.
|
* URLs: if the end of your sentence is a URL then you don't need to use a full stop.
|
||||||
* Bullet points: Sentence case your bullet points, if it is a full sentence then end with a full stop. If it is a short point or list full stops are not required.
|
* Bullet points: Sentence case your bullet points. If a bullet point is a full sentence then end with a full stop. If it is a short point or a list, full stops are not required.
|
||||||
|
|
||||||
## Highlighted blocks
|
## Highlighted blocks
|
||||||
|
|
||||||
@ -97,8 +82,7 @@ There are several built-in block styles for highlighting a paragraph of text. Pl
|
|||||||
sparingly.
|
sparingly.
|
||||||
|
|
||||||
<div class="hint" markdown='1'>
|
<div class="hint" markdown='1'>
|
||||||
"Tip box": Adds, deepens or accents information in the main text. Can be used for background knowledge, or "see also"
|
"Tip box": A tip box is great for adding, deepening or accenting information in the main text. They can be used for background knowledge, or to provide links to further information (ie, a "see also" link).
|
||||||
links.
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
@ -108,8 +92,7 @@ Code:
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="notice" markdown='1'>
|
<div class="notice" markdown='1'>
|
||||||
"Notification box": Technical notifications relating to the main text. For example, notifying users about a deprecated
|
"Notification box": A notification box is good for technical notifications relating to the main text. For example, notifying users about a deprecated feature.
|
||||||
feature.
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
@ -119,8 +102,7 @@ Code:
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="warning" markdown='1'>
|
<div class="warning" markdown='1'>
|
||||||
"Warning box": Highlight a severe bug or technical issue requiring a users attention. For example, a code block with
|
"Warning box": A warning box is useful for highlighting a severe bug or a technical issue requiring a user's attention. For example, suppose a rare edge case sometimes leads to a variable being overwritten incorrectly. A warning box can be used to alert the user to this case so they can write their own code to handle it.
|
||||||
destructive functionality might not have its URL actions secured to keep the code shorter.
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
@ -129,14 +111,12 @@ Code:
|
|||||||
...
|
...
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
See [markdown extra documentation](http://michelf.com/projects/php-markdown/extra/#html) for more restriction
|
See [markdown extra documentation](http://michelf.com/projects/php-markdown/extra/#html) for more restrictions
|
||||||
on placing HTML blocks inside Markdown.
|
on placing HTML blocks inside Markdown.
|
||||||
|
|
||||||
## Translating documentation
|
## Translating documentation
|
||||||
|
|
||||||
Documentation is kept alongside the source code, typically in a module subdirectory like `framework/docs/en/`. Each
|
Documentation is kept alongside the source code, typically in a module subdirectory like `framework/docs/en/`. Each language has its own subfolder, which can duplicate parts of or the entire body of documentation. German documentation would, for example, live in `framework/docs/de/`. The
|
||||||
language has its own subfolder, which can duplicate parts or the whole body of documentation. German documentation
|
|
||||||
would for example live in `framework/docs/de/`. The
|
|
||||||
[docsviewer](https://github.com/silverstripe/silverstripe-docsviewer) module that drives
|
[docsviewer](https://github.com/silverstripe/silverstripe-docsviewer) module that drives
|
||||||
[doc.silverstripe.org](http://doc.silverstripe.org) automatically resolves these subfolders into a language dropdown.
|
[doc.silverstripe.org](http://doc.silverstripe.org) automatically resolves these subfolders into a language dropdown.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user