Skip to content

Commit c7f9ebd

Browse files
committed
doc: generate llms.txt
1 parent 5be0bd9 commit c7f9ebd

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ VERSION=v$(RAWVER)
856856

857857
.PHONY: doc-only
858858
.NOTPARALLEL: doc-only
859-
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
859+
doc-only: $(apidoc_dirs) $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json out/doc/llms.txt out/doc/apilinks.json ## Builds the docs with the local or the global Node.js binary.
860860

861861
.PHONY: doc
862862
doc: $(NODE_EXE) doc-only ## Build Node.js, and then build the documentation with the new binary.
@@ -901,6 +901,22 @@ $(apidocs_html) $(apidocs_json) out/doc/api/all.html out/doc/api/all.json &: $(a
901901
fi
902902
endif
903903

904+
out/doc/llms.txt: $(apidoc_sources) tools/doc/node_modules | out/doc
905+
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
906+
echo "Skipping $@ (no crypto and/or no ICU)"; \
907+
else \
908+
$(call available-node, \
909+
$(DOC_KIT) generate \
910+
-t llms-txt \
911+
-i doc/api/*.md \
912+
--ignore $(skip_apidoc_files) \
913+
-o $(@D) \
914+
-c ./CHANGELOG.md \
915+
-v $(VERSION) \
916+
--type-map doc/type-map.json \
917+
) \
918+
fi
919+
904920
out/doc/apilinks.json: $(wildcard lib/*.js) tools/doc/node_modules | out/doc
905921
@if [ "$(shell $(node_use_openssl_and_icu))" != "true" ]; then \
906922
echo "Skipping $@ (no crypto and/or no ICU)"; \

0 commit comments

Comments
 (0)