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

Documentation: development guidelines #1305

Closed
Tracked by #1290
marcelovicentegc opened this issue Nov 28, 2023 · 1 comment
Closed
Tracked by #1290

Documentation: development guidelines #1305

marcelovicentegc opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@marcelovicentegc
Copy link
Member

marcelovicentegc commented Nov 28, 2023

The goal of this PR is to create an internal documentation regarding how developers should document components and methods from any of our packages.

It's a complementary action that follows up on:

And which end goal is to make sure that our docs remain concise and with plenty of examples, culminating on the implementation of linting rules for our guidelines, as described in:

A couple of guideline examples

  • We must make sure to document components and each of their props correctly, preferentially following the pattern of a component that is already well documented, such as the Button.
  • Let's make the best usage from typedoc tags (https://typedoc.org/guides/tags/).
  • All @example tags are used to generate a playground, so let's be careful with its usage, which should be documented somewhere and possibly have linting rules setup for typedocs.

Good documentation example

/**
 * Buttons triggers allow users to identify and start the most important actions in a container.
 *
 * @example
 * <Button>Action label</Button>
 */
export function Button(props: ButtonProps) {
    const {
        children,
        size = 'normal',
        variant = 'secondary',
        ...rest
    } = props

    return <button data-size={size} data-variant={variant} {...rest}>{children}</button>
}

interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
    /**
     * The size of the button.
     *
     * @default 'normal'
     */
    size?: 'small' | 'normal' | 'large'
    /**
     * The variant of the button.
     *
     * @default 'secondary'
     */
    variant?: 'primary' | 'secondary' | 'tertiary'
}
@marcelovicentegc marcelovicentegc added the documentation Improvements or additions to documentation label Nov 28, 2023
@marcelovicentegc marcelovicentegc self-assigned this Dec 7, 2023
@davicostalf davicostalf changed the title Documentation development guidelines Documentation: development guidelines Feb 9, 2024
@beatrizmilhomem
Copy link
Contributor

Has the InnerSource engineering documentation already addressed this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Done
Development

No branches or pull requests

3 participants