Skip to content

Commit 61446a8

Browse files
committed
Add docs to run it locally
1 parent 8cd7bd4 commit 61446a8

File tree

4 files changed

+48
-13
lines changed

4 files changed

+48
-13
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"[markdown]": {
3+
"editor.rulers": [
4+
80
5+
],
6+
}
7+
}

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,40 @@ in a GitHub Action in [`.github/workflows/sync.yml`](.github/workflows/sync.yml)
66

77
The wiki root is [Home.md](./Home.md).
88

9+
You can run this locally if you have ruby installed via:
10+
11+
```sh
12+
# Install the deps
13+
gem install gollum
14+
15+
# Start the server
16+
gollum
17+
```
18+
19+
Then you can open: `http://localhost:4567`
20+
21+
Things to remember:
22+
23+
- Wikis don't support nesting, so filenames have to get a bit wild
24+
25+
```diff
26+
- compiler/testing/fourslash.md
27+
+ compiler-testing-fourslash.md
28+
```
29+
30+
- You can use a custom link syntax for references to TypeScript code which will
31+
be looked up at deploy time:
32+
33+
```
34+
link to [`runFourSlashTest`][0]
35+
36+
[0]: <src/harness/fourslash.ts - function runFourSlashTest(>
37+
```
38+
39+
Will look at the file `src/harness/fourslash.ts` in microsoft/TypeScript to
40+
find the line of code `function runFourSlashTest` and provide a direct link
41+
in the wiki. You can audit them via the script `npm run lint`.
42+
943
# Contributing
1044

1145
This project welcomes contributions and suggestions. Most contributions require you to agree to a

Using-the-Compiler-API-(TypeScript-1.4).md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Getting set up
2-
First you'll need to install TypeScript ==1.4 from `npm`.
2+
3+
First you'll need to install TypeScript 1.4 from `npm`.
34

45
> #### For API Samples compatible with **TypeScript >= 1.5** please see [[Using the Compiler API]]
56
@@ -387,4 +388,4 @@ function format(text: string) {
387388
var code = "var a=function(v:number){return 0+1+2+3;\n}";
388389
var result = format(code);
389390
console.log(result);
390-
```
391+
```

Using-the-Compiler-API.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ First you'll need to install TypeScript >=1.6 from `npm`.
88
Once that's done, you'll need to link it from wherever your project resides.
99
If you don't link from within a Node project, it will just link globally.
1010

11-
```
11+
```sh
1212
npm install -g typescript
1313
npm link typescript
1414
```
1515

1616
You will also need the node definition file for some of these samples.
1717
To acquire the definition file, run:
1818

19-
```
19+
```sh
2020
npm install @types/node
2121
```
2222

@@ -450,10 +450,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
450450
let { line, character } = diagnostic.file.getLineAndCharacterOfPosition(
451451
diagnostic.start!
452452
);
453-
console.log(
454-
` Error ${diagnostic.file.fileName} (${line + 1},${character +
455-
1}): ${message}`
456-
);
453+
console.log(` Error ${diagnostic.file.fileName} (${line + 1},${character +1}): ${message}`);
457454
} else {
458455
console.log(` Error: ${message}`);
459456
}
@@ -464,10 +461,7 @@ function watch(rootFileNames: string[], options: ts.CompilerOptions) {
464461
// Initialize files constituting the program as all .ts files in the current directory
465462
const currentDirectoryFiles = fs
466463
.readdirSync(process.cwd())
467-
.filter(
468-
fileName =>
469-
fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"
470-
);
464+
.filter(fileName => fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts");
471465

472466
// Start the watcher
473467
watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
@@ -640,7 +634,6 @@ function generateDocumentation(
640634

641635
// Get the checker, we will use it to find more about classes
642636
let checker = program.getTypeChecker();
643-
644637
let output: DocEntry[] = [];
645638

646639
// Visit every sourceFile in the program

0 commit comments

Comments
 (0)