Skip to content

Commit

Permalink
chore: udf doc gen
Browse files Browse the repository at this point in the history
simply type `make udf_doc_gen`
  • Loading branch information
aceforeverd committed Aug 22, 2022
1 parent a4e036e commit c480b2d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docs/zh/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
built_in_function_develop_guide
udf_develop_guide
sdk_develop
gen_udf_document.md
6 changes: 3 additions & 3 deletions hybridse/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
9 changes: 7 additions & 2 deletions hybridse/tools/documentation/udf_doxygen/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
17 changes: 16 additions & 1 deletion hybridse/tools/documentation/udf_doxygen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Empty file modified hybridse/tools/documentation/udf_doxygen/export_udf_doc.py
100644 → 100755
Empty file.

0 comments on commit c480b2d

Please sign in to comment.