Skip to content

Commit

Permalink
refactor: update mdbook install and serve
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed Nov 2, 2021
1 parent 0391489 commit 14489c7
Show file tree
Hide file tree
Showing 10 changed files with 385 additions and 160 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cmd/secrets-store-csi-driver/secrets-store-csi-driver
/_output*/
/_output
hack/tools/bin
bin/

# Emacs save files
*~
Expand Down
31 changes: 15 additions & 16 deletions docs/book/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Directories.
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TOOLS_DIR := ../../hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
BIN_DIR := bin
TOOLS_BIN_DIR ?= $(ROOT_DIR)/bin
CRATE_INSTALL := $(realpath ../../third_party/japaric/trust/crate_install.sh)

# Binaries.
TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
$(TABULATE): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-tabulate ./mdbook/tabulate
MDBOOK := $(TOOLS_BIN_DIR)/mdbook
$(MDBOOK):
$(CRATE_INSTALL) --git rust-lang/mdBook --tag v0.4.10 --to $(TOOLS_BIN_DIR) --force

EMBED := $(TOOLS_BIN_DIR)/mdbook-embed
$(EMBED): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-embed ./mdbook/embed
MDBOOK_TOC := $(TOOLS_BIN_DIR)/mdbook-toc
$(MDBOOK_TOC):
$(CRATE_INSTALL) --git badboy/mdbook-toc --tag 0.7.0 --to $(TOOLS_BIN_DIR) --force

RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
$(RELEASELINK): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-releaselink ./mdbook/releaselink
DEPS := $(MDBOOK) $(MDBOOK_TOC)

.PHONY: build
build: $(DEPS)
$(MDBOOK) build

.PHONY: serve
serve:
mdbook serve
serve: $(DEPS)
$(MDBOOK) serve
12 changes: 3 additions & 9 deletions docs/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ authors = ["The Secrets Store CSI Driver Maintainers"]
language = "en"
multilingual = false
src = "src"
title = "The Secrets Store CSI Driver Book"
title = "Secrets Store CSI Driver"

[output.html]
curly-quotes = true
git-repository-url = "https://sigs.k8s.io/secrets-store-csi-driver"

[preprocessor.tabulate]
command = "./util-tabulate.sh"

[preprocessor.embed]
command = "./util-embed.sh"

[preprocessor.releaselink]
command = "./util-releaselink.sh"
[preprocessor.toc]
command = "bin/mdbook-toc"
65 changes: 0 additions & 65 deletions docs/book/install-and-build.sh

This file was deleted.

23 changes: 0 additions & 23 deletions docs/book/util-embed.sh

This file was deleted.

23 changes: 0 additions & 23 deletions docs/book/util-releaselink.sh

This file was deleted.

23 changes: 0 additions & 23 deletions docs/book/util-tabulate.sh

This file was deleted.

2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Netlify build instructions
[build]
command = "./docs/book/install-and-build.sh"
command = "make -C docs/book build"
publish = "docs/book/book"

# Standard Netlify redirects
Expand Down

0 comments on commit 14489c7

Please sign in to comment.