Update README.md
Removed extra space and updated readme to have heading and sub heading
This commit is contained in:
parent
f35b9003fe
commit
ed18749fda
27
README.md
27
README.md
|
@ -1,11 +1,12 @@
|
||||||
# Y—Catalog-Viewer
|
# Y—Catalog-Viewer
|
||||||
A standalone catalog viewer package that intelligently displays design components.
|
A standalone catalog viewer package that intelligently displays design components.
|
||||||
|
|
||||||
|
Usage
|
||||||
### Sample code to display built-in components
|
----------
|
||||||
|
|
||||||
A user can use built-in components like Icon Category, Font Category, and Color Category to display icons, fonts, and colors respectively.
|
A user can use built-in components like Icon Category, Font Category, and Color Category to display icons, fonts, and colors respectively.
|
||||||
|
|
||||||
|
|
||||||
|
### Icon Category
|
||||||
For example, a user can create an icon category as follows:
|
For example, a user can create an icon category as follows:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -30,11 +31,12 @@ where the user needs to provide the following parameters:
|
||||||
* The title for the image.
|
* The title for the image.
|
||||||
* The image to display.
|
* The image to display.
|
||||||
* The detail label which is an optional parameter, allows a user to include additional details about the image if needed.
|
* The detail label which is an optional parameter, allows a user to include additional details about the image if needed.
|
||||||
* The axis attribute which is an optional parameter with which a user can decide whether they want to display the title, details, and image to be displayed vertically or horizontally.
|
* The axis attribute which is an optional parameter with which a user can decide whether they want to display the title, details, and image to be displayed vertically or horizontally.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Font Category
|
||||||
a user can create a font category as follows:
|
a user can create a font category as follows:
|
||||||
```
|
```
|
||||||
enum FontSample {
|
enum FontSample {
|
||||||
|
@ -53,19 +55,19 @@ enum FontSample {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
where the user needs to provide the following parameters:
|
where the user needs to provide the following parameters:
|
||||||
* The name of the category.
|
* The name of the category.
|
||||||
* Model for the font to be displayed, which again includes:
|
* Model for the font to be displayed, which again includes:
|
||||||
* The title for the font.
|
* The title for the font.
|
||||||
* The font to display.
|
* The font to display.
|
||||||
* The detail label which is an optional parameter, allows a user to display additional details if needed.
|
* The detail label which is an optional parameter, allows a user to display additional details if needed.
|
||||||
* The axis attribute which is an optional parameter with which a user can decide whether they want to display the title and details to be displayed vertically or horizontally.
|
* The axis attribute which is an optional parameter with which a user can decide whether they want to display the title and details to be displayed vertically or horizontally.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Color category
|
||||||
a user can create a color category as follows:
|
a user can create a color category as follows:
|
||||||
```
|
```
|
||||||
enum ColorSample {
|
enum ColorSample {
|
||||||
|
@ -95,6 +97,7 @@ where the user needs to provide the following parameters:
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Catalog Category
|
||||||
We can create a category which contains other categories.
|
We can create a category which contains other categories.
|
||||||
```
|
```
|
||||||
let foundationalCategory = CatalogCategory(
|
let foundationalCategory = CatalogCategory(
|
||||||
|
@ -113,10 +116,7 @@ We can create a category which contains other categories.
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### Sample code to display Custom Components
|
### Custom Component Category
|
||||||
|
|
||||||
We can use Custom Category to display components like buttons, views within design system
|
|
||||||
|
|
||||||
Suppose a user wants to display a button named DemoButton from their project.
|
Suppose a user wants to display a button named DemoButton from their project.
|
||||||
```
|
```
|
||||||
enum DemoButtonSample {
|
enum DemoButtonSample {
|
||||||
|
@ -144,6 +144,7 @@ enum DemoButtonSample {
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Custom View Category
|
||||||
We can display a custom view within the catalog.
|
We can display a custom view within the catalog.
|
||||||
Suppose a user wants to display a custom view named DemoView from their project.
|
Suppose a user wants to display a custom view named DemoView from their project.
|
||||||
```
|
```
|
||||||
|
@ -161,7 +162,6 @@ enum DemoButtonSample {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
where the user needs to provide the following parameters:
|
where the user needs to provide the following parameters:
|
||||||
* name for the category.
|
* name for the category.
|
||||||
|
@ -170,6 +170,7 @@ enum DemoButtonSample {
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
### Custom View Controller category
|
||||||
We can display view controllers in the catalog
|
We can display view controllers in the catalog
|
||||||
1. First create a custom destination that returns the view controller
|
1. First create a custom destination that returns the view controller
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue