sveltedoc-parser icon indicating copy to clipboard operation
sveltedoc-parser copied to clipboard

Add examples with ideal component documentation

Open alexprey opened this issue 4 years ago • 7 comments

Add few examples of what document structure can be parsed by this package

alexprey avatar Aug 16 '20 08:08 alexprey

Shall I make a basic template? I do not know the full extent of sveltedoc-parser.

TheComputerM avatar Aug 19 '20 10:08 TheComputerM

@TheComputerM Thanks!

One small note for your component docs

@type {button|reset|submit}

This statement means that you have types button, reset, submit. However, you pass the string values for this prop, so you should write comment in the following format (just provide commas):

@type {'button'|'reset'|'submit'}

And then in output you should have following:

"type": [
          {
            "kind": "type",
            "text": "x-small",
            "type": "string"
          },
          {
            "kind": "type",
            "text": "small",
            "type": "string"
          },

alexprey avatar Aug 19 '20 15:08 alexprey

When I use string values like you say, I get the output:

"type": [
          {
            "kind": "type",
            "text": "'x-small'",
            "type": "string"
          },
          {
            "kind": "type",
            "text": "'small'",
            "type": "string"
          },

TheComputerM avatar Aug 19 '20 15:08 TheComputerM

Yes, this format is a correct, I'm forgot about quotes in text property

alexprey avatar Aug 19 '20 15:08 alexprey

In this commit I'm prepare base for writing examples of components and parsed document structure.

alexprey avatar Aug 19 '20 17:08 alexprey

Nice

TheComputerM avatar Aug 19 '20 17:08 TheComputerM