From 6ae22543165088fadc9afc2d7bbeac4406f97ac7 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 2 Jan 2024 14:43:42 +0000 Subject: [PATCH 1/3] Move out language native doc generation to bazel_distribution --- WORKSPACE | 22 ++--- cpp/BUILD | 3 +- cpp/docs/common/typedefs.adoc | 62 +++++++------- dependencies/vaticle/repositories.bzl | 2 +- java/BUILD | 2 +- nodejs/BUILD | 2 +- python/BUILD | 4 +- python/tool/sphinx/BUILD | 42 --------- python/tool/sphinx/rules.bzl | 84 ------------------ python/tool/sphinx/sphinx_html_builder.py | 37 -------- rust/BUILD | 2 +- tool/docs/cpp/doxyfile.template | 100 ---------------------- tool/docs/cpp/rules.bzl | 81 ------------------ 13 files changed, 49 insertions(+), 394 deletions(-) delete mode 100644 python/tool/sphinx/BUILD delete mode 100644 python/tool/sphinx/rules.bzl delete mode 100644 python/tool/sphinx/sphinx_html_builder.py delete mode 100644 tool/docs/cpp/doxyfile.template diff --git a/WORKSPACE b/WORKSPACE index 7dabe9d580..e81625dee7 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -123,17 +123,6 @@ sonarcloud_dependencies() load("@vaticle_dependencies//tool/unuseddeps:deps.bzl", unuseddeps_deps = "deps") unuseddeps_deps() -# Load //tool/docs -load("@vaticle_dependencies//tool/docs:python_deps.bzl", docs_deps = "deps") -docs_deps() -load("@vaticle_dependencies_tool_docs//:requirements.bzl", install_doc_deps = "install_deps") -install_doc_deps() - -load("@vaticle_dependencies//tool/docs:java_deps.bzl", java_doc_deps = "deps") -java_doc_deps() -load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules") -google_common_workspace_rules() - #################################### # Load @vaticle_bazel_distribution # #################################### @@ -157,6 +146,17 @@ pip_deps() load("@vaticle_bazel_distribution_pip//:requirements.bzl", install_pip_deps = "install_deps") install_pip_deps() +# Load //docs +load("@vaticle_bazel_distribution//docs:python/deps.bzl", docs_deps = "deps") +docs_deps() +load("@vaticle_dependencies_tool_docs//:requirements.bzl", install_doc_deps = "install_deps") +install_doc_deps() + +load("@vaticle_bazel_distribution//docs:java/deps.bzl", java_doc_deps = "deps") +java_doc_deps() +load("@google_bazel_common//:workspace_defs.bzl", "google_common_workspace_rules") +google_common_workspace_rules() + ###################################### # Load @vaticle_typedb_driver_python # ###################################### diff --git a/cpp/BUILD b/cpp/BUILD index 7d7fcd1d2c..0687617da0 100644 --- a/cpp/BUILD +++ b/cpp/BUILD @@ -21,15 +21,16 @@ load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load("@vaticle_dependencies//builder/cpp:rules.bzl", "clang_format_test") load("@vaticle_bazel_distribution//common:rules.bzl", "assemble_targz", "assemble_zip", "checksum", "assemble_versioned") +load("@vaticle_bazel_distribution//docs:cpp/rules.bzl", "doxygen_docs") load("@vaticle_bazel_distribution//artifact:rules.bzl", "deploy_artifact") load("@vaticle_dependencies//distribution:deployment.bzl", "deployment") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix") load("@vaticle_bazel_distribution//platform:constraints.bzl", "constraint_linux_arm64", "constraint_linux_x86_64", "constraint_mac_arm64", "constraint_mac_x86_64", "constraint_win_x86_64") -load("//tool/docs:cpp/rules.bzl", "doxygen_docs", "doxygen_to_adoc") load(":build_opts.bzl", "cxxopts") load("//cpp:docs_structure.bzl", "dir_mapping") +load("//tool/docs:cpp/rules.bzl", "doxygen_to_adoc") pkg_files( name = "typedb-driver-cpp-headers", diff --git a/cpp/docs/common/typedefs.adoc b/cpp/docs/common/typedefs.adoc index 9548a0d85e..08ecefef86 100644 --- a/cpp/docs/common/typedefs.adoc +++ b/cpp/docs/common/typedefs.adoc @@ -1,42 +1,42 @@ [#_ConceptMapIterator] === ConceptMapIterator -Alias for Iterator<_native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap> +Alias for Iterator< _native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap > [#_ConceptMapIterable] === ConceptMapIterable -Alias for Iterable<_native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap> +Alias for Iterable< _native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap > [#_ConceptMapGroupIterable] === ConceptMapGroupIterable -Alias for Iterable<_native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup> +Alias for Iterable< _native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup > [#_ConceptMapGroupIterator] === ConceptMapGroupIterator -Alias for Iterator<_native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup> +Alias for Iterator< _native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup > [#_OwnerAttributePairIterator] === OwnerAttributePairIterator -Alias for Iterator<_native::StringPairIterator, _native::StringPair, OwnerAttributePair> +Alias for Iterator< _native::StringPairIterator, _native::StringPair, OwnerAttributePair > [#_OwnerAttributePairIterable] === OwnerAttributePairIterable -Alias for Iterable<_native::StringPairIterator, _native::StringPair, OwnerAttributePair> +Alias for Iterable< _native::StringPairIterator, _native::StringPair, OwnerAttributePair > [#_JSONMap] === JSONMap -Alias for std::map +Alias for std::map< std::string, JSON > [#_JSONArray] === JSONArray -Alias for std::vector +Alias for std::vector< JSON > [#_JSONBoolean] === JSONBoolean @@ -61,52 +61,52 @@ Alias for std::string [#_AggregateResult] === AggregateResult -Alias for std::optional> +Alias for std::optional< std::unique_ptr< Value > > [#_AggregateFuture] === AggregateFuture -Alias for Future +Alias for Future< AggregateResult, _native::ConceptPromise > [#_ValueGroupIterable] === ValueGroupIterable -Alias for Iterable<_native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup> +Alias for Iterable< _native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup > [#_ValueGroupIterator] === ValueGroupIterator -Alias for Iterator<_native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup> +Alias for Iterator< _native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup > [#_VoidFuture] === VoidFuture -Alias for Future +Alias for Future< void, _native::VoidPromise > [#_BoolFuture] === BoolFuture -Alias for Future +Alias for Future< bool, _native::BoolPromise > [#_StringFuture] === StringFuture -Alias for Future +Alias for Future< std::string, _native::StringPromise > [#_OptionalStringFuture] === OptionalStringFuture -Alias for Future, _native::StringPromise> +Alias for Future< std::optional< std::string >, _native::StringPromise > [#_StringIterable] === StringIterable -Alias for Iterable<_native::StringIterator, char, std::string> +Alias for Iterable< _native::StringIterator, char, std::string > [#_StringIterator] === StringIterator -Alias for Iterator<_native::StringIterator, char, std::string> +Alias for Iterator< _native::StringIterator, char, std::string > [#_DateTime] === DateTime @@ -116,65 +116,65 @@ Alias for std::chrono::time_point< std::chrono::system_clock, std::chrono::milli [#_DatabaseIterator] === DatabaseIterator -Alias for Iterator<_native::DatabaseIterator, _native::Database, TypeDB::Database> +Alias for Iterator< _native::DatabaseIterator, _native::Database, TypeDB::Database > [#_DatabaseIterable] === DatabaseIterable -Alias for Iterable<_native::DatabaseIterator, _native::Database, TypeDB::Database> +Alias for Iterable< _native::DatabaseIterator, _native::Database, TypeDB::Database > [#_ReplicaInfoIterable] === ReplicaInfoIterable -Alias for Iterable<_native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo> +Alias for Iterable< _native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo > [#_ReplicaInfoIterator] === ReplicaInfoIterator -Alias for Iterator<_native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo> +Alias for Iterator< _native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo > [#_ExplanationIterator] === ExplanationIterator -Alias for Iterator<_native::ExplanationIterator, _native::Explanation, Explanation> +Alias for Iterator< _native::ExplanationIterator, _native::Explanation, Explanation > [#_ExplanationIterable] === ExplanationIterable -Alias for Iterable<_native::ExplanationIterator, _native::Explanation, Explanation> +Alias for Iterable< _native::ExplanationIterator, _native::Explanation, Explanation > [#_RuleFuture] === RuleFuture -Alias for Future +Alias for Future< Rule, _native::RulePromise > [#_OptionalRuleFuture] === OptionalRuleFuture -Alias for Future, _native::RulePromise> +Alias for Future< std::optional< Rule >, _native::RulePromise > [#_RuleIterable] === RuleIterable -Alias for Iterable<_native::RuleIterator, _native::Rule, Rule> +Alias for Iterable< _native::RuleIterator, _native::Rule, Rule > [#_RuleIterator] === RuleIterator -Alias for Iterator<_native::RuleIterator, _native::Rule, Rule> +Alias for Iterator< _native::RuleIterator, _native::Rule, Rule > [#_JSONIterable] === JSONIterable -Alias for Iterable<_native::StringIterator, char, JSON> +Alias for Iterable< _native::StringIterator, char, JSON > [#_UserIterator] === UserIterator -Alias for Iterator<_native::UserIterator, _native::User, User> +Alias for Iterator< _native::UserIterator, _native::User, User > [#_UserIterable] === UserIterable -Alias for Iterable<_native::UserIterator, _native::User, User> +Alias for Iterable< _native::UserIterator, _native::User, User > diff --git a/dependencies/vaticle/repositories.bzl b/dependencies/vaticle/repositories.bzl index 5363b42a61..6f74c2f4ad 100644 --- a/dependencies/vaticle/repositories.bzl +++ b/dependencies/vaticle/repositories.bzl @@ -25,7 +25,7 @@ def vaticle_dependencies(): git_repository( name = "vaticle_dependencies", remote = "https://github.com/vaticle/dependencies", - commit = "41bb5bfb1b5f2adab4a88886d2e74f10d456e7e1", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies + commit = "1d4919aa905a180dbe97b145d6861881893724e9", # sync-marker: do not remove this comment, this is used for sync-dependencies by @vaticle_dependencies ) def vaticle_typedb_common(): diff --git a/java/BUILD b/java/BUILD index 022f6bebae..ae9e133f72 100644 --- a/java/BUILD +++ b/java/BUILD @@ -29,7 +29,7 @@ load("@vaticle_dependencies//library/maven:artifacts.bzl", artifacts_org = "arti load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load(":rules.bzl", "swig_native_java_library") load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") -load("//tool/docs:java/rules.bzl", "javadoc_to_adoc") +load("@vaticle_bazel_distribution//docs:java/rules.bzl", "javadoc_to_adoc") load("//java:docs_structure.bzl", "dir_mapping") java_library( diff --git a/nodejs/BUILD b/nodejs/BUILD index db9db76f72..7f523e4bbe 100644 --- a/nodejs/BUILD +++ b/nodejs/BUILD @@ -28,6 +28,7 @@ exports_files([ "VERSION", ]) +load("@vaticle_bazel_distribution//docs:nodejs/rules.bzl", "typedoc_to_adoc") load("@vaticle_bazel_distribution//npm:rules.bzl", "assemble_npm", "deploy_npm") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load("@vaticle_dependencies//distribution:deployment.bzl", "deployment") @@ -37,7 +38,6 @@ load("@aspect_rules_js//npm:defs.bzl", "npm_link_package", "npm_package") load("@aspect_bazel_lib//lib:jq.bzl", "jq") load("@npm//:defs.bzl", "npm_link_all_packages") load("//nodejs:tool/typedoc/rules.bzl", "typedoc_docs") -load("//tool/docs:nodejs/rules.bzl", "typedoc_to_adoc") load("//nodejs:docs_structure.bzl", "dir_mapping") npm_link_all_packages( diff --git a/python/BUILD b/python/BUILD index 0770f81f20..a710ef31ab 100644 --- a/python/BUILD +++ b/python/BUILD @@ -19,10 +19,9 @@ # under the License. # +load("@vaticle_bazel_distribution//docs:python/rules.bzl", "sphinx_docs", "sphinx_to_adoc") load("@vaticle_dependencies//builder/swig:python.bzl", "py_native_lib_rename") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") -load("//python/tool/sphinx:rules.bzl", "sphinx_docs") -load("//tool/docs:python/rules.bzl", "sphinx_to_adoc") load("//python:docs_structure.bzl", "dir_mapping") load("//python:rules.bzl", "native_driver_versioned") @@ -77,7 +76,6 @@ checkstyle_test( "WORKSPACE", "requirements*.txt", "typedb/**/*", - "tool/sphinx/*", ]), exclude = glob([ "conf.py", diff --git a/python/tool/sphinx/BUILD b/python/tool/sphinx/BUILD deleted file mode 100644 index 0307089c7e..0000000000 --- a/python/tool/sphinx/BUILD +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright (C) 2022 Vaticle -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") -load("@vaticle_dependencies_tool_docs//:requirements.bzl", docs_requirement = "requirement") - -py_binary( - name = "sphinx_runner", - srcs = [ - "sphinx_html_builder.py", - ], - main = "sphinx_html_builder.py", - deps = [docs_requirement("sphinx")], - visibility = ["//visibility:public"] -) - -checkstyle_test( - name = "checkstyle", - include = glob([ - "*", - ]), - license_type = "apache-header", - size = "small", -) diff --git a/python/tool/sphinx/rules.bzl b/python/tool/sphinx/rules.bzl deleted file mode 100644 index 4f3580e2aa..0000000000 --- a/python/tool/sphinx/rules.bzl +++ /dev/null @@ -1,84 +0,0 @@ -# -# Copyright (C) 2022 Vaticle -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -def _sphinx_docs_impl(ctx): - package = ctx.actions.declare_directory("package") - - ctx.actions.run_shell( - inputs = ctx.files.target, - outputs = [package], - command = 'PACKAGE=$(find . -name "*.tar.gz") && tar -xf ${PACKAGE} && mv */%s %s' - % (ctx.attr.package_subdir, package.path), - ) - - args = ctx.actions.args() - args.add('--output', ctx.outputs.out.path) - args.add('--package', package.path) - args.add('--source_dir', ctx.files.sphinx_conf[0].dirname) - - ctx.actions.run( - inputs = [ctx.executable._script, package] + ctx.files.sphinx_conf + ctx.files.sphinx_rst, - outputs = [ctx.outputs.out], - arguments = [args], - executable = ctx.executable._script, - env = {"PYTHONPATH": package.path}, - ) - - return DefaultInfo(files = depset([ctx.outputs.out])) - - -sphinx_docs = rule( - attrs = { - "_script": attr.label( - default = ":sphinx_runner", - executable = True, - cfg = "exec", - doc = "Script for running sphinx", - ), - "target": attr.label( - mandatory = True, - allow_files = True, - doc = "Package including .tar.gz archive", - ), - "sphinx_conf": attr.label( - mandatory = True, - allow_files = True, - doc = "Configuration file for the Sphinx documentation builder", - ), - "sphinx_rst": attr.label( - mandatory = True, - allow_files = True, - doc = "Sphinx documentation master file for the package", - ), - "out": attr.output( - mandatory = True, - doc = "Output directory", - ), - "package_subdir": attr.string( - mandatory = True, - doc = "Directory with the module files in the package archive", - ) - }, - implementation = _sphinx_docs_impl, - doc = """ - Creates an HTML documentation for python module using Sphinx. - """ -) diff --git a/python/tool/sphinx/sphinx_html_builder.py b/python/tool/sphinx/sphinx_html_builder.py deleted file mode 100644 index 211d83f61e..0000000000 --- a/python/tool/sphinx/sphinx_html_builder.py +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (C) 2022 Vaticle -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -import argparse -import sys - -from sphinx.cmd.build import main -from sphinx.ext import apidoc - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument('--output', help="Output directory") - parser.add_argument('--package', help="Package directory") - parser.add_argument('--source_dir', help="Sphinx source directory") - args = parser.parse_args() - - apidoc.main(["-o", args.source_dir, args.package]) - sys.exit(main(["-M", "html", args.source_dir, args.output])) diff --git a/rust/BUILD b/rust/BUILD index 84ba4588a1..692241a127 100644 --- a/rust/BUILD +++ b/rust/BUILD @@ -23,11 +23,11 @@ package(default_visibility = ["//visibility:public"]) load("@rules_rust//rust:defs.bzl", "rust_library", "rust_static_library", "rustfmt_test", "rust_test") load("@vaticle_bazel_distribution//crates:rules.bzl", "assemble_crate", "deploy_crate") +load("@vaticle_bazel_distribution//docs:rust/rules.bzl", "rust_docs", "rustdoc_to_adoc") load("@vaticle_dependencies//builder/rust:rules.bzl", "rust_cbindgen") load("@vaticle_dependencies//builder/swig:java.bzl", "swig_java") load("@vaticle_dependencies//distribution:deployment.bzl", "deployment") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") -load("//tool/docs:rust/rules.bzl", "rust_docs", "rustdoc_to_adoc") load("//rust:docs_structure.bzl", "dir_mapping") typedb_driver_srcs = glob(["src/**/*.rs"]) diff --git a/tool/docs/cpp/doxyfile.template b/tool/docs/cpp/doxyfile.template deleted file mode 100644 index b3654a14ac..0000000000 --- a/tool/docs/cpp/doxyfile.template +++ /dev/null @@ -1,100 +0,0 @@ -# Doxyfile 1.9.8 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). -#--------------------------------------------------------------------------- -# NOTE: -# This file has been cleaned up for doxygen doc generation via bazel -# To see all the options, generate a fresh one with -# `doxygen -g ` - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = ##{{PROJECT_NAME}} -PROJECT_NUMBER = ##{{PROJECT_NUMBER}} -PROJECT_BRIEF = ##{{PROJECT_BRIEF}} -OUTPUT_DIRECTORY = ##{{OUTPUT_DIRECTORY}} -CREATE_SUBDIRS = NO -ALLOW_UNICODE_NAMES = NO -OUTPUT_LANGUAGE = English - -BRIEF_MEMBER_DESC = YES -ALWAYS_DETAILED_SEC = YES -REPEAT_BRIEF = YES -STRIP_FROM_PATH = ##{{STRIP_FROM_PATH}} -INHERIT_DOCS = YES -INLINE_INHERITED_MEMB = NO - -MARKDOWN_SUPPORT = YES -AUTOLINK_SUPPORT = YES -FILE_PATTERNS = *.h *.hpp *.md *.html -CASE_SENSE_NAMES = NO - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -HIDE_FRIEND_COMPOUNDS = YES -SHOW_HEADERFILE = NO ## Show which header to include -SHOW_INCLUDE_FILES = NO -SORT_BRIEF_DOCS = NO ## NO: The short description at the top is in declaration order -SORT_MEMBER_DOCS = YES ## YES: The longer description which follows is sorted alphabetically -SORT_BY_SCOPE_NAME = NO - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_IF_INCOMPLETE_DOC = YES -WARN_NO_PARAMDOC = YES -WARN_IF_UNDOC_ENUM_VAL = YES -WARN_AS_ERROR = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ##{{INPUT}} -INPUT_ENCODING = UTF-8 -RECURSIVE = NO ## bazel explicitly specifies files -EXCLUDE_SYMLINKS = NO ## bazel needs NO -USE_MDFILE_AS_MAINPAGE = ##{{USE_MDFILE_AS_MAINPAGE}} -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_COLORSTYLE = AUTO_LIGHT -ENUM_VALUES_PER_LINE = 4 -OBFUSCATE_EMAILS = YES -SEARCHENGINE = YES - -GENERATE_LATEX = NO - -#--------------------------------------------------------------------------- -# Configuration options related to diagram generator tools -#--------------------------------------------------------------------------- -HIDE_UNDOC_RELATIONS = YES -CLASS_GRAPH = YES -HAVE_DOT = NO ## Disables many details diff --git a/tool/docs/cpp/rules.bzl b/tool/docs/cpp/rules.bzl index 4230e81b76..c335f1329d 100644 --- a/tool/docs/cpp/rules.bzl +++ b/tool/docs/cpp/rules.bzl @@ -42,84 +42,3 @@ def doxygen_to_adoc(name, data, docs_dirs, **kwargs): visibility = ["//visibility:public"], **kwargs ) - -def _doxygen_docs_impl(ctx): - output_directory = ctx.actions.declare_directory(ctx.attr._output_directory) - files = [] - for target in ctx.attr.sources: - files.extend(target.files.to_list()) - - replacements = { - "PROJECT_NAME": ctx.attr.project_name, - "PROJECT_NUMBER" : ctx.attr.version, - "PROJECT_BRIEF" : ctx.attr.desc, - "OUTPUT_DIRECTORY" : output_directory.path, - "STRIP_FROM_PATH": ctx.attr.strip_prefix, - } - if ctx.file.main_page_md != None: - files.append(ctx.file.main_page_md) - replacements["USE_MDFILE_AS_MAINPAGE"] = ctx.file.main_page_md.path - - replacements["INPUT"] = " ".join([f.path for f in files]) - - # Prepare doxyfile - doxyfile = ctx.actions.declare_file("%s.doxyfile" % ctx.attr.name) - ctx.actions.expand_template( - template = ctx.file._doxyfile_template, - output = doxyfile, - substitutions = {"##{{%s}}"%k : replacements[k] for k in replacements} - ) - - files = [doxyfile] + files - print(doxyfile.path) - ctx.actions.run( - inputs = files, - outputs = [output_directory], - arguments = [doxyfile.path], - executable = "doxygen", - use_default_shell_env = True - ) - - return DefaultInfo(files = depset([output_directory])) - -doxygen_docs = rule( - implementation = _doxygen_docs_impl, - test = False, - attrs = { - "project_name" : attr.string( - doc = "The project name for the doxygen docs", - mandatory = True, - ), - "version" : attr.string( - doc = "The version of the project being documented", - default = "" - ), - "desc" : attr.string( - doc = "A description for the project", - default = "" - ), - "sources" : attr.label_list( - doc = "A list of files made available to doxygen. This is NOT automatically included in the doxyfile", - mandatory = True, - allow_files = True, - ), - "strip_prefix" : attr.string( - doc = "Prefix to strip from path of files being processed", - default = "" - ), - "main_page_md" : attr.label( - doc = "The file to use as main page for the generate docs", - allow_single_file = True, - mandatory = False - ), - "_doxyfile_template" : attr.label( - doc = "A template for the doxygen configuration file.", - allow_single_file = True, - default = "//tool/docs:cpp/doxyfile.template" - ), - "_output_directory" : attr.string( - doc = "The output directory for the doxygen docs", - default = "doxygen_docs" - ) - }, -) From fea074c4e543e7669094b786a85e7f1996c82bc5 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Tue, 2 Jan 2024 15:24:27 +0000 Subject: [PATCH 2/3] Reflect moving adoc generation back --- java/BUILD | 2 +- nodejs/BUILD | 2 +- python/BUILD | 6 +++--- rust/BUILD | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/java/BUILD b/java/BUILD index ae9e133f72..022f6bebae 100644 --- a/java/BUILD +++ b/java/BUILD @@ -29,7 +29,7 @@ load("@vaticle_dependencies//library/maven:artifacts.bzl", artifacts_org = "arti load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load(":rules.bzl", "swig_native_java_library") load("@google_bazel_common//tools/javadoc:javadoc.bzl", "javadoc_library") -load("@vaticle_bazel_distribution//docs:java/rules.bzl", "javadoc_to_adoc") +load("//tool/docs:java/rules.bzl", "javadoc_to_adoc") load("//java:docs_structure.bzl", "dir_mapping") java_library( diff --git a/nodejs/BUILD b/nodejs/BUILD index 7f523e4bbe..720e302311 100644 --- a/nodejs/BUILD +++ b/nodejs/BUILD @@ -28,7 +28,6 @@ exports_files([ "VERSION", ]) -load("@vaticle_bazel_distribution//docs:nodejs/rules.bzl", "typedoc_to_adoc") load("@vaticle_bazel_distribution//npm:rules.bzl", "assemble_npm", "deploy_npm") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load("@vaticle_dependencies//distribution:deployment.bzl", "deployment") @@ -39,6 +38,7 @@ load("@aspect_bazel_lib//lib:jq.bzl", "jq") load("@npm//:defs.bzl", "npm_link_all_packages") load("//nodejs:tool/typedoc/rules.bzl", "typedoc_docs") load("//nodejs:docs_structure.bzl", "dir_mapping") +load("//tool/docs:nodejs/rules.bzl", "typedoc_to_adoc") npm_link_all_packages( name = "node_modules", diff --git a/python/BUILD b/python/BUILD index a710ef31ab..d1a4cf6be8 100644 --- a/python/BUILD +++ b/python/BUILD @@ -19,13 +19,13 @@ # under the License. # -load("@vaticle_bazel_distribution//docs:python/rules.bzl", "sphinx_docs", "sphinx_to_adoc") +load("@vaticle_bazel_distribution//docs:python/rules.bzl", "sphinx_docs") load("@vaticle_dependencies//builder/swig:python.bzl", "py_native_lib_rename") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") -load("//python:docs_structure.bzl", "dir_mapping") - load("//python:rules.bzl", "native_driver_versioned") load("//python:python_versions.bzl", "python_versions") +load("//python:docs_structure.bzl", "dir_mapping") +load("//tool/docs:python/rules.bzl", "sphinx_to_adoc") native_driver_versioned(python_versions = python_versions) diff --git a/rust/BUILD b/rust/BUILD index 692241a127..b452eab372 100644 --- a/rust/BUILD +++ b/rust/BUILD @@ -23,12 +23,12 @@ package(default_visibility = ["//visibility:public"]) load("@rules_rust//rust:defs.bzl", "rust_library", "rust_static_library", "rustfmt_test", "rust_test") load("@vaticle_bazel_distribution//crates:rules.bzl", "assemble_crate", "deploy_crate") -load("@vaticle_bazel_distribution//docs:rust/rules.bzl", "rust_docs", "rustdoc_to_adoc") load("@vaticle_dependencies//builder/rust:rules.bzl", "rust_cbindgen") load("@vaticle_dependencies//builder/swig:java.bzl", "swig_java") load("@vaticle_dependencies//distribution:deployment.bzl", "deployment") load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") load("//rust:docs_structure.bzl", "dir_mapping") +load("//tool/docs:rust/rules.bzl", "rust_docs", "rustdoc_to_adoc") typedb_driver_srcs = glob(["src/**/*.rs"]) typedb_driver_tags = ["crate-name=typedb-driver"] From b4acc5931cb0f1dc7ab04bed8ed89a8895e1d849 Mon Sep 17 00:00:00 2001 From: Krishnan Govindraj Date: Thu, 4 Jan 2024 11:29:52 +0000 Subject: [PATCH 3/3] Update docs --- cpp/docs/common/typedefs.adoc | 62 +++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/cpp/docs/common/typedefs.adoc b/cpp/docs/common/typedefs.adoc index 08ecefef86..9548a0d85e 100644 --- a/cpp/docs/common/typedefs.adoc +++ b/cpp/docs/common/typedefs.adoc @@ -1,42 +1,42 @@ [#_ConceptMapIterator] === ConceptMapIterator -Alias for Iterator< _native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap > +Alias for Iterator<_native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap> [#_ConceptMapIterable] === ConceptMapIterable -Alias for Iterable< _native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap > +Alias for Iterable<_native::ConceptMapIterator, _native::ConceptMap, TypeDB::ConceptMap> [#_ConceptMapGroupIterable] === ConceptMapGroupIterable -Alias for Iterable< _native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup > +Alias for Iterable<_native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup> [#_ConceptMapGroupIterator] === ConceptMapGroupIterator -Alias for Iterator< _native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup > +Alias for Iterator<_native::ConceptMapGroupIterator, _native::ConceptMapGroup, TypeDB::ConceptMapGroup> [#_OwnerAttributePairIterator] === OwnerAttributePairIterator -Alias for Iterator< _native::StringPairIterator, _native::StringPair, OwnerAttributePair > +Alias for Iterator<_native::StringPairIterator, _native::StringPair, OwnerAttributePair> [#_OwnerAttributePairIterable] === OwnerAttributePairIterable -Alias for Iterable< _native::StringPairIterator, _native::StringPair, OwnerAttributePair > +Alias for Iterable<_native::StringPairIterator, _native::StringPair, OwnerAttributePair> [#_JSONMap] === JSONMap -Alias for std::map< std::string, JSON > +Alias for std::map [#_JSONArray] === JSONArray -Alias for std::vector< JSON > +Alias for std::vector [#_JSONBoolean] === JSONBoolean @@ -61,52 +61,52 @@ Alias for std::string [#_AggregateResult] === AggregateResult -Alias for std::optional< std::unique_ptr< Value > > +Alias for std::optional> [#_AggregateFuture] === AggregateFuture -Alias for Future< AggregateResult, _native::ConceptPromise > +Alias for Future [#_ValueGroupIterable] === ValueGroupIterable -Alias for Iterable< _native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup > +Alias for Iterable<_native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup> [#_ValueGroupIterator] === ValueGroupIterator -Alias for Iterator< _native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup > +Alias for Iterator<_native::ValueGroupIterator, _native::ValueGroup, TypeDB::ValueGroup> [#_VoidFuture] === VoidFuture -Alias for Future< void, _native::VoidPromise > +Alias for Future [#_BoolFuture] === BoolFuture -Alias for Future< bool, _native::BoolPromise > +Alias for Future [#_StringFuture] === StringFuture -Alias for Future< std::string, _native::StringPromise > +Alias for Future [#_OptionalStringFuture] === OptionalStringFuture -Alias for Future< std::optional< std::string >, _native::StringPromise > +Alias for Future, _native::StringPromise> [#_StringIterable] === StringIterable -Alias for Iterable< _native::StringIterator, char, std::string > +Alias for Iterable<_native::StringIterator, char, std::string> [#_StringIterator] === StringIterator -Alias for Iterator< _native::StringIterator, char, std::string > +Alias for Iterator<_native::StringIterator, char, std::string> [#_DateTime] === DateTime @@ -116,65 +116,65 @@ Alias for std::chrono::time_point< std::chrono::system_clock, std::chrono::milli [#_DatabaseIterator] === DatabaseIterator -Alias for Iterator< _native::DatabaseIterator, _native::Database, TypeDB::Database > +Alias for Iterator<_native::DatabaseIterator, _native::Database, TypeDB::Database> [#_DatabaseIterable] === DatabaseIterable -Alias for Iterable< _native::DatabaseIterator, _native::Database, TypeDB::Database > +Alias for Iterable<_native::DatabaseIterator, _native::Database, TypeDB::Database> [#_ReplicaInfoIterable] === ReplicaInfoIterable -Alias for Iterable< _native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo > +Alias for Iterable<_native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo> [#_ReplicaInfoIterator] === ReplicaInfoIterator -Alias for Iterator< _native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo > +Alias for Iterator<_native::ReplicaInfoIterator, _native::ReplicaInfo, ReplicaInfo> [#_ExplanationIterator] === ExplanationIterator -Alias for Iterator< _native::ExplanationIterator, _native::Explanation, Explanation > +Alias for Iterator<_native::ExplanationIterator, _native::Explanation, Explanation> [#_ExplanationIterable] === ExplanationIterable -Alias for Iterable< _native::ExplanationIterator, _native::Explanation, Explanation > +Alias for Iterable<_native::ExplanationIterator, _native::Explanation, Explanation> [#_RuleFuture] === RuleFuture -Alias for Future< Rule, _native::RulePromise > +Alias for Future [#_OptionalRuleFuture] === OptionalRuleFuture -Alias for Future< std::optional< Rule >, _native::RulePromise > +Alias for Future, _native::RulePromise> [#_RuleIterable] === RuleIterable -Alias for Iterable< _native::RuleIterator, _native::Rule, Rule > +Alias for Iterable<_native::RuleIterator, _native::Rule, Rule> [#_RuleIterator] === RuleIterator -Alias for Iterator< _native::RuleIterator, _native::Rule, Rule > +Alias for Iterator<_native::RuleIterator, _native::Rule, Rule> [#_JSONIterable] === JSONIterable -Alias for Iterable< _native::StringIterator, char, JSON > +Alias for Iterable<_native::StringIterator, char, JSON> [#_UserIterator] === UserIterator -Alias for Iterator< _native::UserIterator, _native::User, User > +Alias for Iterator<_native::UserIterator, _native::User, User> [#_UserIterable] === UserIterable -Alias for Iterable< _native::UserIterator, _native::User, User > +Alias for Iterable<_native::UserIterator, _native::User, User>