diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md index b316cd2eb..727b78e5a 100644 --- a/DevelopmentWorkflow.md +++ b/DevelopmentWorkflow.md @@ -89,3 +89,14 @@ npm run dev-declarations ``` This script will update the iOS declarations. Android tools are not integrated yet. The declarations are generated from the test app and will include the native code from tns-core-modules-widgets. + +# Documentation API reference +The following will build the API reference pages in `bin/dist/apiref`: +``` +npm run typedoc +``` +If you want to improve on the documentation you can also build and start up dev web server: +``` +npm run dev-typedoc +``` +The terminal will point the address you can open in your web browsed. diff --git a/gruntfile.js b/gruntfile.js index 35dba7957..01fd941df 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -420,9 +420,10 @@ module.exports = function(grunt) { "name": 'NativeScript', "includeDeclarations": undefined, "experimentalDecorators": undefined, - "mode": "file" + "mode": "file", + "tsconfig": "tsconfig.typedoc.json" }, - src: localCfg.srcTsdFiles + src: "tns-core-modules/tns-core-modules.d.ts" } } }); diff --git a/package.json b/package.json index 1846e2e77..3008824d6 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "shelljs": "^0.7.0", "time-grunt": "1.3.0", "tslint": "3.4.0", + "typedoc": "0.4.5", "typescript": "^2.0.3" }, "scripts": { @@ -50,6 +51,8 @@ "test-ios": "tns run ios --path tests --justlaunch", "test-watch-android": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync android --path tests --watch\"", "test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"", - "prepublish": "echo \"Development reminder: npm run setup\n\"" + "prepublish": "echo \"Development reminder: npm run setup\n\"", + "typedoc": "typedoc --tsconfig tsconfig.typedoc.json --out bin/dist/apiref --mode file --includeDeclarations --name NativeScript --theme ./node_modules/nativescript-typedoc-theme", + "dev-typedoc": "npm run typedoc && cd bin/dist/apiref && http-server" } } diff --git a/tsconfig.typedoc.json b/tsconfig.typedoc.json new file mode 100644 index 000000000..6de92b5c3 --- /dev/null +++ b/tsconfig.typedoc.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "noEmitOnError": true, + "noEmitHelpers": true, + "target": "es5", + "module": "commonjs", + "declaration": false, + "noImplicitAny": false, + "noImplicitUseStrict": true, + "experimentalDecorators": true + }, + "files": [ + "tns-core-modules/tns-core-modules.d.ts" + ] +}