-
Notifications
You must be signed in to change notification settings - Fork 609
Style guide #642
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
Style guide #642
Changes from all commits
575f4bf
7933e15
9d1a753
55296f0
17a4a07
9fa09b3
a15291d
8ea3bf2
d06c917
3ebb867
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Document structure | ||
| ================== | ||
|
|
||
| Structure and organization are an important part of a document's ease of use and its understandability. Information should be organized and presented in a logical order, with similar subjects grouped together in the same section. | ||
|
|
||
| In most cases, a document has a title, an introductory paragraph, and one or more sections. | ||
|
|
||
| Try to keep only one topic in a page. Shorter topics are easier to reuse in other documents, are easier to write and edit, and are easier to translate. | ||
|
|
||
| Document title | ||
| -------------- | ||
|
|
||
| Use a title that accurately reflects the content of the document. People scan the table of contents looking for answers; it's often faster than using the built-in search engine. | ||
|
|
||
| Use title case for document titles. For more information and an example of capitalization, see :ref:`capital`. | ||
|
|
||
| Introductory paragraph | ||
| ---------------------- | ||
|
|
||
| Each page should have an introduction that acts as a short description of the document. The short description should be a single paragraph of no more than 3 sentences. Keep in mind that the description is displayed in the search results along with the page title. People read the description to help them decide if the document is the one that they want. | ||
|
|
||
| Document sections | ||
| ----------------- | ||
|
|
||
| To make pages easier for people to quickly scan for the content that they're looking for, break your document up into logical sections. Each section should have a title, and the title should relate to the content of the section. | ||
|
|
||
| A section title is not required if you have only one section. | ||
|
|
||
| Avoid subsections. If you find that you need subsections, quite often the document is too long, or too complex, and needs to be broken up into several pages. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Open to discussion. I'm not sure about breaking into different pages, as it could clutter the navigation. We have typically used sub-sections, which also help when people are searching a page for a term.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two approaches to this. One is to have one large monolithic file. The other is to have a docset made up of standalone files that are used where needed via
Having said that, it looks like a lot of open source products are going for the monolithic style these days. I suppose you can make use of the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @JeffSchering, propose we try the open source style of monolithic with includes? Agree on your points of being easier to search and find things, it's just the rest of our docs are monolithic, and if we're going to change it's going to be a larger project. Maybe add a section in Doc Guidelines about how to organize within a monolith (e.g. maybe with a mini-TOC?) and how to use includes?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JeffSchering not sure your thoughts on trying the monolith vs. separate pages? This PR seems to have a number of short and long pages broken up, did you want them still separate?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the pages separate, but when built they're all included into a monolith, which is what readers will see. See sg_mattermost-doc-style.rst for the Here's an idea of what it would look like when ouput to HTML: The Document sections stuff is in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect, thanks @JeffSchering!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We actually use subsections quite a lot and can find them useful. One sample page is Account Settings where we use subheadings to refer to particular account settings. Let me know if you'd have any thoughts on that @JeffSchering? Could there be use cases when subsections might work better? |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| Grammar, spelling, and mechanics | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be title cased per "Document Title" guidelines above? |
||
| ================================ | ||
|
|
||
| To maintain consistency across all Mattermost technical documentation, adhere to the guidelines here. | ||
|
|
||
| Language and spelling | ||
| --------------------- | ||
|
|
||
| Write documents in English. Use American spelling. | ||
|
|
||
| Paragraphs and sentences | ||
| ------------------------ | ||
|
|
||
| Paragraphs should express one idea or topic. Long paragraphs are sometimes difficult to read on screen, so try to keep them to 5 sentences or less. Short paragraphs are easier for people to scan quickly. | ||
|
|
||
| Try to keep sentences to 25 words or less in length. Short, single-clause sentences are often easier to understand and easier to translate. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could referencing the Hemingway writing app be useful? It's a common tool to simplify your paragraphs and sentences, which could be helpful for anyone working on docs. Not sure if you've used the app yourself or if you've used something else before @JeffSchering |
||
|
|
||
| Commas | ||
| ------ | ||
|
|
||
| As a general rule, the serial comma results in greater clarity. However, there are always edge cases where a serial comma adds confusion to a sentence. Therefore, the Mattermost documentation will use the following rule for commas: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Serial comma is okay, but I'm not sure about the reasoning. It sounds that "serial comma is preferred for greater clarity -- but there are edge cases, and therefore we use the serial comma". I assume the serial comma use is preferred due to clarity, so maybe just re-write this paragraph to make it clearer? |
||
|
|
||
| Use the serial comma unless doing so decreases clarity and understanding of the sentence. | ||
|
|
||
| Preferred | ||
| The cows ran from wolves, coyotes, and mosquitoes. | ||
|
|
||
| Avoid | ||
| The cows ran from wolves, coyotes and mosquitoes. | ||
|
|
||
| Tone | ||
| ---- | ||
|
|
||
| Use a direct, impartial tone. Most readers of the documentation are looking for answers and solutions to their problems; they are not looking for entertainment. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General question: Following the guideline of using short sentences, should we avoid the use of semicolons in docs? Does that make sentences structurally more complicated? |
||
|
|
||
| Preferred | ||
| If your password is rejected, check to make sure that Caps Lock is off, and then carefully type it in again. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Propose using exemplary guidelines that are short, simple and ambiguous. This one seems a little long where "Caps Lock" is ambiguous (it's not clear whether it should be capitalized, for instance) |
||
|
|
||
| Avoid | ||
| Failed sign in? No problem! Simply enter the correct password and we'll let you in right away. | ||
|
|
||
| .. _capital: | ||
|
|
||
| Capitalization | ||
| -------------- | ||
|
|
||
| Use title case for page titles and sentence case for section titles. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering if heading and section titles should also be title case? Or do we have a principle/guideline on why we would use sentence case instead? |
||
|
|
||
| Title case | ||
| Grammar, Spelling, and Mechanics | ||
|
|
||
| Sentence case | ||
| Language and spelling | ||
|
|
||
| Voice | ||
| ----- | ||
|
|
||
| Use active voice in preference to passive voice. Active voice has the subject of a sentence doing the action. In passive voice, the subject has an action done to it. Use passive voice only when you want to emphasize the action more than the subject. | ||
|
|
||
| Preferred | ||
| The system opens the *Status* pane. | ||
|
|
||
| Avoid | ||
| The *Status* pane is opened by the system. | ||
|
|
||
| Person | ||
| ------ | ||
|
|
||
| Use the second person and avoid the first person. | ||
|
|
||
| Preferred | ||
| You can view the status in the *Status* pane. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we add a guideline where imperative language is preferred? e.g. where |
||
|
|
||
| Avoid | ||
| We'll view the status in the *Status* pane. | ||
|
|
||
| Numbers | ||
| ------- | ||
|
|
||
| Spell out numbers when they are the first word in a sentence, otherwise use numeric digits. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've been using a guideline where if the number is less than or equal to ten, we spell the number, otherwise use numeric digits. @JeffSchering Would you have any thoughts on that? |
||
|
|
||
| Use commas to make long numbers easier to read. | ||
|
|
||
| Preferred | ||
| Three cows ran for 6 kilometers when they saw 2,300,097 mosquitoes chasing them. | ||
|
|
||
| Avoid | ||
| 3 cows ran for six kilometers when they saw 2300097 mosquitoes chasing them. | ||
|
|
||
| Text highlighting | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe call the section "Text Formatting" |
||
| ----------------- | ||
|
|
||
| Use highlighting of text to visually set off words and phrases that are important to readers. Content that should be highlighted includes file names, UI controls, and window titles. The following table has a comprehensive list with examples. | ||
|
|
||
| ============== ================== ======================= | ||
| Text Highlight Example | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add any guidelines for tables? For instance center-aligning the title row in tables? |
||
| ============== ================== ======================= | ||
| file name ``monospace`` ``config.py`` | ||
| directory name ``monospace`` ``/opt/mattermost`` | ||
| inline code ``monospace`` ``fmt.Printf("2 times %d = %d\n", x, y )`` | ||
| code samples ``monospace`` See :ref:`syntax-highlight` for an example. | ||
| screen output ``monospace`` See :ref:`literal-blocks` for an example. | ||
| menu selection **bold** "Click **File > Save**." | ||
| UI selection **bold** "Click **Next**." | ||
| field names **bold** "Enter the font in the **Display Font** field." | ||
| commands ``monospace`` "At the command line, type ``sudo apt-get install nginx``." | ||
| citations *italic* "Read the book *Clean Code* by Robert Martin." | ||
| window titles *italic* "The *Account Settings* window opens." | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Few tweaks:
|
||
| ============== ================== ======================= | ||
|
|
||
| Verb tense | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe group "Verb tense" with tone and voice earlier in the document? |
||
| ---------- | ||
|
|
||
| Use the present tense. | ||
|
|
||
| Preferred | ||
| Sharing this link lets other users view the linked message. | ||
|
|
||
| Avoid | ||
| Sharing this link will let other users view the linked message. | ||
|
|
||
| Bullet lists | ||
| ------------ | ||
|
|
||
| The list items in a bullet list can be either all complete sentences or all sentence fragments. Don't mix complete sentences and sentence fragments in a single list. Remember that a complete sentence begins with an upper case letter and ends with a punctuation mark. | ||
|
|
||
| Numbered lists and procedures | ||
| ----------------------------- | ||
|
|
||
| Create numbered lists and procedure steps using arabic numerals for the top-level list and lower case alpha characters for the first nested list. For example: | ||
|
|
||
|
|
||
| 1. This is the first step. | ||
| 2. This is the second step. | ||
|
|
||
| a. This is a substep. | ||
| b. This is another substep. | ||
|
|
||
| 3. This is the third step. | ||
|
|
||
| Linking to other documents | ||
| -------------------------- | ||
|
|
||
| When creating a link to another document in the Mattermost documentation, create a link with a relative URL. | ||
|
|
||
| A link with an absolute URL is not as flexible as a relative URL. Relative URLs don't break when the documentation is moved to another host, or if the documentation is hosted on a server that's behind a firewall without access to the Internet. | ||
|
|
||
| To create relative links in reStructuredText, see :ref:`relative-links-in-rst`. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Introduction | ||
| ============ | ||
|
|
||
| This is the Mattermost style guide for documentation. It acts as a reference for writers and editors to ensure that the Mattermost documentation is consistent and clear. | ||
|
|
||
| .. Note:: | ||
| The style guide is not intended to slow down or otherwise impede contributions, which are always welcome. No contribution will be rejected due to non-conforming style, although it might be edited. | ||
|
|
||
| The Mattermost documentation must be of high quality. It must be accurate and clear, and be presented with a style and tone that is appropriate for technical content. People who use Mattermost rely on the documentation to get their jobs done. We don't want to see an installation of Mattermost delayed because the documentation has an error or is difficult to understand. | ||
|
|
||
| .. contents:: | ||
| :backlinks: top | ||
|
|
||
| .. include:: sg_document-structure.rst | ||
| .. include:: sg_grammar-spelling-mechanics.rst | ||
| .. include:: sg_rest_markup.rst |

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if I missed this, just wondering if we should add a note on file naming convention?
It seems this PR has
sg_as a prefix, which is different from how other pages are organized. If we use a prefix either we're going to be inconsistent across our pages or we'll have to redirect or break links to refactor everything to use prefixes (which is not bad, so long as we know how to do that properly--what we don't want is orphaned pages).Our file naming isn't consistent yet, we should figure out if file naming is in scope for the style guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefixed the files with
sg_simply to keep them sorted together in a directory listing. I don't think a formal, prescribed, file naming convention is required, although file naming is something to think about. The file name becomes part of the URL for the doc, so it should at least give a hint as to the contents of the doc, and for the most part that's already the case in the Mattermost docs. Let's leave file naming out of the style guide for now, and if it becomes apparent that a formal convention is needed, we can add it in. Even then, I don't think a whole-scale renaming would be called for. We don't know how many web pages outside of the docs point to the existing URLs, and renaming everything would break all that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @JeffSchering makes sense, we'll leave file naming out of the guide for now, and we can think about it later--along with a strategy for redirecting out-of-date pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed among PMs and propose we remove the
sg_prefix from the style guide doc file names for now.The
sg_prefix will appear in the URL when viewing the page on docs.mattermost.com, and could be confusing if a user doesn't associatesg_withstyle guide.We can consider file naming convention later.