React-native-paper: put all Typography components in a group in documentation

Created on 25 Jan 2019  路  4Comments  路  Source: callstack/react-native-paper


Current behaviour


Typography components are in seperate headings in docs

Expected behaviour


They should be grouped together

Code sample

Screenshots (if applicable)

What have you tried

Your Environment

docs good first task

Most helpful comment

@satya164 Done! 馃殌 See PR #1221 馃槃 Let me know what you think

All 4 comments

Agreed. I suggest we put these under a Typography heading and provide an example of each. See closed task at https://github.com/callstack/react-native-paper/issues/532 for a screenshot.

As a beginner, this is also a bit weird to find the typography spread out over the docs menu. But, I sure want to help with this! I think there are several approaches to this, not sure if there are others or which one is the best one. 馃槃

  1. Hardcode typography as a group in docs/component-docs.config.js.
    This is probably not the "desired approach". It works, kind of, but you put references to the contents in a "global" config file. Which shouldn't need to know about this, right?

    You can check on the component folder name for example. In this case, Typography and group them based on that.

  2. Create an "extra" file to Typography, just like src/Components/Avatar/Avatar.tsx.
    I'm not sure how the avatar works, but it seems a bit similar. They are both similar-structured, so I thought that might work as well.

  3. Add a new @component-group <name> annotation (or something named similar)
    Personally, I like this approach the most. With that, you can simply add @component-group to the components you want to group and give them similar names. I think it matches the current distributed documentation within the components perfectly.


If any of these approaches sound like something anyone likes or want, I can try and make a PR 馃槃

@byCedric I like the annotation approach too. Will be awesome if you can make PR :D

@satya164 Done! 馃殌 See PR #1221 馃槃 Let me know what you think

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yaronlevi picture yaronlevi  路  3Comments

kpervin picture kpervin  路  3Comments

tonyxiao picture tonyxiao  路  3Comments

zxccvvv picture zxccvvv  路  4Comments

scottybo picture scottybo  路  3Comments