Skip to content

Commit e76f0ed

Browse files
committed
fixup docs
1 parent 201a3b6 commit e76f0ed

File tree

9 files changed

+36
-157
lines changed

9 files changed

+36
-157
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"scripts": {
1818
"build": "tsc",
1919
"dev": "tsc && qode ./dist/demo.js",
20-
"docs": "typedoc"
20+
"docs": "typedoc && node ./website/docs/scripts/fixdocs.js"
2121
},
2222
"dependencies": {
2323
"@types/react-reconciler": "^0.18.0",

website/docs/api/globals.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ sidebar_label: "Globals"
4343

4444
### Type aliases
4545

46+
* [Allowed](globals.md#allowed)
4647
* [ComboBoxItem](globals.md#comboboxitem)
4748
* [Geometry](globals.md#geometry)
4849
* [GridColumnProps](globals.md#gridcolumnprops)
@@ -52,7 +53,6 @@ sidebar_label: "Globals"
5253
* [KeysOfType](globals.md#keysoftype)
5354
* [NodeGuiReconciler](globals.md#nodeguireconciler)
5455
* [OnlyType](globals.md#onlytype)
55-
* [P](globals.md#p)
5656
* [Position](globals.md#position)
5757
* [Range](globals.md#range)
5858
* [RendererOptions](globals.md#rendereroptions)
@@ -102,6 +102,12 @@ sidebar_label: "Globals"
102102

103103
## Type aliases
104104

105+
### Allowed
106+
107+
Ƭ **Allowed**: *[OnlyType](globals.md#onlytype)‹TItem, [SetParentFunc](globals.md#setparentfunc)‹TParent››*
108+
109+
___
110+
105111
### ComboBoxItem
106112

107113
Ƭ **ComboBoxItem**: *object*
@@ -206,12 +212,6 @@ Show TypeScript that the fields we're interested in are of type `TType`
206212

207213
___
208214

209-
### P
210-
211-
Ƭ **P**: *[OnlyType](globals.md#onlytype)‹TItem, [SetParentFunc](globals.md#setparentfunc)‹TParent››*
212-
213-
___
214-
215215
### Position
216216

217217
Ƭ **Position**: *object*
@@ -699,7 +699,7 @@ ___
699699

700700
### updateDisplacedChildren
701701

702-
**updateDisplacedChildren****TItem**, **TParent**›(`startIndex`: number, `items`: Array‹[DataWithOffset](interfaces/datawithoffset.md)[OnlyType](globals.md#onlytype)‹TItem, number› & [P](globals.md#p)‹TItem, TParent›››, `parent`: TParent, `sizeKey`: keyof OnlyType<TItem, number>, `setParentFuncKey`: keyof P<TItem, TParent>): *void*
702+
**updateDisplacedChildren****TItem**, **TParent**›(`startIndex`: number, `items`: Array‹[DataWithOffset](interfaces/datawithoffset.md)[OnlyType](globals.md#onlytype)‹TItem, number› & [Allowed](globals.md#allowed)‹TItem, TParent›››, `parent`: TParent, `sizeKey`: keyof OnlyType<TItem, number>, `setParentFuncKey`: keyof Allowed<TItem, TParent>): *void*
703703

704704
**Type parameters:**
705705

@@ -712,10 +712,10 @@ ___
712712
Name | Type |
713713
------ | ------ |
714714
`startIndex` | number |
715-
`items` | Array‹[DataWithOffset](interfaces/datawithoffset.md)[OnlyType](globals.md#onlytype)‹TItem, number› & [P](globals.md#p)‹TItem, TParent››› |
715+
`items` | Array‹[DataWithOffset](interfaces/datawithoffset.md)[OnlyType](globals.md#onlytype)‹TItem, number› & [Allowed](globals.md#allowed)‹TItem, TParent››› |
716716
`parent` | TParent |
717717
`sizeKey` | keyof OnlyType<TItem, number> |
718-
`setParentFuncKey` | keyof P<TItem, TParent> |
718+
`setParentFuncKey` | keyof Allowed<TItem, TParent> |
719719

720720
**Returns:** *void*
721721

website/docs/api/index.md

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +0,0 @@
1-
---
2-
id: "index"
3-
title: "@nodegui/react-nodegui"
4-
sidebar_label: "README"
5-
---
6-
7-
# React NodeGui
8-
9-
[![Join the NodeGUI community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/nodegui)
10-
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)
11-
12-
Build **performant**, **native** and **cross-platform** desktop applications with React.🚀
13-
14-
React NodeGUI is powered by **React** ⚛️ and **Qt5** 💚 which makes it CPU and memory efficient as compared to other chromium based solutions like electron. React NodeGUI is essentially a React renderer for [NodeGUI](https://github.com/nodegui/nodegui).
15-
16-
Visit: https://react.nodegui.org for docs.
17-
18-
<img alt="logo" src="https://github.com/nodegui/nodegui/raw/master/extras/logo/nodegui.png" height="200" />
19-
20-
> This project is in active development. It should be okay for smaller projects but anything complex - electron is the way to go for now. 🚧
21-
22-
## How does it look?
23-
24-
<div style="display:inline; margin: 0 auto;">
25-
<img alt="demo_linux" src="https://github.com/nodegui/examples/raw/master/react-nodegui/calculator/calculator_linux.png" height="280" />
26-
<img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/calculator/calculator_win.jpg" height="280" />
27-
<img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/calculator/calculator_mac.png" height="280" />
28-
</div>
29-
30-
<div style="display:inline; margin: 0 auto;"><img alt="kitchen" src="https://github.com/nodegui/nodegui/raw/master/extras/assets/kitchen.png" height="280" /><img alt="demo_mac" src="https://github.com/nodegui/examples/raw/master/react-nodegui/weather-app-widget/weather_widget_mac.png" height="280" /><img alt="demo_win" src="https://github.com/nodegui/examples/raw/master/react-nodegui/image-view/image_view_win.jpg" height="280" />
31-
</div>
32-
33-
**More screenshots?**
34-
35-
[See examples](https://github.com/nodegui/examples/)
36-
37-
## Features
38-
39-
- 🧬 Cross platform. Should work on major Linux flavours, Windows and MacOS
40-
- 📉 Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20mb for a hello world program.
41-
- 💅 Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
42-
- ✅ Complete Nodejs api support (Currently runs on Node v12.x - and is easily upgradable). Hence has access to all nodejs compatible npm modules.
43-
- 🎪 Native widget event listener support. supports all event available from Qt / NodeJs.
44-
- 💸 Can be used for Commercial applications.
45-
- 🕵️‍♂️ Good Devtools support (supports react-devtools, node debugger).
46-
- 📚 Good documentation and website.
47-
- 🧙‍♂️ Good documentation for contributors.
48-
- 🦹🏻‍♀️ Good support for dark mode (Thanks to QT).
49-
- 🏅First class Typescript support. (Works on regular JS projects too 😉).
50-
51-
## Getting Started
52-
53-
- Check out [react-nodegui-starter](https://github.com/nodegui/react-nodegui-starter) to get up and running with your own React NodeGUI app!
54-
- Read through the [docs](https://react.nodegui.org)
55-
56-
**Community Guides**
57-
58-
- https://blog.logrocket.com/electron-alternatives-exploring-nodegui-and-react-nodegui/ - Electron alternatives: Exploring NodeGUI and React NodeGUI by [Siegfried Grimbeek](https://blog.logrocket.com/author/siegfriedgrimbeek/).
59-
60-
**Talks/Podcasts**
61-
62-
- [NodeGui and React NodeGui at KarmaJS Nov 2019 meetup: https://www.youtube.com/watch?v=8jH5gaEEDv4](https://www.youtube.com/watch?v=8jH5gaEEDv4)
63-
64-
- <audio data-theme="night" data-src="https://changelog.com/jsparty/96/embed" src="https://cdn.changelog.com/uploads/jsparty/96/js-party-96.mp3" preload="none" class="changelog-episode" controls></audio><p><a href="https://changelog.com/jsparty/96">JS Party 96: Performant Node desktop apps with NodeGUI</a> – Listen on <a href="https://changelog.com/">Changelog.com</a></p>
65-
66-
## Docs for contributing
67-
68-
Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase. You can start here:
69-
70-
Contributing developer docs link:
71-
72-
https://github.com/nodegui/nodegui/tree/master/website/docs/development
73-
74-
Please read: https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md
75-
76-
## Building
77-
78-
`npm run build [--qt_home_dir=/path/to/qt]`
79-
80-
## Funding
81-
82-
React NodeGUI is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the sponsor button on this Github repo or via Ko-Fi. Alternatively, Issues on React NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.
83-
84-
<p>
85-
<a href='https://ko-fi.com/E1E510AV9' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> &nbsp; &nbsp;
86-
<a href="https://issuehunt.io/r/nodegui/react-nodegui"><img alt="issuehunt" src="https://github.com/BoostIO/issuehunt-materials/raw/master/v1/issuehunt-button-v1.svg?sanitize=true" height="36px" /></a>
87-
</p>
88-
89-
## Special Thanks
90-
91-
- [Logo: Thanks to Vishwas Shetty from the Noun Project.](https://github.com/nodegui/nodegui/blob/master/extras/legal/logo/thanks.md)
92-
93-
## Code of Conduct
94-
95-
https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md
96-
97-
## License
98-
99-
MIT
100-
101-
## Maintainers ✨
102-
103-
People maintaining this project.
104-
105-
<!-- prettier-ignore -->
106-
<table>
107-
<tr>
108-
<td align="center"><a href="https://blog.atulr.com"><img src="https://avatars2.githubusercontent.com/u/4029423?v=4" width="100px;" alt="Atul R"/><br /><sub><b>Atul R</b></sub></a></td>
109-
</tr>
110-
</table>
111-
112-
## Contributors ✨
113-
114-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
115-
116-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
117-
<!-- prettier-ignore-start -->
118-
<!-- markdownlint-disable -->
119-
<table>
120-
<tr>
121-
<td align="center"><a href="http://rahulgaba.com"><img src="https://avatars3.githubusercontent.com/u/7898942?v=4" width="100px;" alt=""/><br /><sub><b>Rahul Gaba</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=rgabs" title="Code">💻</a></td>
122-
<td align="center"><a href="https://github.com/kakulgupta"><img src="https://avatars3.githubusercontent.com/u/10727047?v=4" width="100px;" alt=""/><br /><sub><b>Kakul Gupta</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=kakulgupta" title="Code">💻</a></td>
123-
<td align="center"><a href="https://github.com/Nicify"><img src="https://avatars3.githubusercontent.com/u/24217275?v=4" width="100px;" alt=""/><br /><sub><b>Eva1ent</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=Nicify" title="Code">💻</a></td>
124-
<td align="center"><a href="https://github.com/slidinghotdog"><img src="https://avatars3.githubusercontent.com/u/33790211?v=4" width="100px;" alt=""/><br /><sub><b>slidinghotdog</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=slidinghotdog" title="Code">💻</a></td>
125-
<td align="center"><a href="https://www.linkedin.com/in/roysommer/"><img src="https://avatars2.githubusercontent.com/u/6681893?v=4" width="100px;" alt=""/><br /><sub><b>Roy Sommer</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=illBeRoy" title="Code">💻</a></td>
126-
<td align="center"><a href="https://github.com/nateshmbhat"><img src="https://avatars1.githubusercontent.com/u/23279926?v=4" width="100px;" alt=""/><br /><sub><b>Natesh M Bhat</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=nateshmbhat" title="Documentation">📖</a></td>
127-
<td align="center"><a href="https://www.greatapes.fi"><img src="https://avatars3.githubusercontent.com/u/3404389?v=4" width="100px;" alt=""/><br /><sub><b>Mikko Sairio</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=msairio" title="Code">💻</a></td>
128-
</tr>
129-
<tr>
130-
<td align="center"><a href="https://github.com/shubhamzanwar"><img src="https://avatars0.githubusercontent.com/u/15626155?v=4" width="100px;" alt=""/><br /><sub><b>Shubham Zanwar</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=shubhamzanwar" title="Code">💻</a></td>
131-
<td align="center"><a href="https://matrunchyk.com"><img src="https://avatars0.githubusercontent.com/u/2089828?v=4" width="100px;" alt=""/><br /><sub><b>Serhii Matrunchyk</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=matrunchyk" title="Code">💻</a></td>
132-
<td align="center"><a href="https://github.com/Solant"><img src="https://avatars2.githubusercontent.com/u/5971578?v=4" width="100px;" alt=""/><br /><sub><b>Solant</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=Solant" title="Code">💻</a></td>
133-
<td align="center"><a href="https://cbp.io"><img src="https://avatars1.githubusercontent.com/u/995050?v=4" width="100px;" alt=""/><br /><sub><b>Christian Petersen</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=fnky" title="Code">💻</a></td>
134-
<td align="center"><a href="https://github.com/agg23"><img src="https://avatars1.githubusercontent.com/u/238679?v=4" width="100px;" alt=""/><br /><sub><b>Adam Gastineau</b></sub></a><br /><a href="https://github.com/nodegui/react-nodegui/commits?author=agg23" title="Code">💻</a></td>
135-
</tr>
136-
</table>
137-
138-
<!-- markdownlint-enable -->
139-
<!-- prettier-ignore-end -->
140-
<!-- ALL-CONTRIBUTORS-LIST:END -->
141-
142-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

website/docs/guides/layout.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Flexbox is designed to provide a consistent layout on different screen sizes. Yo
4848

4949
Lets say you want to build a UI that has a parent view which has two child components. One a label with text Hello and another a view with background color white. Now you want the label to occupy 1/3 of the available space while the white colored child view to occupy the remaining 2/3 space.
5050

51-
<img src="https://docs.nodegui.org/img/docs/flex-layout-1.png" alt="flex layout example 1" style={{maxWidth: 700, width:'100%'}}/>
51+
<img src="https://github.com/nodegui/react-nodegui/raw/gh-pages/img/flex-layout-1.png" alt="flex layout example 1" style={{maxWidth: 700, width:'100%'}}/>
5252

5353
The code for that would look something like this:
5454

@@ -155,8 +155,8 @@ Renderer.render(<App />);
155155

156156
The above code produces
157157

158-
<img src="https://react.nodegui.org/img/docs/box-layout-1.png" alt="box layout example 1" style={{maxWidth: 700, width:'100%'}}/>
159-
<img src="https://react.nodegui.org/img/docs/box-layout-2.png" alt="box layout example 1" style={{maxWidth: 700, width:'100%'}}/>
158+
<img src="https://github.com/nodegui/react-nodegui/raw/gh-pages/img/box-layout-1.png" alt="box layout example 1" style={{maxWidth: 700, width:'100%'}}/>
159+
<img src="https://github.com/nodegui/react-nodegui/raw/gh-pages/img/box-layout-2.png" alt="box layout example 1" style={{maxWidth: 700, width:'100%'}}/>
160160

161161

162162
## GridView Layout
@@ -323,7 +323,7 @@ Renderer.render(<App />);
323323

324324
The above code produces
325325

326-
<img src="https://react.nodegui.org/img/docs/grid-layout-1.png" alt="grid layout example 1" style={{maxWidth: 700, width:'100%'}}/>
326+
<img src="https://github.com/nodegui/react-nodegui/raw/gh-pages/img/grid-layout-1.png" alt="grid layout example 1" style={{maxWidth: 700, width:'100%'}}/>
327327

328328

329329

website/docs/scripts/fixdocs.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
async function writeFile(filePath, fileContent) {
5+
return new Promise((resolve, reject) => {
6+
fs.writeFile(filePath, fileContent, (err) => (err ? reject(err) : resolve()));
7+
});
8+
}
9+
10+
async function emptyIndexMd() {
11+
const src = path.resolve(__dirname, `../../../website/docs/api/index.md`);
12+
await writeFile(src, '');
13+
}
14+
15+
async function fixDocs() {
16+
console.log('Fixing Docs...');
17+
await emptyIndexMd();
18+
console.log('Docs fixed successfully.');
19+
}
20+
21+
fixDocs().catch(console.error);

website/static/img/flex-layout-1.png

3.14 KB
Loading

0 commit comments

Comments
 (0)