Skip to content
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

Docs Guidelines/How To #74

Open
Blind4Basics opened this issue Jul 18, 2020 · 8 comments
Open

Docs Guidelines/How To #74

Blind4Basics opened this issue Jul 18, 2020 · 8 comments

Comments

@Blind4Basics
Copy link
Contributor

Blind4Basics commented Jul 18, 2020

Centralization of sets of rules to follow or informations when writting docs.

Table of contents:

Technical matters:

Content matters:

Troubleshooting:




General organization / update or create new documents

Generic procedure to follow

For creating new documents:

  1. go to Code
  2. create a new branch
  3. edit the files, create new ones, add folders, ... all that you need
  4. once you're done, go to pull request and create a new one with your new branch
  5. wait (maybe a lot... x) ) for the checks to be done, update if necessary, then wait for feedback of reviewers.
  6. don't forget to update the topics issue, or tags and kinds files to keep track of the things
  7. if you put links to non existing pages yet, create a new issue (labelled ToDo) listing all the links to update later (lines, and related page)

Headers hierarchy

The default hierarachy MUST be precisely followed, because it's used as a base to atuomatically build the ToC.

  • # Page Title: must be unique in the document. This is name of the page
  • ## Section Title
  • ### Subsection Title
  • ...

Note: you cannot make "jumps" in the heirarchy, like forgetting ## on purpose and go straight to ###. This will cause rendering errors.

Sidebar and automatic "table of contents" (ToC)

See for example this page: https://docs.codewars.com/getting-started/registering/

  • The sidebar on the left is created in the gridsome.config.js document, a the root level.

    1. How to create it:
      • create all the needed files first
      • edit gridsome.conifg.js
      • add the sidebar name to the frontmatter of all the related documents
    2. The steps above can actually be done in any order. If something is wrong at some point, the sidebar just doesn't show up in the rendred pages, that's all (hence, it can sometimes be hard to find what the problem actually his... :/ )
    3. Use the paths of the rendered pages on https://docs.codewars.com/, NOT the actual path of the files in the repo. See the section about links.

  • The Table of Content (ToC) is automatically created when the page is rendered according to the headers used in the document. Hence this implies some constraints on those headers/titles:

    1. You have to follow exactly the hierarchy of the headers (see above) otherwise the ToC won't render at all.
    2. You cannot put links markdowns on them (B4B says: if someone finds a way, I'd be happy to update that! XD )
    3. Avoid titles ending with colons or things like that
    4. Choose small titles as much as possible, to avoid things like this... x)



Frontmatter for markdown pages

How to define it

To put at the beginning of the pages, so that the documents are associated with the related "'stuff" (fields are optional):

---
description: ""
kind: reference
topic: markdown
sidebar: docs
prev: /docs/writing-content/
next: /docs/settings/
tags:
  - docc
  - deploy
  - short
---

Warnings:

  • Don't forget the whitespaces after the colons... XD (kind:tutorial doesn't work, but kind: tutaorial does)
  • For info about how to build the sidebar, see here.
  • As any other links perv/next have to be rendered path, not file paths (see links section)

Choosing the right kind of labels for the documentation

See #8 (ext. documentation: https://documentation.divio.com/).


Links to other parts of the documentation

  • External links: just like usual:
    [text](https://...)

  • For links to terms of the glossary, use the following syntax: [text](/glossary/#id), where the id is either the slugified term itself (lowercased string, replacing whitespaces with hyphens) or the id filed if manually defined (code file: glossary ; related issue: Complete the glossary (an ongoing comprehensive (?) list) #23 ).

  • For other internal links to the docs, use the path of the rendered page (not to be confused with the file path!).
    For example, if the Markdown file is at content/foo/bar.md, its (rendered) path is /foo/bar/.
    Exceptions are index.md files: they are treated like index.html so content/foo/index.md is at /foo/.

    file: docs/content/references/markdown/extensions.md
    link; [check the Codewars Mardown extensions](/references/markdown/extensions/)

    file: docs/content/references/markdown/index.md
    link; [check the Mardown reference page](/references/markdown/)

  • Alternative syntax using "references", for internal or external links:
    It's possible to define references so that the complete path of the link doesn't decrease the readability of the text:

    link: [check the Codewars Mardown extensions][mark-ref]
    reference: [mark-ref][/references/markdown/extensions/]
    put preferably all the references at the end of the file (see example here)


If you need to put comments in the file, not visible in the rendered page

Use regular html comments:

<!---sqrtgstg--->


Way of writing

#74 (comment): Inspiration can be taken from Google's developer documentation style guide.

Some points to kee in mind:


Orthograph / choices of words


Screenshots: both light & dark versions

See #71, #85

Pictures can be stored in a subdirectory if needed. Preferably called img if used.
Related code:

<ThemedImage
  alt="Follow Button"
  sources={{
    light: require("./img/follow_light.png").default,
    dark: require("./img/follow_dark.png").default,
  }}
/>


Remark-container to support callouts

See #164

image

Documentation: See https://gridsome.org/plugins/gridsome-plugin-remark-container

Syntax

:::keyword optional_title
some content
:::

Examples of info boxes (that's how they look at the moment of writing, but they can be modified, extended, or styling can be changed), with in order: tip, note, details, important, warning, danger

image




Troubles with the linter/rendering engine

Problems with correct wording considered incorrect by the linter

(related: #7)

If you need to temporarily deactivate the linter (ex: "the data is built in suach a way..." raises an error asking to change for built-in), use this:


<!--- textlint-disable -->

...(your problematic paragraph here)

<!-- textlint-enable -->

or

<!--- For false positive "built in" -->
<!--- textlint-disable terminology -->

...

<!--- textlint-enable terminology -->

Usual mistakes to check when the rendering doesn't work

  • If you get everything in red in the pull request, here are some things to check:

    • Click Details on the result of the linter check to see if some words or expressions are considered invalid (see above)
  • If the linter is ok but not the other checks, verify that

    • the different headers are consistent through the page:
      • you need to have # as title
      • you cannot "jump" in the hierarchy, if you have ###, you must have # and ## somewhere before
  • If all checks are green and the ToC or the sidebar aren't showing up:

@Blind4Basics
Copy link
Contributor Author

Blind4Basics commented Jul 20, 2020

possessive/undetermined formulations? What "tone" should we use?

(don't pay too much attention to the title of the message... translation troubles I have...)

The easiest way of getting started is to use our trainer on the dashboard to pick your next kata.

The easiest way of getting started is to use the trainer on the dashboard to pick your next kata.

=> what option should we use?

  1. whatever we want?
  2. possessive form
  3. undetermined/passive form

I personnaly prefer 3. Because when I see possessive forms, I always associate that with advertising... :o (personnal bias, I guess...)

@kazk
Copy link
Member

kazk commented Jul 20, 2020

It depends, but I'd avoid "our trainer" in this case. It's obvious that it's Codewars' so it's unnecessary.

@kazk

This comment has been minimized.

@Blind4Basics

This comment has been minimized.

@Blind4Basics
Copy link
Contributor Author

to add: #19 (comment)

@hobovsky

This comment has been minimized.

@Blind4Basics
Copy link
Contributor Author

to add: #280

@Blind4Basics
Copy link
Contributor Author

todo: prune these guidelines from what has become useless since the migration to Docusaurus and build a meta/docs-guidelines.md

see #286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants