diff --git a/Makefile b/Makefile index 88654fc2519..cb311bbe6b1 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ endif TEST_TARGET ?= TEST_LEVEL ?= -.PHONY: all coverage coverage-cpp coverage-java build test configure clean thirdparty-fast thirdparty openmldb-clean thirdparty-configure thirdparty-clean thirdpartybuild-clean thirdpartysrc-clean +.PHONY: all coverage coverage-cpp coverage-java build test configure clean thirdparty-fast udf_doc_gen thirdparty openmldb-clean thirdparty-configure thirdparty-clean thirdpartybuild-clean thirdpartysrc-clean all: build @@ -125,6 +125,10 @@ openmldb-clean: rm -rf "$(OPENMLDB_BUILD_DIR)" @cd java && ./mvnw clean +udf_doc_gen: + $(MAKE) build OPENMLDB_BUILD_TARGET=export_udf_info + $(MAKE) -C ./hybridse/tools/documentation/udf_doxygen + THIRD_PARTY_BUILD_DIR ?= $(MAKEFILE_DIR)/.deps THIRD_PARTY_SRC_DIR ?= $(MAKEFILE_DIR)/thirdsrc THIRD_PARTY_DIR ?= $(THIRD_PARTY_BUILD_DIR)/usr diff --git a/docs/zh/developer/index.rst b/docs/zh/developer/index.rst index c89aa3402d9..39400de5c63 100644 --- a/docs/zh/developer/index.rst +++ b/docs/zh/developer/index.rst @@ -10,4 +10,3 @@ built_in_function_develop_guide udf_develop_guide sdk_develop - gen_udf_document.md diff --git a/hybridse/.gitignore b/hybridse/.gitignore index 366f6e645a9..029c7da8f2f 100644 --- a/hybridse/.gitignore +++ b/hybridse/.gitignore @@ -18,6 +18,9 @@ src/hyhridse_version.h # ignore docgen tools/documentation/udf_doxygen/html tools/documentation/udf_doxygen/udfs +tools/documentation/udf_doxygen/udf +tools/documentation/udf_doxygen/udfgen +tools/documentation/udf_doxygen/xml style.xml hybridse_version.h intermediate_cicd_artifact_.tar.gz @@ -35,6 +38,3 @@ tools/documentation/java_api/doxybook2_home tools/documentation/java_api/html tools/documentation/java_api/xml tools/documentation/java_api/java -tools/documentation/udf_doxygen/udf -tools/documentation/udf_doxygen/doxybook2_home -tools/documentation/udf_doxygen/xml diff --git a/hybridse/tools/documentation/udf_doxygen/Makefile b/hybridse/tools/documentation/udf_doxygen/Makefile index 73ed96ceabf..2c659f453c4 100644 --- a/hybridse/tools/documentation/udf_doxygen/Makefile +++ b/hybridse/tools/documentation/udf_doxygen/Makefile @@ -1,7 +1,7 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) MAKEFILE_DIR := $(dir $(MAKEFILE_PATH)) -POETRY_PRG ?= $(shell (command -v poetry || echo poetry)) +POETRY_PRG ?= $(shell (command -v poetry)) DOXYBOOK2_PRG ?= $(shell (command -v doxybook2 || echo doxybook2)) UDF_GEN_DIR ?= $(MAKEFILE_DIR)/udfgen @@ -11,11 +11,16 @@ UDF_GEN_DIR ?= $(MAKEFILE_DIR)/udfgen all: doxygen2md doxygen: - $(POETRY_PRG) run python export_udf_doc.py + if [ -n "$(POETRY_PRG)" ]; then \ + $(POETRY_PRG) run python export_udf_doc.py; \ + else \ + ./export_udf_doc.py; \ + fi doxygen2md: doxygen mkdir -p $(UDF_GEN_DIR) $(DOXYBOOK2_PRG) --input xml --output $(UDF_GEN_DIR) --config config.json --templates ../template --summary-input SUMMARY.md.tmpl --summary-output SUMMARY.md + @echo "udf document write into $(MAKEFILE_DIR)/udfgen/Files/udfs_8h.md" clean: rm -rf xml/ html/ udfs/ $(UDF_GEN_DIR) diff --git a/hybridse/tools/documentation/udf_doxygen/README.md b/hybridse/tools/documentation/udf_doxygen/README.md index 502aa684903..05bf304aed8 100644 --- a/hybridse/tools/documentation/udf_doxygen/README.md +++ b/hybridse/tools/documentation/udf_doxygen/README.md @@ -6,8 +6,23 @@ - [doxygen](https://doxygen.nl/), [doxybook2](https://github.com/matusnovak/doxybook2) installed in host +- [poetry](https://python-poetry.org/) optional + - or have [pyyaml](https://pypi.org/project/PyYAML/) >= 6.0 installed in host + + +## Brief + +Simiply type `make udf_doc_gen` in top directory of OpenMLDB. + +```bash +cd $(git rev-parse --show-toplevel) +make udf_doc_gen +``` + +## Detailed Steps + +Here are the detailed steps inside `make udf_doc_gen`. -## Steps ### 1. Compile export_udf_info ```bash diff --git a/hybridse/tools/documentation/udf_doxygen/export_udf_doc.py b/hybridse/tools/documentation/udf_doxygen/export_udf_doc.py old mode 100644 new mode 100755