Skip to content

Commit

Permalink
Merge pull request #137 from dgarske/wolfhsm_api
Browse files Browse the repository at this point in the history
Fix for wolfHSM API's in Appendix 01
  • Loading branch information
bigbrett authored Jun 7, 2024
2 parents 551253e + 8623280 commit b76da75
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions wolfHSM/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ api: wolfhsm-update
# 3. Fix the titles of the header files markdown
.PHONY: html-prep
html-prep: api
$(Q)cp src/*.png build/html/
$(Q)cp -a api/md/*8h* build/html/

$(Q)perl -i -pe "s/\[(.*?)\]\(Classes\/.*?.md\)/\[\1\]\(#typedef-\1\)/g" build/html/group* build/html/*8h*
Expand All @@ -55,6 +56,8 @@ html-prep: api
$(Q)perl -i -pe "s/\/tpm2_/tpm2_/g" build/html/group* build/html/*8h*
$(Q)perl -i -pe "s/dox_comments\/header_files\///" build/html/*8h*

$(Q)cat src/appendix01.md build/pdf/wh__*8h*.md > build/html/appendix01.md

# Set input format to gfm to fix issues with converted API docs
# Regexes:
# 1. Indent all headings by one #
Expand All @@ -65,16 +68,21 @@ html-prep: api
# 6. Two regexes to handle bad Doxygen that didn't convert and the LaTeX processor thinks is LaTeX commands
.PHONY: pdf-prep
pdf-prep: api
$(Q)perl -i -pe "s/# /## /g" api/md/*.md
$(Q)perl -i -pe "s/(\/group_.*|Classes\/struct.*|\/.*8h)\.md//g" api/md/*.md
$(Q)perl -i -pe "s/^-(-)+$$//" api/md/*.md
$(Q)perl -i -pe "s/^title:.*//" api/md/*.md
$(Q)perl -i -pe "s/^Updated on.*//" api/md/*.md
$(Q)perl -i -pe "s/^summary.*//" api/md/*.md
$(Q)perl -i -pe "s/dox_comments\/header_files\///" api/md/*.md
$(Q)perl -i -pe "s/^\\\\//" api/md/*.md
$(Q)perl -i -pe "s/\\\\par/par/g" api/md/*.md
$(Q)perl -i -pe "s/\[(.*?)\]\(Classes\/.*?.md\)/\[\1\]\(#typedef-\1\)/g" api/md/*.md
$(Q)perl -i -pe "s/(?<=md\#function\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" api/md/*.md
$(Q)perl -i -pe "s/(?<=md\#typedef\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" api/md/*.md
$(Q)perl -i -pe "s/(?<=md\#enum\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" api/md/*.md
$(Q)cp src/*.png build/pdf/
$(Q)cp -a api/md/*8h* build/pdf/

$(Q)perl -i -pe "s/# /## /g" build/pdf/*.md
$(Q)perl -i -pe "s/(\/group_.*|Classes\/struct.*|\/.*8h)\.md//g" build/pdf/*.md
$(Q)perl -i -pe "s/^-(-)+$$//" build/pdf/*.md
$(Q)perl -i -pe "s/^title:.*//" build/pdf/*.md
$(Q)perl -i -pe "s/^Updated on.*//" build/pdf/*.md
$(Q)perl -i -pe "s/^summary.*//" build/pdf/*.md
$(Q)perl -i -pe "s/dox_comments\/header_files\///" build/pdf/*.md
$(Q)perl -i -pe "s/^\\\\//" build/pdf/*.md
$(Q)perl -i -pe "s/\\\\par/par/g" build/pdf/*.md
$(Q)perl -i -pe "s/\[(.*?)\]\(Classes\/.*?.md\)/\[\1\]\(#typedef-\1\)/g" build/pdf/*.md
$(Q)perl -i -pe "s/(?<=md\#function\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" build/pdf/*.md
$(Q)perl -i -pe "s/(?<=md\#typedef\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" build/pdf/*.md
$(Q)perl -i -pe "s/(?<=md\#enum\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" build/pdf/*.md

$(Q)cat src/appendix01.md build/pdf/wh__*8h*.md > build/pdf/appendix01.md

0 comments on commit b76da75

Please sign in to comment.