0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00

Miscellaneous documentation and spelling improvements (#5527)

* Extended/updated documentation on code editor setup and plugins.
* Moved documentation to the right file.
* Fixed spelling errors in documentation and code.
* Updated broken links.

Co-authored-by: 迷渡 <justjavac@gmail.com>
Co-authored-by: AlfieriChou <alfierichou@gmail.com>
Co-authored-by: Anil Seervi <anil13112000@gmail.com
Co-authored-by: Bert Belder <bertbelder@gmail.com>
Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com>
Co-authored-by: József Sallai <jozsef@sallai.me>
Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de>
Co-authored-by: Tommy May <tommymay37@gmail.com>
Co-authored-by: Turbinya <wownucleos@gmail.com>
Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>
This commit is contained in:
Bert Belder 2020-05-17 19:24:39 +02:00 committed by GitHub
parent eddb916883
commit 36fde75d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 47 additions and 34 deletions

View file

@ -184,7 +184,7 @@ static ENV_VARIABLES_HELP: &str = "ENVIRONMENT VARIABLES:
static DENO_HELP: &str = "A secure JavaScript and TypeScript runtime
Docs: https://deno.land/std/manual.md
Docs: https://deno.land/manual
Modules: https://deno.land/std/ https://deno.land/x/
Bugs: https://github.com/denoland/deno/issues
@ -1194,7 +1194,7 @@ fn importmap_arg<'a, 'b>() -> Arg<'a, 'b> {
.long_help(
"UNSTABLE:
Load import map file
Docs: https://deno.land/std/manual.md#import-maps
Docs: https://deno.land/manual/linking_to_external_code/import_maps
Specification: https://wicg.github.io/import-maps/
Examples: https://github.com/WICG/import-maps#the-import-map",
)

View file

@ -1638,9 +1638,9 @@ declare namespace Deno {
bytesReceived: number;
}
/** Receive metrics from the privileged side of Deno. This is primarily used
/** Receive metrics from the privileged side of Deno. This is primarily used
* in the development of Deno. 'Ops', also called 'bindings', are the go-between
* between Deno Javascript and Deno Rust.
* between Deno JavaScript and Deno Rust.
*
* > console.table(Deno.metrics())
*

View file

@ -652,7 +652,7 @@ declare namespace Deno {
/** **UNSTABLE**: new API, yet to be vetted.
*
* `bundle()` is part the compiler API. A full description of this functionality
* can be found in the [manual](https://deno.land/std/manual.md#denobundle).
* can be found in the [manual](https://deno.land/manual/runtime/compiler_apis#denobundle).
*
* Takes a root module name, and optionally a record set of sources. Resolves
* with a single JavaScript string (and bundle diagnostics if issues arise with

View file

@ -128,9 +128,8 @@ pub enum Snapshot {
Boxed(Box<[u8]>),
}
/// Represents data used to initialize isolate at startup
/// either a binary snapshot or a javascript source file
/// in the form of the StartupScript struct.
/// Represents data used to initialize an isolate at startup, either
/// in the form of a binary snapshot or a JavaScript source file.
pub enum StartupData<'a> {
Script(Script<'a>),
Snapshot(Snapshot),
@ -142,7 +141,7 @@ type IsolateErrorHandleFn = dyn FnMut(ErrBox) -> Result<(), ErrBox>;
/// A single execution context of JavaScript. Corresponds roughly to the "Web
/// Worker" concept in the DOM. An CoreIsolate is a Future that can be used with
/// Tokio. The CoreIsolate future complete when there is an error or when all
/// Tokio. The CoreIsolate future completes when there is an error or when all
/// pending ops have completed.
///
/// Ops are created in JavaScript by calling Deno.core.dispatch(), and in Rust

View file

@ -45,8 +45,14 @@ or imports having unnecessary file extensions.
The community has developed extensions for some editors to solve these issues:
- [VS Code](https://marketplace.visualstudio.com/items?itemName=axetroy.vscode-deno)
by [@axetroy](https://github.com/axetroy).
#### VS Code
The beta version of [vscode_deno](https://github.com/denoland/vscode_deno) is
published on the
[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=justjavac.vscode-deno).
Please report any issues.
#### JetBrains IDEs
Support for JetBrains IDEs is not yet available, but you can follow and upvote
these issues to stay up to date:
@ -55,6 +61,14 @@ these issues to stay up to date:
- https://youtrack.jetbrains.com/issue/WEB-42983
- https://youtrack.jetbrains.com/issue/WEB-31667
#### Vim and NeoVim
Vim works fairly well for Deno/TypeScript if you install
[CoC](https://github.com/neoclide/coc.nvim) (intellisense engine and language
server protocol). After CoC itself is installed, from inside Vim, simply run
`:CocInstall coc-deno`. From now on, things like `gd` (go to definition) and
`gr` (goto/find references) should work.
If you don't see your favorite IDE on this list, maybe you can develop an
extension. Our [community Discord group](https://discord.gg/TGMHGv6) can give
you some pointers on where to get started.

View file

@ -66,5 +66,5 @@ got unload event in event handler (main)
```
All listeners added using `window.addEventListener` were run, but
`window.onload` and `window.onunload` defined in `main.ts` overridden handlers
`window.onload` and `window.onunload` defined in `main.ts` overrode handlers
defined in `imported.ts`.

View file

@ -35,7 +35,7 @@ This is very much a work-in-progress. I'm actively soliciting feedback.
format each element according to the format (surrounded by [] and separated by
comma) (`<` Mnemonic: pull each element out of array)
- how to deal with more newfangled Javascript features ( generic Iterables, Map
- how to deal with more newfangled JavaScript features (generic Iterables, Map
and Set types, typed Arrays, ...)
- the implementation is fairly rough around the edges:

View file

@ -4,7 +4,8 @@ fs module is made to provide helpers to manipulate the filesystem.
## Usage
All the following modules are exposed in `mod.ts`
All the following modules are exposed in `mod.ts` This feature is currently
unstable. To enable it use `deno run --unstable`
### emptyDir
@ -59,7 +60,7 @@ ensureSymlink("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // ret
ensureSymlinkSync("./folder/targetFile.dat", "./folder/targetFile.link.dat"); // void
```
### eol
### EOL
Detects and format the passed string for the targeted End Of Line character.
@ -91,21 +92,6 @@ exists("./foo"); // returns a Promise<boolean>
existsSync("./foo"); // returns boolean
```
### globToRegExp
Generate a regex based on glob pattern and options This was meant to be using
the the `fs.walk` function but can be used anywhere else.
```ts
import { globToRegExp } from "https://deno.land/std/fs/mod.ts";
globToRegExp("foo/**/*.json", {
flags: "g",
extended: true,
globstar: true,
}); // returns the regex to find all .json files in the folder foo
```
### move
Moves a file or directory. Overwrites it if option provided

View file

@ -43,7 +43,7 @@ export function emptyDirSync(dir: string): void {
try {
const items = [...readDirSync(dir)];
// if directory already exist. then remove it's child item.
// If the directory exists, remove all entries inside it.
while (items.length) {
const item = items.shift();
if (item && item.name) {

View file

@ -24,7 +24,7 @@ export interface Cookie {
path?: string;
/** Indicates if the cookie is made using SSL & HTTPS. */
secure?: boolean;
/** Indicates that cookie is not accessible via Javascript. **/
/** Indicates that cookie is not accessible via JavaScript. **/
httpOnly?: boolean;
/** Allows servers to assert that a cookie ought not to
* be sent along with cross-site requests. */

View file

@ -67,7 +67,7 @@ export async function readLong(buf: BufReader): Promise<number | null> {
// We probably should provide a similar API that returns BigInt values.
if (big > MAX_SAFE_INTEGER) {
throw new RangeError(
"Long value too big to be represented as a Javascript number."
"Long value too big to be represented as a JavaScript number."
);
}
return Number(big);

View file

@ -1 +0,0 @@
# The manual has moved to //docs

View file

@ -5,3 +5,18 @@ Usage:
```ts
import * as path from "https://deno.land/std/path/mod.ts";
```
### globToRegExp
Generate a regex based on glob pattern and options This was meant to be using
the the `fs.walk` function but can be used anywhere else.
```ts
import { globToRegExp } from "https://deno.land/std/path/glob.ts";
globToRegExp("foo/**/*.json", {
flags: "g",
extended: true,
globstar: true,
}); // returns the regex to find all .json files in the folder foo
```