Skip to content

Commit c53fa8c

Browse files
32penkinartyorsh
authored andcommitted
feat(docs): add documentation images
1 parent 870d57d commit c53fa8c

File tree

85 files changed

+5949
-3151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5949
-3151
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
137137
138138
## <a name="run"></a> Run playground
139139
140-
React-native-ui-kitten contains playground module which allows you to debug quickly your changes.
140+
react-native-ui-kitten contains playground module which allows you to debug quickly your changes.
141141
See the project in [playground directory](src/playground).
142142
To run it you should:
143143
* Clone this repo

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We do what we did before but in a new way.
77

88
## What's new will you have:
99
- TypeScript support
10-
- Full test coverage of framework
10+
- Full test coverage of the framework
1111
- Better code quality
1212
- Better development environment for contributors
1313
- Better theme system

docs/package-lock.json

Lines changed: 209 additions & 186 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/app/@theme/services/structure.service.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,27 @@ export class NgdStructureService {
8686
});
8787
}
8888

89-
protected getComponents(item: any, preparedDocs) {
89+
protected getComponents(item: any, preparedDocs: any) {
9090
return item.source
9191
.map(source => preparedDocs.classes.find((data) => data.name === source))
92-
.map(component => this.prepareComponent(component));
92+
.map(component => this.prepareComponent(component, item));
9393
}
9494

95-
protected prepareComponent(component: any) {
95+
protected prepareComponent(component: any, structureItem?: any) {
9696
const textNodes = component.overview.filter(node => node.type === 'text');
9797
if (textNodes && textNodes.length) {
9898
textNodes[0].content = `## ${component.name}\n\n${textNodes[0].content}`; // TODO: this is bad
9999
}
100+
101+
let images: string[] = [];
102+
if (structureItem && structureItem.overview) {
103+
const imagesObj: any = structureItem.overview
104+
.find((item: any) => item.name === component.name);
105+
images = imagesObj ? imagesObj.images : [];
106+
}
107+
100108
return {
101-
... component,
109+
...component,
102110
slag: this.textService.createSlag(component.name),
103111
overview: component.overview.map((node: any) => {
104112
if (node.type === 'text') {
@@ -109,6 +117,7 @@ export class NgdStructureService {
109117
}
110118
return node;
111119
}),
120+
images: images,
112121
};
113122
}
114123

@@ -137,7 +146,7 @@ export class NgdStructureService {
137146
return {
138147
title: block.source.name,
139148
fragment: block.source.slag,
140-
}
149+
};
141150
}
142151

143152
protected getTocForTabbed(block: any) {

docs/src/app/blocks/components/overview-block/overview-block.component.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ import {
1717
<nb-card-body>
1818
<ng-container class="description">
1919
<ng-container>
20-
<div [innerHTML]="source.description"></div>
20+
<div [innerHTML]="source.description"
21+
[ngStyle]="hasImage && {'margin-bottom': '16px'}"></div>
22+
<img
23+
*ngFor="let image of source.images"
24+
src={{image}}
25+
/>
2126
</ng-container>
2227
</ng-container>
2328
</nb-card-body>
@@ -28,10 +33,18 @@ import {
2833
export class NgdOverviewBlockComponent {
2934

3035
source: any;
36+
hasImage: boolean;
3137

3238
@Input('source')
3339
set setSource(source: any) {
34-
this.source = source;
40+
this.source = this.prepareDescription(source);
41+
this.hasImage = this.source.images.length && this.source.images.length !== 0;
42+
}
43+
44+
private prepareDescription(source): any {
45+
source.description = source.description.replace('undefined', '');
46+
source.images = source.images.map((image: string) => `../../../assets/images/overview/${image}`);
47+
return source;
3548
}
3649

3750
}

docs/src/app/documentation/page/page.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,10 @@
227227

228228
@include media-breakpoint-up(md) {
229229
.middle-column ::ng-deep nb-card nb-card-body {
230-
padding: 2rem 3rem 2rem 2rem;
230+
padding: 2rem 2rem 2rem 2rem;
231+
}
232+
::ng-deep nb-card nb-card-header {
233+
padding: 1rem 2rem;
231234
}
232235
}
233236

Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 21 additions & 0 deletions
Loading
Lines changed: 24 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)