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

Write documentation guidelines #4

Closed
sacha-l opened this issue Jul 27, 2021 · 19 comments
Closed

Write documentation guidelines #4

sacha-l opened this issue Jul 27, 2021 · 19 comments
Labels
team internal 👨‍👩‍👦‍👦 Item to discuss internally and keep track of.

Comments

@sacha-l
Copy link

sacha-l commented Jul 27, 2021

[WIP]
This is an issue to keep track of the items we want to address in our updated contribution guidelines for the new devhub launch.

Components

List all different components: Tip, Advice, Note, Warning, Important
Convention and examples of which instances to use them in
Docs, Tutorials, How-to guides

Full-stops after bullet-points. Convention tbd
TODO: Add link to the different guidelines (htgs, kb docs) here.

@sacha-l
Copy link
Author

sacha-l commented Jul 27, 2021

Add stuff about Message components:

You can use double quotes on the outside, and single quotes inside.

It's essentially mix/match syntax.

<Message
type={gray}
title={Note}
text={"Experienced developers may 'prefer' i've to skip that tutorial and install the Node Template according to the instructions in its readme."}
/>
<Message
type={gray}
title={Note}
text="Experienced developers may 'prefer' i've to skip that tutorial and install the Node Template according to the instructions in its readme."
/>
``

@sacha-l
Copy link
Author

sacha-l commented Jul 27, 2021

Also, for Components that use External links:

<Message
type={yellow}
title={Information}
text={[
'Learn more about ',
<ExternalLink
url={https://substrate.dev/rustdocs/v3.0.0/funty/trait.IsInteger.html#tymethod.wrapping_add}
>
wrapping_add
,
' and ',
<ExternalLink
url={https://substrate.dev/rustdocs/v3.0.0/frame_support/dispatch/trait.Encode.html#method.encode}
>
encode()
,
' in the Rust documentation.',
]}
/>

@sacha-l
Copy link
Author

sacha-l commented Jul 27, 2021

And for bulleted list:

<Message
type={green}
title={Further Learning}
text={`

  • Safety. The mint function takes in an amount to 'mint' which is not good practice because it implies that
    users have unlimited access to writing to storage. Safer approaches include: using configuring 'GenesisConfig' or
    fixing a predetermined maximum value in runtime.
  • Weights. All the weights were set to 10_000 in the above code snippets. Learn more about weight
    configuration in this basic guide on weights.
  • Origins. One assumption this guide makes is that the origin will always be the sudo user.
    Origins are a powerful capability in Substrate. Learn more about how they work
    here.
    `}
    />

NOTE: code block backticks (e.g. on 'mint' and 'GenesisConfig' breaks the mdx.

This was referenced Aug 17, 2021
jimmychu0807 pushed a commit that referenced this issue Aug 21, 2021
@sacha-l sacha-l added the devhub label Aug 22, 2021
@sacha-l
Copy link
Author

sacha-l commented Aug 24, 2021

On links / URLS: We are following a convention where no forward slash at the end of any link or url.

@sacha-l
Copy link
Author

sacha-l commented Aug 26, 2021

Adding Document Objectives in How-to Guides:

<Objectives
  data={[
    {
      title: 'Goal',
      description: 'Define a runtime constant value that becomes reset on `on_finalize`.',
    },
    {
      title: 'Use Cases',
      description:
        `Use a constant to keep track of the amount of times a function is called during a single block cycle.`,
    },
    {
      title: 'Overview',
      description:
        `Declaring a constant value in a runtime is a useful tool to either define fixed values or define values that change dynamically
         according to some factor. This guide steps through the process of creating pallet constants that are used to reset a \`u32\`
         value in storage. This value, we'll call \`SingleValue\`, can also be modified using a method called \`add_value\`.
         The purpose of this guide is to demonstrate the utilty of configuring constants by hardcoding them as well as making them more
         dynamic.`,
    },
  ]}
/>

Note: multi-line and back ticks / back slashes.

@sacha-l
Copy link
Author

sacha-l commented Sep 7, 2021

Note: move components examples and doc guidelines to separate folder.

@sacha-l
Copy link
Author

sacha-l commented Sep 13, 2021

We only use H2 ## Header and H3 ### Header to generate TableOfContents. As in those are the only anchor tags that will show up on the side-bar. Otherwise it crashes.

@jimmychu0807
Copy link

jimmychu0807 commented Sep 19, 2021

I suggest the following:

  1. Abide to the 100 chars a line rule.
  2. Avoid short form english, we'll -> we will.
  3. Title should be capitalized, try this nifty tool.

@sacha-l what do you think?

@sacha-l
Copy link
Author

sacha-l commented Sep 20, 2021

I agree - I'm just not so sure about:

  1. Avoid short form english, we'll -> we will.

Microsoft's guidelines actually encourage using contractions for the sake of having a more engaging and warm tone, which I sort of liked.

I think having @lsgunnlsgunn lean in here will be super helpful - she's currently helping with writing up these guidelines 😊

@sacha-l sacha-l mentioned this issue Sep 22, 2021
@sacha-l
Copy link
Author

sacha-l commented Oct 5, 2021

Add in stuff on Prettier here: #210

@sacha-l
Copy link
Author

sacha-l commented Oct 6, 2021

We should include a link to Substrate's contributing guidelines.

@nuke-web3
Copy link
Contributor

nuke-web3 commented Oct 7, 2021

<Message
type={gray}
title={Note}
text={"Experienced developers may 'prefer' i've to skip that tutorial and install the Node Template according to the instructions in > its readme."}
/>

So we want to enforce that the exact titles are preserved as we have in v3/docs/Examples/Components/index.mdx ?

I actually prefer that we can edit this to really make that title stand out. Here is an example:
image

If we don't want people to change (or have the ability to remove) the title, I would propose we make a new issue (phase-2 or latter) to remove this property and draw that from the type where that was not color, but of the selection note,info,warn,adv,future-reading,... and not have a user defined color.

a note: #231 (comment) fixes the code block rendering

Happy to go with whatever you think is best right now @sacha-l - just indicate yes/no here for custom titles for us 🙏

@lsgunnlsgunn
Copy link
Contributor

lsgunnlsgunn commented Oct 7, 2021 via email

@lsgunnlsgunn
Copy link
Contributor

lsgunnlsgunn commented Oct 7, 2021 via email

@nuke-web3 nuke-web3 added the team internal 👨‍👩‍👦‍👦 Item to discuss internally and keep track of. label Oct 19, 2021
@nuke-web3 nuke-web3 pinned this issue Oct 19, 2021
@sacha-l
Copy link
Author

sacha-l commented Oct 20, 2021

💡 A note to include Substrate's contributing guidelines somehow. Maybe have a separate section referring to this doc for developers wanting to contribute to the codebase.

@sacha-l sacha-l removed the devhub label Oct 29, 2021
@sacha-l
Copy link
Author

sacha-l commented Oct 29, 2021

From Imad's recent PR: #449 (comment)

Steps to Contribute

Docs/HTGs (Adding new .mdx files)

  • Create a New .mdx file(s) in the same folder tree
  • Update DevNavMenu to reflect the addition of pages.

Tutorials (Adding new ones)

  • Create a folder under /v3/tutorials/
  • Create or place index.mdx inside the folder.
  • Make sure to have ALL the following frontmatter defined
---
title: Create your first Substrate blockchain
slug: /tutorials/v3/create-your-first-substrate-chain
hideNav: true
sideNav: firstChain
version: '3.0'
section: tutorials
category: substrate chain
keywords: node template, basics
difficulty: 1
duration: 1 Hour
relevantSkills: 
  - Rust 
  - Blockchain basics
---
  • Update DevNavMenu.tsx and add the menu items for tutorial. NOTE the name MUST match sideNav field in frontmatter.
    Gatsby will do the rest. No need to go into gatsby-config or gatsby-node file.
    🥳

@sacha-l sacha-l removed the doc 📚 label Oct 31, 2021
@nuke-web3
Copy link
Contributor

With #482 - we want to run yarn fmt:docs locally before making any final PR merge, and #500

@nuke-web3
Copy link
Contributor

With Main-md branch launching, we will need to update and add this to the new content

@lisa-parity
Copy link
Contributor

lisa-parity commented Jul 28, 2022

@lisa-parity lisa-parity unpinned this issue Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team internal 👨‍👩‍👦‍👦 Item to discuss internally and keep track of.
Projects
None yet
Development

No branches or pull requests

5 participants