From 31db484ab37a05fa0b9dd7ce14e23cacdf1eae08 Mon Sep 17 00:00:00 2001 From: Georgi Matev Date: Mon, 21 Nov 2022 11:25:40 -0800 Subject: [PATCH] Add `make serve` to serve static build. (#1574) ## Description Add `make serve` to serve static build. ## Type of change - [x] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Test - [ ] :computer: CI/Deployment - [ ] :hamster: Trivial/Minor ## Issue(s) ## Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- docs/Makefile | 5 ++++- docs/README.md | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 01324c49d..efd31343f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,4 +1,4 @@ -.PHONY: buildimage build dev shell check genclidocs _validatemdgen publish sync +.PHONY: buildimage build serve dev shell check genclidocs _validatemdgen publish sync CORSO_BUILD_DIR := /tmp/.corsobuild CORSO_BUILD_CACHE := ${CORSO_BUILD_DIR}/cache @@ -40,6 +40,9 @@ dockershell: build: genclidocs $(DOCSC) npm run build +serve: + $(DOCSC) npm run serve + genclidocs: _validatemdgen ${MDGEN_BINARY} @echo 'Auto-generating Corso CLI docs...' $(DOCSC) rm -rf docs/cli diff --git a/docs/README.md b/docs/README.md index 916d52f84..39f84eb34 100644 --- a/docs/README.md +++ b/docs/README.md @@ -41,6 +41,14 @@ make build This command generates static content into the `build` directory for integration with any static contents hosting service. +## Serving static documentation + +```bash +make serve +``` + +This command will serve the static content generated with `make build` at [http://localhost:3000](http://localhost:3000). + ## Style and linting ```bash