Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wolfHSM Manual (migration from wolfHSM-docs to wolfssl/documentation) #131

Merged
merged 8 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ wolfSSL/api/
wolfSSL/wolfssl/
wolfTPM/api/
wolfTPM/wolftpm/
wolfHSM/api
wolfHSM/docs/xml
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ RUN apt-get -y install pandoc mkdocs doxygen git build-essential cmake libfmt-de
RUN git clone --depth=1 https://github.com/pantor/inja
RUN cd inja && cmake . -DBUILD_TESTING=OFF -DBUILD_BENCHMARK=OFF && make install

RUN git clone https://github.com/matusnovak/doxybook2
RUN git clone https://github.com/dgarske/doxybook2
# Checkout to working version of doxybook2
RUN cd doxybook2 && git checkout 187dc2991dabe65f808263
RUN cd doxybook2 && git checkout master
RUN cd doxybook2 && cmake . && make install
# Copy the source files into Docker, this and any subsequent steps won't be cached
WORKDIR /src/wolfssl
Expand All @@ -26,15 +26,17 @@ COPY . .
FROM builder AS wolfssl-stage1
ARG MANPATH
ARG PDFFILE
ARG V
WORKDIR /src/wolfssl/${MANPATH}
RUN make pdf
RUN make pdf V=${V}

# Build wolfSSL HTML
FROM wolfssl-stage1 AS wolfssl-stage2
ARG MANPATH
ARG PDFFILE
ARG V
WORKDIR /src/wolfssl/${MANPATH}
RUN make html
RUN make html V=${V}

# Build both wolfSSL HTML and PDF
FROM scratch AS manual
Expand Down
43 changes: 27 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,81 +1,92 @@
DOCKER_CMD=DOCKER_BUILDKIT=1 docker build -t doc_build --build-arg MANPATH=$(MANPATH) --build-arg PDFFILE=$(PDFFILE) --target=manual --output=build -f Dockerfile .
Q?=@
ifeq ($(V),1)
Q=
endif

all: wolfssl wolfssh wolfboot wolfclu wolfcrypt-jni wolfmqtt wolfsentry wolfssl-jni wolftpm wolfengine fips-ready tuning porting
DOCKER_CMD=DOCKER_BUILDKIT=1 docker build -t doc_build --build-arg MANPATH=$(MANPATH) --build-arg PDFFILE=$(PDFFILE) --build-arg V=$(V) --target=manual --output=build -f Dockerfile .

all: wolfssl wolfssh wolfboot wolfclu wolfcrypt-jni wolfmqtt wolfsentry wolfssl-jni wolftpm wolfhsm wolfengine fips-ready tuning porting

build:
@mkdir -p build
$(Q)mkdir -p build

.PHONY: wolfssl
wolfssl: MANPATH=wolfSSL
wolfssl: PDFFILE=wolfSSL-Manual.pdf
wolfssl: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfssh
wolfssh: MANPATH=wolfSSH
wolfssh: PDFFILE=wolfSSH-Manual.pdf
wolfssh: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfboot
wolfboot: MANPATH=wolfBoot
wolfboot: PDFFILE=wolfBoot-Manual.pdf
wolfboot: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfclu
wolfclu: MANPATH=wolfCLU
wolfclu: PDFFILE=wolfCLU-Manual.pdf
wolfclu: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfcrypt-jni
wolfcrypt-jni: MANPATH=wolfCrypt-JNI
wolfcrypt-jni: PDFFILE=wolfCrypt-JNI-JCE-Manual.pdf
wolfcrypt-jni: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfmqtt
wolfmqtt: MANPATH=wolfMQTT
wolfmqtt: PDFFILE=/wolfMQTT-Manual.pdf
wolfmqtt: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfsentry
wolfsentry: MANPATH=wolfSentry
wolfsentry: PDFFILE=wolfSentry-Manual.pdf
wolfsentry: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfssl-jni
wolfssl-jni: MANPATH=wolfSSL-JNI
wolfssl-jni: PDFFILE=wolfSSL-JNI-JSSE-Manual.pdf
wolfssl-jni: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolftpm
wolftpm: MANPATH=wolfTPM
wolftpm: PDFFILE=wolfTPM-Manual.pdf
wolftpm: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: wolfhsm
wolfhsm: MANPATH=wolfHSM
wolfhsm: PDFFILE=wolfHSM-Manual.pdf
wolfhsm: build
$(Q)$(DOCKER_CMD)

.PHONY: wolfengine
wolfengine: MANPATH=wolfEngine
wolfengine: PDFFILE=wolfEngine-Manual.pdf
wolfengine: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: porting
porting: MANPATH=wolfSSL-Porting
porting: PDFFILE=wolfSSL-Porting-Guide.pdf
porting: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: fips-ready
fips-ready: MANPATH=wolfSSL-FIPS-Ready
fips-ready: PDFFILE=wolfSSL-FIPS-Ready.pdf
fips-ready: build
@$(DOCKER_CMD)
$(Q)$(DOCKER_CMD)

.PHONY: tuning
tuning: MANPATH=wolfSSL-Tuning
Expand All @@ -84,4 +95,4 @@ tuning: build
@$(DOCKER_CMD)

clean:
rm -rf build
$(Q)rm -rf build
47 changes: 26 additions & 21 deletions common/common.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# vim: ft=automake

Q?=@
ifeq ($(V),1)
Q=
endif

HTML = html/

ifeq ($(DOC_LANG),JA)
Expand All @@ -16,35 +21,35 @@ endif

.PHONY: builddir
builddir:
@mkdir -p build/pdf
@mkdir -p build/html
$(Q)mkdir -p build/pdf
$(Q)mkdir -p build/html

.PHONY: html-setup
html-setup:
@git submodule update --init
-cd ../mkdocs-material; patch -p1 < $(PATCH) --ignore-whitespace -N
@cp -a $(SRC)/* build/html/
@cp ../common/*.png build/html/
@cp ../common/*.css build/html/
@perl -i -pe 's/ ```/```/g' build/html/*.md
@perl -i -pe "s/\#--/\#-/g" build/html/*.md
@mv build/html/$(word 1,$(SOURCES)) build/html/index.md
$(Q)git submodule update --init
-cd ../mkdocs-material; patch -p1 < $(PATCH) --ignore-whitespace -N
$(Q)cp -a $(SRC)/* build/html/
$(Q)cp ../common/*.png build/html/
$(Q)cp ../common/*.css build/html/
$(Q)perl -i -pe 's/ ```/```/g' build/html/*.md
$(Q)perl -i -pe "s/\#--/\#-/g" build/html/*.md
$(Q)mv build/html/$(word 1,$(SOURCES)) build/html/index.md

.PHONY: html
html: builddir html-setup html-prep
@mkdir -p html
@mkdocs build -f $(MKDOC)
$(Q)mkdir -p html
$(Q)mkdocs build -f $(MKDOC)

.PHONY: pdf-setup
pdf-setup: builddir
@cp -a $(SRC)/* build/pdf/
@cp ../common/*.png build/pdf/
@perl -i -pe "s/chapter[0-9][0-9].md|appendix[0-9][0-9].md//g" build/pdf/*.md
@perl -i -pe "s/\#--/\#/g" build/pdf/*.md
$(Q)cp -a $(SRC)/* build/pdf/
$(Q)cp ../common/*.png build/pdf/
$(Q)perl -i -pe "s/chapter[0-9][0-9].md|appendix[0-9][0-9].md//g" build/pdf/*.md
$(Q)perl -i -pe "s/\#--/\#/g" build/pdf/*.md

.PHONY: pdf
pdf: pdf-setup pdf-prep
@cd build/pdf && pandoc \
$(Q)cd build/pdf && pandoc \
-N \
-s \
--metadata date="`date -I`" \
Expand All @@ -63,16 +68,16 @@ pdf: pdf-setup pdf-prep

.PHONY: serve
serve: builddir html-setup html-prep
@mkdocs serve
$(Q)mkdocs serve

.PHONY: linkcheck
linkcheck:
@$(foreach source_md,$(SOURCES),docker run -v ${CURDIR}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable --config /tmp/test/linkcheck.json /tmp/src/$(source_md) || exit;)
@$(foreach source_md,$(APPENDIX),docker run -v ${CURDIR}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable --config /tmp/test/linkcheck.json /tmp/src/$(source_md) || exit;)
$(Q)$(foreach source_md,$(SOURCES),docker run -v ${CURDIR}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable --config /tmp/test/linkcheck.json /tmp/src/$(source_md) || exit;)
$(Q)$(foreach source_md,$(APPENDIX),docker run -v ${CURDIR}:/tmp:ro --rm -i ghcr.io/tcort/markdown-link-check:stable --config /tmp/test/linkcheck.json /tmp/src/$(source_md) || exit;)

.PHONY: lintcheck
lintcheck:
@docker run -i --rm -v ${CURDIR}:/work tmknom/markdownlint -c /work/test/lintcheck.json /work/src
$(Q)docker run -i --rm -v ${CURDIR}:/work tmknom/markdownlint -c /work/test/lintcheck.json /work/src

.PHONY: test
test: lintcheck linkcheck
Expand Down
2 changes: 1 addition & 1 deletion wolfBoot/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ header-includes:
# Fancy page headers
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2021 wolfSSL Inc.}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2024 wolfSSL Inc.}
# Wrap long syntax highlighting code blocks
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
Expand Down
2 changes: 1 addition & 1 deletion wolfCLU/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ header-includes:
# Fancy page headers
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2022 wolfSSL Inc.}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2024 wolfSSL Inc.}
# Wrap long syntax highlighting code blocks
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
Expand Down
2 changes: 1 addition & 1 deletion wolfCrypt-JNI/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ header-includes:
# Fancy page headers
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2021 wolfSSL Inc.}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2024 wolfSSL Inc.}
# Wrap long syntax highlighting code blocks
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
Expand Down
2 changes: 1 addition & 1 deletion wolfEngine/header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ header-includes:
# Fancy page headers
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2022 wolfSSL Inc.}
- \fancyfoot[LO,RE]{COPYRIGHT \copyright 2024 wolfSSL Inc.}
# Wrap long syntax highlighting code blocks
- \usepackage{fvextra}
- \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,commandchars=\\\{\}}
Expand Down
Loading
Loading