كتابة توثيق فعال لـ 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

هل يجب علينا تحديث مثالنا ليتطابق؟

aside

لو كان الأمر متروكًا لي وحدي، لكنت أعتقد أننا سنختار حالة الجملة، ولست متأكدًا من سبب وجود “Chat Threads” مكتوبة بأحرف كبيرة في عنوان الموضوع الحالي، لذلك شخصيًا أفضل رؤية هذا:

Enable automatic titles for chat threads

لكن الاتساق أكثر أهمية في النهاية وسأفترض أن لديكم سببًا وجيهًا لاختيار التوصية الحالية.

إعجاب واحد (1)

هذه ملاحظة جيدة - لم أقم بهذا الربط، ولكن من السهل تحديثه. ومع ذلك:

كانت مواصفات حالة العنوان خاصة بي، لأنني أجد أنها تبدو بشكل عام أنظف وأكثر احترافية. أعتقد أن هذا مجرد رأي شخصي جدًا، لأن كلًا من Google و Microsoft تقولان باستخدام حالة الجملة في عناوين الوثائق. مواقع أخرى وجدتها تقول أيضًا استخدام حالة الجملة، لذلك سأعيد هذا وأحدّث متطلبات الحالة هناك.

3 إعجابات

ألاحظ أيضًا أنهم يقولون استخدام حالة الجملة للعناوين وال الرؤوس. (أنا في نفس الفريق).

يبدو أننا لا نحدد حاليًا تفضيلنا للعناوين. دعنا نضيف ذلك أيضًا أثناء قيامنا بذلك.

إعجاب واحد (1)

أتفق - سأضيف ذلك هنا لتحديده بشكل صريح.

إعجاب واحد (1)

حسنًا، بما أنني في حالة جيدة هنا…

أحب أن نقول هذا:

ولكن في الدليل، لدينا هذا المثال حاليًا:

رأيي هو أنه من غير الضروري كتابة “Hidden Site Settings” بأحرف كبيرة هنا. (appeal to authority)

إعجابَين (2)

أنا أقدر هذا الاحتكام :smile:

نعم، هذه نقطة جيدة - تم سحب هذا المثال من مستند حقيقي حيث استخدمنا عنوان المستند الحالي لوصفه، وبما أن هذا المستند استخدم حالة العنوان، فقد تم تحديث المرجع أيضًا. مع التغيير من حالة العنوان إلى حالة الجمل، يجب أيضًا تحديث هذا المرجع.

إعجاب واحد (1)

لقد أجريت بعض التعديلات على دليل الأسلوب هذا الآن بناءً على المحادثة أعلاه.

  • تم تغيير عنوان الموضوع إلى حالة الجملة
  • تم تغيير العناوين إلى حالة الجملة
  • تمت إزالة حالة الأحرف غير الضرورية (Syntax)
  • تم استبدال علامات العطف (&) في العناوين بـ “and”
  • تم استبدال الشرطات المائلة (/) في العناوين بفواصل أو حروف عطف

لم تتم مناقشة التغييرين الأخيرين - أخبرني إذا بدت زائدة عن الحاجة أو تتعارض مع الدليل (أو بدلاً من ذلك، ما إذا كان ينبغي التقاط تلك الإرشادات في الدليل).

إعجابَين (2)

أعجبني آخر اثنتين - فهما بالتأكيد تتماشى مع روح بقية الدليل، وتستحقان الإدراج في الدليل نفسه. سأضيفهما الآن.

إعجاب واحد (1)

أفترض أن الأعلام لتسمية المستندات بلغات أخرى هي استثناء.

إعجاب واحد (1)

بالإضافة إلى تجنب المصطلحات، كنت دائمًا أتجنب استخدام الاختصارات في المستندات. اعتقدت أنها تجعل الأمر أكثر صعوبة على القراء غير الناطقين بالإنجليزية/غير الغربيين للفهم. اللغة الإنجليزية لغة غريبة.

علاوة على ذلك؟

في مرحلة ما، بدأنا (ربما أنا) في استخدام رموز مضمنة للإشارة إلى إعدادات الموقع. على سبيل المثال: “تمكين إعداد الموقع 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 إعجابات

حتى يكون لدينا طريقة أصلية للتعامل مع المستندات المحلية، أعتقد أن إضافة العلامات في بداية العنوان هي الطريقة الأكثر عملية للقيام بذلك، وهي استثناء معقول لهذا الدليل.

أعتقد أن هذا النوع من الأشياء له آراء وتفضيلات مختلفة في كلا الاتجاهين، ولكن بالنسبة لدليل الأسلوب هذا، فإننا نتبع المعايير الصناعية المقبولة. مرة أخرى، تتفق كل من أدلة Google و Microsoft على أن الاختصارات الشائعة أفضل استخدامًا.

ومع ذلك، فقد قرأت بعض المشاركات التي تقترح أن استخدام الاختصارات السلبية (مثل “can’t”) قد يجعل الفهم أكثر صعوبة للمتحدثين غير الإنجليز. سنتعمق في هذا الأمر أكثر، وإذا لزم الأمر، سنقوم بتحديث دليل الأسلوب وفقًا لذلك.

لقد قمت بإزالة هذا المثال! :smile:

نعم - هذا شائع جدًا (ليس فقط في Discourse)، ولكني أتفق على أنه ليس صحيحًا تمامًا. سيكون استخدام علامات الاقتباس أفضل، لذلك أعتقد أنني سأجعل ذلك صريحًا في دليل الأسلوب.

هذه نقطة رائعة - سأضيفها إلى دليل الأسلوب!

شكرًا على هذه الملاحظات! قدم @maiki بعض النقاط الجيدة أعلاه، وأنا أتفق مع ما يقوله هناك. لإضافة إلى ذلك، سأقول إن أحد الأسباب التي جعلتنا نحول المستندات الرسمية ليكون @Discourse هو المؤلف هو منحها إحساسًا أكبر بالسلطة للقراء، وخاصة الأشخاص الذين يزورون المستندات لأول مرة. هذا هو الدافع وراء دليل الأسلوب بأكمله في المقام الأول.

يمكن لأي شخص يكتب وثائق بالتأكيد أن يضفي شخصيته على كتاباته، والمناقشة حول مواضيع المستندات الفردية لن تختفي، لذا فهذا دائمًا مكان جيد لجعل الأمور أكثر شخصية أيضًا.

كل هذه الملاحظات محل تقدير كبير :slight_smile:

إعجابَين (2)

فيما يتعلق بجزء metablock من الدليل. على الرغم من أن مواضيع التوثيق تحتاج إلى واحد وفقًا للدليل أعلاه، إلا أنه ليست كل المواضيع تحتوي على واحد [1] وهي ليست دائمًا متسقة، إليك بعض الأمثلة من بعض الأدلة التي وجدتها.

شخصيًا، أحب “جميع المستخدمين”.

لم أرغب في تغيير هذا في المواضيع قبل جمع بعض التعليقات :smiley:


  1. ربما يعتمد على سياق الموضوع؟ ↩︎

4 إعجابات

جارٍ العمل على جميع وثائق @Discourse وسيتم الانتهاء منها جميعًا على أمل أن يكون هناك وثيقة في وقت ما (:crossed_fingers:). نقطة جيدة حول عدم الاتساق على الرغم من ذلك. لست متأكدًا من أي وثيقة سنستقر عليها، لكننا بالتأكيد سنتأكد من اختيار واحدة والالتزام بها. :slight_smile:

4 إعجابات

يجب أن أضيف أيضًا أنه بالنسبة لأي شيء تراه يتضمن كتلة المعلومات الجديدة، فهذا يعني أنها مرت بـ “المرحلة الأولى” وهي في مرحلة المراجعة - لذا إذا قرأت شيئًا وظننت “هذا ليس صحيحًا” أو “هذا يفتقد بعض المعلومات” وتشعر بالكرم بما يكفي لتقديم بعض الملاحظات، فيرجى إضافة أفكارك إلى منشور. :heart: :slight_smile:

5 إعجابات

ما هو الغرض من معلومات مستوى المستخدم المطلوبة في الأعلى؟ اعتقدت أنها ستوفر معلومات حول ما إذا كانت الوثيقة ذات صلة بي أم لا. حتى أتمكن من قراءتها واتخاذ قرار “أنا لست xxx، لذا فهي غير ذات صلة”.
ولكن يبدو أنه يتم استخدامه بشكل مختلف، لأنه على سبيل المثال، يمكن للمستخدمين الذين تقل رتبتهم عن TL3 تعديل الويكي، لذا فهي ذات صلة بالآخرين أيضًا.

3 إعجابات

شكراً لتسليط الضوء على ذلك يا @Moin - تم تحديث هذا الموضوع لتصحيح مستوى المستخدم المطلوب.

فهمك لما هو الغرض من هذه المعلومات صحيح - يجب أن يوضح مستوى المستخدم أو نوعه القادر على أداء الإجراءات المشروحة في المستند.

إعجاب واحد (1)