Discourse向け効果的なドキュメンテーションの書き方

:information_source: Discourse documentation is currently being reviewed and edited to align with this style guide. Not all documentation topics currently match up to this - we are working toward that as quickly as possible.

This is considered a living document that guides how Discourse documentation is written and formatted. This topic will be kept up to date as needed. If you are in doubt about any of the principles here, please post on the topic to discuss specifics.

The guiding principle behind this documentation style guide is to consider your readers and their needs when writing documentation - what do they want to accomplish? What is your goal for providing the content?

:eyes: Quick checklist when implementing the style guide:

  1. Meta block is present and correct
  2. Title is action-oriented
  3. All titles use sentence case
  4. Correct tags and categories are used
  5. Document is structured logically

When completing a document, review it to make sure all of those criteria are met.

Please take note of these text formatting guidelines:


Meta information

  • Document should belong to one and only one of the following categories:
    • Using Discourse
      • General user guides for non-administrative tasks
    • Site Management
      • Settings, plugins, content, and general site administration
    • Integrations
      • Guides for integrating other platforms with Discourse
    • Hosted Customers
      • Guides that are only relevant to hosted customers
    • Self-hosting
      • Guides that are only relevant to self-hosted sites
    • Developer Guides
      • Technical guides for developing on top of Discourse, including creating themes, theme components, and plugins
    • Contributing
      • Guides for contributing to the Discourse open-source project
  • Document should belong to one and only one of the following tags / document types:
    • #how-to
    • #explanation
    • #reference
    • #tutorial
  • Document may have any other applicable tags, with an absolute maximum of 5 tags on a single document

Meta block

All documents must have a block at the top that includes a short explanation of what the document is about as well as any additional relevant meta information, like what the user level requirements are, whether console access is required, or anything else. This will be formatted in a blockquote without a heading over it. Heres an example of what this must look like:

:bookmark: This is a guide for describing all available hidden site settings, how to enable them, and why you might want to adjust them.

:person_raising_hand: Required user level: Administrator

:computer: Console access required

Titles and headings

  • Make document titles action-oriented
    • Incorrect: “How to enable automatic titles for chat threads”
    • Correct: “Enabling automatic titles for chat threads”
  • Document titles should not be too long
  • For ‘how-to’ topics, make the title goal oriented
  • All titles must be specific and unique
  • Do not use punctuation or special characters in document titles, other than commas
  • Do not include emoji in document titles
  • Use sentence case for titles and headings - that means only the first word starts with a capital letter, along with proper nouns and any other words that would normally be capitalised
  • Do not use ampersands (&) in headings, rather use the full word (“and”)

General writing guidelines, tone, and grammar

  • Use second-person voice when referring to people reading the document - i.e. use “you”, not “we”
  • Use active voice as much as possible
    • Incorrect: “the button should be clicked”
    • Correct: “click the button”
  • Define acronyms and abbreviations when first used, if necessary provide an external link that provides more information
  • Use short sentences, and break up text using shorter paragraphs, headings, and lists
  • You can use **bold** and *italics* to emphasise key phrases or words, but don’t overuse them
  • Avoid using jargon or technical terms without explanations - if in doubt, err on the side of explaining
  • Use screenshots when describing a visual interface, such as a UI element
  • Don’t document or attempt to disclose future Discourse features, products, or services unless explicitly permitted
  • Use transition words such as therefore, although, and furthermore.
  • Use common contractions: it’s, you’ll, you’re, we’re, let’s
  • Infer timelessness in documentation - avoid words such as soon, new, now, latest, etc. that quickly become irrelevant
  • Don’t attribute human qualities to software or hardware
    • e.g. “If you pass an integer to this API, it will get angry and raise an error”
    • e.g. “Our friendly and ambitious AI bot will help solve all your problems”
  • When quoting text (including from the Discourse UI), use “quotation marks”
  • When quoting a URL, use backticks
  • When using an example domain use discourse.example.com
  • If it would be useful, you can use emojis at the start of a paragraph to highlight it. Do not use more than two or three of these in a single topic. Some example emojis you can use:
    • :information_source: - An informative note
    • :mega: - Announcement or notice
    • :warning: - A warning message
    • :exclamation: - Very important information
  • Avoid:
    • Unnecessary metaphors or humour
    • Cultural and regional references
    • Dictating or ordering procedures in a condescending tone - e.g. You must click Publish or You need to click Publish
    • Being overly polite. For example, Please click Publish
    • Using exclamation points unless absolutely needed
    • Capitalizing words where it is unnecessary
    • Excess use of the same phrases and pronouns

For end user documentation:
Maintain a friendly, informal tone, with a focus on being clear and concise in a knowledgeable manner. Get to the point promptly. Explain technical terms, but be careful not to be condescending. To ensure clarity, start by briefly specifying the context of the current topic.

For developer and technical documentation:
Maintain a direct and precise tone. Use the same tone you would for user documentation, but you can assume a higher level of technical knowledge in your readers.

Structure

  • Get to the point fast - lead with what’s most important
  • Include important keywords early in the document
  • Make reader choices and next steps obvious
  • Always use light markup to write documentation (This is already built into Discourse with Markdown-it).
  • Organize your documentation in a logical flow - start with an overview, followed by detailed sections, and a summary or conclusion if applicable
  • Use headings and subheadings to structure your content, making it easier for readers to scan and find specific information - use descending hierarchy in headings, starting with h2, and don’t skip levels
  • Provide links to related topics or sections within your documentation - this helps users find additional information without unnecessary searches

Links

  • Use meaningful text in links
    • Incorrect: “Click here to read the guide”
    • Correct: “Read the guide
  • Unless the format of the URL is important or instructive, don’t use a URL as link text - instead, use the page title or a description of the page
  • Link to external sites and sources instead of quoting or rewriting existing documentation
  • Ensure that the sites you link to are of high standard and quality
  • If the link downloads a file, explicitly mention it - also indicate the type of file being downloaded and a rough estimate of the file size

Code in documentation

  • Use block code with language-specific syntax highlighting when possible for large code examples
  • If it is not already self-explanatory, introduce a code example with an introductory sentence that initiates the example that follows - when in doubt, err on the side of explaining
  • Code examples should follow the best practices for writing code for the relevant coding language
  • Use inline code for expressing basic code attributes or when a full code block is not necessary, such as:
    • Attribute names and values
    • Class names
    • Command-line utility names
    • Data types
    • Environment variable names
    • Filenames, filename extensions, and paths
    • Folders and directories
    • HTTP verbs, status codes, and content-type values
    • Query parameter names and values
    • Text input
  • When you use a placeholder in code examples, commands, or other text, including an explanation for what the placeholder represents
    • Write an explanation for the first time you use the placeholder; if there are multiple placeholders or steps after the first use of that placeholder, you can explain the placeholder again
  • Provide an easy way for users or developers to copy and run code.
    • Show expected output, either in a separate section after the code example or by using code comments within the code example
  • Write secure code - never hard-code passwords, API Keys, or secure information in code

Procedures and step-by-step guides

  • Format procedures consistently, so readers can find them easily by scanning
  • Use a separate numbered entry for each step
  • Include actions that finalize a step, such as OK or Apply buttons
  • If the instruction appears in the same UI where the action occurs, it’s usually not necessary to provide location details
  • If you need to make sure the reader begins in the right place, provide a brief phrase at the beginning of the step

Accessibility and inclusivity

  • Use screenshots, diagrams, or videos where they add value, particularly for explaining complex steps or showing parts of an interface
  • Images should be used to back up text information, not replace it
  • Always use alt attributes for images
  • Always provide captions or transcripts for videos
  • Only use GIFs if you can fully explain the content in text
  • Choose simple images and crop extraneous detail
  • Use plain language and avoid figures of speech or idioms that might not be universally understood
  • Consider that your document will be used on a multitude of devices
  • Use gender-neutral language. Don’t use he, him, his, she, her, or hers while referencing people - to write around pronouns, you can:
    • Rewrite using the second person (you)
    • Rewrite the sentence to have a plural noun and pronoun
    • Use the words person or individual
    • Use articles the, an, or a instead of a pronoun
    • Use a plural pronoun such as they, their, or them, even if it references a single individual
  • When you’re writing about a real person, use the pronouns that person prefers
  • Be inclusive of gender identity, race, culture, religion, ability, age, sexual orientation, and socioeconomic class - include a wide variety of professions, cultures, educational settings, locales, and economic settings in examples
  • Avoid politicised content - in cases where political content needs to be included, remain neutral
  • Don’t make any generalisations about people, countries, and cultures, not even positive or neutral generalisations
  • Don’t write prejudiced and discriminatory content against any communities, especially minorities
  • Avoid qualitative terms related to historical events
  • Avoid using terms and metaphors associated with violence and military actions

Last edited by @hugh 2024-09-03T11:02:51Z

Last checked by @hugh 2025-03-10T03:50:30Z

Check documentPerform check on document:
「いいね!」 8

@hugh / @SaraDev
タイトルについて、若干の一貫性のなさに気づきました。

以下のような例があります。

しかし、その後、以下のように述べています。

「正解」の例をコンバーターに通すと、以下のようになります。

Enable Automatic Titles for Chat Threads

例をそれに合わせて更新すべきでしょうか?

補足

私個人としては、文の先頭のみを大文字にする(sentence case)方が良いと考えており、現在のトピックタイトルで「Chat Threads」が大文字になっている理由もよくわかりません。そのため、個人的には以下のようにしたいと考えています。

Enable automatic titles for chat threads

しかし、最終的には一貫性が最も重要であり、現在の推奨事項を選択されたのには良い理由があると仮定します。

「いいね!」 1

それは良い指摘ですね。私はその関連性に気づいていませんでしたが、簡単に更新できます。しかし:

タイトルケースの指定は私が行ったものです。なぜなら、一般的にタイトルケースの方がすっきりとしていてプロフェッショナルに見えるからです。これは私の主観的な意見だと思います。なぜなら、GoogleMicrosoft も、ドキュメンテーションのタイトルにはセンテンスケースを使用するように言っています。私が調べた他のサイトでもセンテンスケースを使用するように言われているため、これを元に戻し、そこのケース要件を更新します。

「いいね!」 3

また、タイトルと見出しの両方にセンテンスケースを使用するように指示していることにも気づきました。(私も同じチームです。)

見出しに関する私たちの好みは現在指定されていないようです。この機会にそれも追加しましょう。

「いいね!」 1

同意します。明示的に指定するためにここに追加します。

「いいね!」 1

OK、調子に乗ってきたので…\n\nこれは良いと思います:\n\n[quote="Discourse, post:1, topic:309628"]\n不必要に単語を大文字にする\n[/quote]\n\n\nしかし、ガイドには現在、この例があります。\n\n[quote="Discourse, post:1, topic:309628"]\n:bookmark: これは、利用可能なすべての非表示サイト設定、それらを有効にする方法、および調整する理由を説明するためのガイドです。\n[/quote]\n\n私の意見では、ここで「非表示サイト設定」を大文字にする必要はないと思います。(権威への訴え)

「いいね!」 2

お気遣いありがとうございます :smile:

はい、これは良い点です。この例は、既存のドキュメントのタイトルを使用して説明した実際のドキュメントから抜粋したもので、そのドキュメントではタイトルケースが使用されていたため、参照も同様でした。タイトルケースからセンテンスケースに変更されたため、その参照も更新する必要があります。

「いいね!」 1

上記の会話に基づいて、このスタイルガイドにいくつか編集を加えました。

  • トピックタイトルを文頭大文字に変更しました
  • 見出しを文頭大文字に変更しました
  • 不要な大文字(Syntax)を削除しました
  • 見出しのアンパサンド(&)を「and」に置き換えました
  • 見出しのスラッシュ(/)をコンマまたは接続詞に置き換えました

最後の2つの変更については議論されていません。不要またはガイドと矛盾していると思われる場合は、お知らせください(または、それらのガイドラインをガイドに含めるべきかどうかについても)。

「いいね!」 2

この前の2つは気に入りました。ガイドの趣旨に沿っていますし、ガイド自体に含める価値があります。今すぐ追加します。

「いいね!」 1

他の言語のドキュメントにラベルを付けるためのフラグは例外だと想定しています。

「いいね!」 1

慣用句を避けることと共に、私はドキュメントで短縮形を使うことを常に避けてきました。非英語圏/非西洋圏の読者にとって理解しにくくなると思ったからです。英語は奇妙な言語です。

moreover?

どこかの時点で、私たち(おそらく私)はサイト設定を参照するためにインラインコードを使用し始めました。例えば、「discourse connect サイト設定を有効にする」といった具合です。それは正しいアプローチかもしれませんが、少し開発者っぽい感じがします。

Discourseサイトを参照するために、一貫したプレースホルダー名を使用する価値があるかもしれません。discourse.example.com のようなものでしょうか? ここには、Discourseサイトを sitename.com と参照しているドキュメントがいくつかあります。それは本当に私を混乱させました。


一般的なライティングのアドバイスとして、ターゲットオーディエンスの一員になったつもりで、自分が書いたものを読んでみてください。(短縮形がトリッキーであることがわかります)オーディエンスの事前知識に関する自分の仮定が妥当かどうかを確認してください。

ドキュメントトピックが私に割り当てられなくなったことをどれほど感謝していても、チームのすべてのドキュメントトピックの作成者としてDiscourseを使用するのは、少し冷たい感じがします。

私が再び執筆を楽しむようになったのは、あなたが書いているものに自分自身を少しでも反映させる方法を探すというアドバイスでした。それは、あなたの声のトーン、あなたの趣味、何でも構いません…それは、ここで推奨されていることとは正反対のことです。

「いいね!」 6

やあ、サイモン! :blob_wave:

この件については様子を見ようと思っていましたが、私も同じように、短縮形を避けるようにしています。

ハハ、ええ…ドキュメントであのような言葉を一切使わないようにします。さもないと、私の :face_with_monocle: が露呈してしまいます。

確かに:Example Domains

これが私が議論するためにここに来たポイントです! :smiley:

この件については、多くの議論がありましたが、これがスタイルガイドにデフォルトで含まれているのを見て嬉しかったです。

これが重要だと考える理由は次のとおりです。ドキュメントの作成は、コミュニティの可能な限り多くのメンバー、特にDiscourseチームのメンバーにとってアクセスしやすいものである必要があります。

Discourseはソーシャルなディスカッションソフトウェアです。そして、一部のドキュメントは実際には継続的な会話です。コミュニティのメンバーをオンボーディングする方法の実践を共有する場合、そのトピックの「所有者」として提示されたいので、質問に答えたり、主題を拡張したりできます。

一方で、顧客が私たちがまだ説明できていない機能について尋ねてきた場合、スタイルガイドを使用して有用で一般的なドキュメントを作成できることを望みます。これは、トピックの所有者であることが公開により大きな慣性を与えると私が感じていることです。

また、Discourse以外でドキュメントを作成する場合(統合やコードコメントからの生成など)、ドキュメントユーザーがいる方が実装の詳細としてはおそらく簡単です。 :thinking:

このガイドが、人々が自分の声や個性を注入することを止めることはないと思います。そして議論をホストすることも。しかし、そうでなければドキュメントを作成しないであろうより多くの人々がドキュメント作成の実践に参加するのに役立つことを願っています(そしてその後、彼らに個人的になるように促すことができます!) :smiley:

「いいね!」 3

ローカライズされたドキュメントをネイティブで処理できるようになるまで、タイトルにフラグを付けるのが最も実用的な方法であり、このガイドラインの妥当な例外だと思います。

この種のことは、どちらの意見や好みも異なると思いますが、このスタイルガイドでは、業界で認められている標準を採用します。繰り返しになりますが、GoogleMicrosoftのガイドラインは、一般的な短縮形を使用した方が良いという点で一致しています。

とはいえ、否定的な短縮形(「can’t」など)を使用すると、英語話者でない人にとって理解が難しくなる可能性があるという意見もいくつか読みました。この点についてはさらに調査し、必要に応じてスタイルガイドを更新します。

その例は削除しました! :smile:

はい、それは非常に一般的です(Discourseだけでなく)、しかし、それが正確ではないことには同意します。引用符を使用する方が良いでしょう。そのため、スタイルガイドで明示することにしました。

それは素晴らしい点です。スタイルガイドに追加します!

このフィードバックありがとうございます! @maikiは上記でいくつかの良い点を挙げており、私はそこで彼が言っていることに同意します。それに加えて、公式ドキュメントの作成者を@Discourseにした理由の1つは、特に初めてドキュメントにアクセスする読者に対して、より権威があると感じてもらうためです。これも、そもそもスタイルガイド全体を作成した動機です。

ドキュメントを作成する人は、誰でも自分の個性を文章に注入できますし、個々のドキュメントトピックに関する議論はなくなるわけではないので、そこは常にパーソナルなものにする良い場所です。

これらのフィードバックはすべて非常に感謝しています :slight_smile:

「いいね!」 2

ガイドのメタブロックに関する部分についてです。上記のガイドによると、Docトピックにはメタブロックが必要ですが、すべてのトピックにメタブロックがあるわけではありません[1]し、常に一貫しているわけでもありません。以下に、いくつか見つけたガイドからの例を挙げます。

個人的には「全ユーザー」が好きです。

フィードバックを集める前に、トピックのメタブロックを変更したくありませんでした :smiley:


  1. トピックの文脈によるかもしれません? ↩︎

「いいね!」 4

すべての @Discourse ドキュメントは作業中で、最終的にはすべて対応される予定です (:crossed_fingers:)。しかし、一貫性のなさについては良い点ですね。どれに落ち着くかは分かりませんが、一つを選んでそれに固執するようにします。:slight_smile:

「いいね!」 4

さらに、新しい情報ブロックが含まれているものがあれば、それらは「フェーズ1」を通過し、レビュー段階に入っていることを意味します。そのため、もしそれらを読んで「それは正しくない」または「情報が不足している」と感じ、フィードバックを残すのに十分な寛大さがあれば、投稿にあなたの考えを追加してください。:heart: :slight_smile:

「いいね!」 5

一番上の必須ユーザーレベル情報は、どのような目的で使用されていますか?文書が自分に関連しているかどうかについての情報を提供してくれると思ったのですが、「私はxxxではないので、関連性がない」と判断して読むことができるからです。
しかし、例えばTL3未満のユーザーでもウィキを編集できるため、他の人にとっても関連性があるため、異なる方法で使用されているようです。

「いいね!」 3

@Moin、ご指摘ありがとうございます。そのトピックは、必要なユーザーレベルを修正するように更新されました。

その情報が何のためのものかについてのあなたの理解は正しいです。ドキュメントで説明されているアクションを実行できるユーザーレベルまたはタイプを示す必要があります。

「いいね!」 1