diff --git a/docs/README.md b/docs/README.md index dbd7fe53..682903d7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,11 +16,13 @@ This document is intended to help you build the documentation that will eventual These steps should help you to build the documentation 0. Clone the repository, open a terminal, and `cd` into the repository directory -1. Create a virtual environment and install all dependencies: - - `python -m venv venv` - - `python -m pip install -r docs/requirements.txt` -2. On the terminal, navigate to the docs folder and run `make html` - - `cd docs` - - `make html` -3. On the file explorer, navigate to the `/docs/build/html/` directory -4. Open the `index.html` in a browser. \ No newline at end of file +1. Install project dependencies: + - `npm install` +2. Create a virtual environment: + - `npm run env:create` +3. Activate the virtual environment: + - `npm run env:activate` +4. Install the doc dependencies + - `npm run doc:install` +5. Build and open the documentation: + - `npm run doc:dev` diff --git a/package-lock.json b/package-lock.json index 7c2e7b13..211aee08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,11 +5,11 @@ "packages": { "": { "name": "zowe-client-python-sdk", - "hasInstallScript": true, "license": "EPL-2.0", "devDependencies": { "opener": "^1.5.2", - "rimraf": "^6.0.1" + "rimraf": "^6.0.1", + "run-script-os": "^1.1.6" } }, "node_modules/@isaacs/cliui": { @@ -296,6 +296,17 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-script-os": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/run-script-os/-/run-script-os-1.1.6.tgz", + "integrity": "sha512-ql6P2LzhBTTDfzKts+Qo4H94VUKpxKDFz6QxxwaUZN0mwvi7L3lpOI7BqPCq7lgDh3XLl0dpeXwfcVIitlrYrw==", + "dev": true, + "license": "MIT", + "bin": { + "run-os": "index.js", + "run-script-os": "index.js" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index 6592b3df..3f12dbcc 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "test": "tests" }, "scripts": { - "postinstall": "npm run src:install && npm run doc:install", "src:install": "python -m pip install -r requirements.txt", "src:pydocstyle": "pydocstyle --match-dir='^(?!(build|response)$).*' --match='^(?!(__init__\\.py|setup\\.py$)).*\\.py$' src", "src:pydoclint": "pydoclint --exclude='.*/(build|response)/.*' src", @@ -19,10 +18,15 @@ "src:test:pytest": "coverage run -m pytest ./tests/unit", "src:test:xml": "coverage xml", "doc:install": "python -m pip install -r docs/requirements.txt", + "doc:dev": "npm run doc:clean && npm run doc:build && npm run doc:open", "doc:build": "cd docs && make html", + "doc:clean": "cd docs && make clean", "doc:open": "opener docs/build/html/index.html", "env:create": "python -m venv env", - "env:delete": "deactivate && rimraf env" + "env:active": "run-script-os", + "env:active:win32": "echo 'To activate, run the following command:\n\nenv\\Scripts\\activate\n\nTo deactivate, simply run:\n\ndeactivate\n'", + "env:active:default": "echo 'To activate, run the following command:\n\nsource env/bin/activate\n\nTo deactivate, simply run:\n\ndeactivate\n'", + "env:delete": "rimraf env" }, "repository": { "type": "git", @@ -41,6 +45,7 @@ "homepage": "https://github.com/zowe/zowe-client-python-sdk#readme", "devDependencies": { "opener": "^1.5.2", - "rimraf": "^6.0.1" + "rimraf": "^6.0.1", + "run-script-os": "^1.1.6" } }