cairo-contracts icon indicating copy to clipboard operation
cairo-contracts copied to clipboard

Write down docs styleguide

Open martriay opened this issue 1 year ago • 15 comments

martriay avatar Sep 11 '23 15:09 martriay

  • avoid talking about "us", or the writer as much as possible
  • don’t capitalize Account unless it’s a specific contract/impl

martriay avatar Sep 11 '23 15:09 martriay

  • Don't include argument types in the header sections for Utilities, Functions, and Events, in the API Reference.

ericnordelo avatar Sep 12 '23 12:09 ericnordelo

  • Write the casing name in the casing style e.g. camelCase, snake_case, PascalCase, etc

andrew-fleming avatar Sep 12 '23 14:09 andrew-fleming

  • Write all non-H1 headings in sentence case (only capitalize the first word and proper nouns)

    • For the record, I disagree with this approach. I instead vote for title case in all doc headings because:
      1. Titles of sections are, well, titles and titles should be capitalized IMO.
      2. Consistency with OZ Solidity docs.

andrew-fleming avatar Sep 13 '23 22:09 andrew-fleming

Use "panics" instead of "reverts" or "throws" since it's the appropriate term in Starknet.

martriay avatar Sep 14 '23 21:09 martriay

Add / at the end of directory names to highlight it's a directory. e.g.: my_folder/ instead of my_folder

martriay avatar Sep 15 '23 05:09 martriay

Always scope IDs by the module name in API Reference. Under the ERC20 module section, the name() function should have the ID: ERC20-name

ericnordelo avatar Sep 15 '23 11:09 ericnordelo

Words in html IDs (adoc pages) must be separated by dashes: ERC20-name instead of ERC20::name

ericnordelo avatar Sep 15 '23 11:09 ericnordelo

Write all non-H1 headings in sentence case (only capitalize the first word and proper nouns)

  • For the record, I disagree with this approach. I instead vote for title case in all doc headings because:

    1. Titles of sections are, well, titles and titles should be capitalized IMO.
    2. Consistency with OZ Solidity docs.

where does this rule come from, if you disagree with it?

Always scope IDs by the module name in API Reference. Under the ERC20 module section, the name() function should have the ID: ERC20-name

what do you mean by scope IDs? is this an ascii doc thing?

martriay avatar Sep 15 '23 21:09 martriay

Write all non-H1 headings in sentence case (only capitalize the first word and proper nouns)

  • For the record, I disagree with this approach. I instead vote for title case in all doc headings because:
  • Titles of sections are, well, titles and titles should be capitalized IMO.
  • Consistency with OZ Solidity docs.

where does this rule come from, if you disagree with it?

It's just how the old and forthcoming docs are currently written. There's no rule that I'm aware of

andrew-fleming avatar Sep 15 '23 23:09 andrew-fleming

what do you mean by scope IDs? is this an ascii doc thing?

The ID of the HTML section generated from the adoc file, should be scoped by the module name: have this #Account-supports_interface, instead of just #supports_interface.

[.contract-item]
[[Account-supports_interface]]
...

ericnordelo avatar Sep 18 '23 12:09 ericnordelo

Put SRC5 ID block as a section (similar to Functions and Events) on top at the Interfaces where the ID is usually exposed.

ericnordelo avatar Sep 18 '23 13:09 ericnordelo

Opened the "Consider documenting asserts/guards" discussion separately in its own thread: #745

martriay avatar Sep 22 '23 02:09 martriay

to do: decide what to do regarding duplicating function definitions between interface, component, and function definitions in API docs: see discussions #1, #2, and #3

martriay avatar Mar 01 '24 16:03 martriay