-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add basic usage to README #980
Conversation
I recently moved all documentation from README to JSDoc comments so that it can be autogenerated as a website. I don't really see an issue with not having install instructions on the README if a link to a docs site is given. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree basic usage instructions should be included in the README. The documentation can/should be used more as an API reference if/when basic usage isn't enough.
What do you mean by basic usage? I'm guess I'm too familiar with the options so everything to me seems like basic usage to me :P |
Essentially what's being added in this PR. |
It's how to use the library quickly to get him to do something that's expected. Just the most basic configuration is fine, probably the effect of a command like 'nwbuild --mode=build', if this command automatically fills in the other default parameters |
I see that, but I recommend removing this line Line 11 in 3e367f3
because keeping the Markdown file allows us to add some extra instructions to it, rather than completely handing it over to the program |
I understand what you mean. This is how I initially managed the docs. I'm trying to automate as many things as I can so that the maintainer(s) after me will have it easier. Right now docs gen is far from what I want it to be but working on making it better. |
@TinsFox I've made a couple of commit suggestions |
I can't see your comment. Did you forget to submit it? |
Ah I think you merged main into the branch which is why the commit suggestions got hidden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the changes here. I have to figure out how to setup docs nicely which I'll do in subsequent PRs.
With npm: | ||
|
||
```shell | ||
npm install nw-builder -D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm install nw-builder -D | |
npm install -D nw-builder |
With yarn: | ||
|
||
```shell | ||
yarn add nw-builder -D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn add nw-builder -D | |
yarn add -D nw-builder |
With pnpm: | ||
|
||
```shell | ||
pnpm add nw-builder -D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pnpm add nw-builder -D | |
pnpm add -D nw-builder |
Here is two way to use nw-build to build your nwjs applications | ||
|
||
### CLI | ||
|
||
1. To get nwjs cache | ||
```bash | ||
nwbuild --mode=get | ||
``` | ||
2. To run nwjs application | ||
```bash | ||
nwbuild --mode=run | ||
``` | ||
3. To build nwjs application | ||
```bash | ||
nwbuild --mode=build | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is two way to use nw-build to build your nwjs applications | |
### CLI | |
1. To get nwjs cache | |
```bash | |
nwbuild --mode=get | |
``` | |
2. To run nwjs application | |
```bash | |
nwbuild --mode=run | |
``` | |
3. To build nwjs application | |
```bash | |
nwbuild --mode=build | |
``` | |
Here are two ways to use nw-builder: | |
### CLI | |
1. To get and cache NW.js: | |
```shell | |
nwbuild --mode=get | |
``` | |
2. To run your NW.js application | |
```shell | |
nwbuild --mode=run | |
``` | |
3. To build your NW.js application | |
```shell | |
nwbuild --mode=build | |
``` |
2. Create a build script | ||
```javascript | ||
// scripts/build.js | ||
const { nwbuild } = require("nw-builder"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { nwbuild } = require("nw-builder"); | |
import { nwbuild } from "nw-builder"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct CJS import does not work. You need to import it via the import("nwbuild")
function call.
version: "latest", | ||
flavor: "normal", | ||
platform: "linux", | ||
arch: "x64", | ||
outDir: "./build", | ||
cache: false, | ||
app: { ... }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version: "latest", | |
flavor: "normal", | |
platform: "linux", | |
arch: "x64", | |
outDir: "./build", | |
cache: false, | |
app: { ... }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we remove these options to match the CLI usage?
Update docs
Description
As a new user, I prefer to see how it was done in the beginning rather than upgrading the documentation. This can feel strange to new users