Skip to content

Releases: bazelbuild/stardoc

0.7.1

19 Sep 18:08
2ac0981
Compare
Choose a tag to compare

Release 0.7.1

Notable Changes

  • Really fix building with --incompatible_disallow_empty_glob (#238).
  • Auxiliary rule targets created by stardoc() macro now include provided tags (#247)

Contributors

Alexandre Rostovtsev, Lukács Berki, yashathwani

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.7.1")

By default - in other words, when using Bzlmod for dependency management - Stardoc uses @stardoc as its repo name. The legacy WORSKSPACE setup (see below) used @io_bazel_stardoc instead. For compatibility with the legacy WORKSPACE setup, you may add repo_name = "io_bazel_stardoc" to the bazel_dep call.

Legacy WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "fabb280f6c92a3b55eed89a918ca91e39fb733373c81e87a18ae9e33e75023ec",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.7.1/stardoc-0.7.1.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

The sequence of function calls and load statements after the io_bazel_stardoc repository definition ensures that this repository's dependencies are loaded (each function call defines additional repositories for Stardoc's dependencies, which are then used by subsequent load statements).

Note that WORKSPACE files are sensitive to the order of dependencies. If, after updating to a newer version of Stardoc, you encounter "not a valid maven_install.json file" or other repository fetch errors (example: #186), try moving the Stardoc dependency block above or below other dependencies in your WORKSPACE file.

Using the rules

See the source.

0.7.0

20 Jun 17:54
00cc953
Compare
Choose a tag to compare

Release 0.7.0

This release requires Bazel 7 or newer.

By default - when using Bzlmod for dependency management - Stardoc now uses @stardoc as its repo name.

For compatibility with the legacy WORKSPACE-based setup (which used @io_bazel_stardoc as the repo name) and ease of migration, you may load Stardoc via

bazel_dep(name = "stardoc", repo_name = "io_bazel_stardoc", ...)

in your MODULE.bazel file.

New Features

  • Add support for a table of contents template (#203). This is disabled by default, but Stardoc comes with an example template that you can use. To enable, set table_of_contents_template, for example:
    stardoc(
        ...,
        table_of_contents_template = "@stardoc//stardoc:templates/markdown_tables/table_of_contents.vm",
    )
  • Add support for a footer template (#206). This is disabled by default; to enable, set footer_template to a .vm file, which you will need to provide.
  • Add support for providing stamping to Stardoc templates (#205). To use, use $util.formatBuildTimestamp and $stamping in a template file (footer_template - see above - is recommended for this); for example:
    Built on `$util.formatBuildTimestamp($stamping.volatile.BUILD_TIMESTAMP, "UTC", "yyyy-MM-dd HH:mm")`
    
  • Render documentation for provider init callbacks (#224)
  • Properly render *args, *, and **kwargs in summaries (#231). This requires Bazel 8 (prerelease 20240603 or newer).
  • Include load statement in summaries (#216)

Incompatible Changes

  • The legacy extractor has been removed (#212). Stardoc always uses the starlark_doc_extract-based extractor. The stardoc, semantic_flags, and use_starlark_doc_extract arguments to stardoc() macro have been removed.
  • Stardoc uses Bzlmod by default for dependency management (#213). This means that by default, Stardoc now uses @stardoc as its repo name.

Contributors

Alex Humesky, Alexandre Rostovtsev, Fabian Meumertzheim, Grzegorz Lukasik, Xùdōng Yáng, Yun Peng

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.7.0")

By default - in other words, when using Bzlmod for dependency management - Stardoc uses @stardoc as its repo name. The legacy WORSKSPACE setup (see below) used @io_bazel_stardoc instead. For compatibility with the legacy WORKSPACE setup, you may add repo_name = "io_bazel_stardoc" to the bazel_dep call.

Legacy WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "dd7f32f4fe2537ce2452c51f816a5962d48888a5b07de2c195f3b3da86c545d3",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.7.0/stardoc-0.7.0.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.7.0/stardoc-0.7.0.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

The sequence of function calls and load statements after the io_bazel_stardoc repository definition ensures that this repository's dependencies are loaded (each function call defines additional repositories for Stardoc's dependencies, which are then used by subsequent load statements).

Note that WORKSPACE files are sensitive to the order of dependencies. If, after updating to a newer version of Stardoc, you encounter "not a valid maven_install.json file" or other repository fetch errors (example: #186), try moving the Stardoc dependency block above or below other dependencies in your WORKSPACE file.

Using the rules

See the source.

0.6.2

11 Aug 19:02
99421bb
Compare
Choose a tag to compare

Release 0.6.2

Bugfix release: bumps rules_jvm_external dependency to support building with --incompatible_disable_starlark_host_transitions

Contributors

Alexandre Rostovtsev

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

The sequence of function calls and load statements after the io_bazel_stardoc repository definition ensures that this repository's dependencies are loaded (each function call defines additional repositories for Stardoc's dependencies, which are then used by subsequent load statements).

Note that WORKSPACE files are sensitive to the order of dependencies. If, after updating to a newer version of Stardoc, you encounter "not a valid maven_install.json file" or other repository fetch errors (example: #186), try moving the Stardoc dependency block above or below other dependencies in your WORKSPACE file.

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.6.2")

For compatibility with WORKSPACE setup, add repo_name = "io_bazel_stardoc" to the bazel_dep call.

Using the rules

See the source.

0.6.1

04 Aug 20:18
9800c40
Compare
Choose a tag to compare

Release 0.6.1

Bugfix release: fix rules_jvm_external pin warnings.

This release temporarily restores compatibility with Bazel 5 (manually tested). Note that normally we only test Stardoc with the current stable Bazel and with Bazel at HEAD - not with older releases. We make no promises about maintaining compatibility with Bazel 5.

Contributors

Alexandre Rostovtsev

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "3082a199f39e1fd9ed608421516fdbe9e9af8eb34f52e46e9a8c4798c8e6bfad",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.1/stardoc-0.6.1.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.6.1/stardoc-0.6.1.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.6.1")

For compatibility with WORKSPACE setup, add repo_name = "io_bazel_stardoc" to the bazel_dep call.

Using the rules

See the source.

0.6.0

03 Aug 15:02
00b171f
Compare
Choose a tag to compare

Release 0.6.0

New Features

  • Stardoc no longer escapes HTML tags in documentation. Feel free to use HTML formatting in your docs! We now also have much-improved rendering for fenced code blocks in attribute docs, and render attribute default values using Markdown instead of HTML markup. (#161, #167)

  • Stardoc now dedents and trims all doc strings - not only in macros (#170). This means you can have

    my_rule = rule(
        doc = """
        This is my rule.
    
        Here is more info about it.
    
        ...
        """,
        ...
    )

    and Stardoc will dedent and trim the doc to

    This is my rule.
    
    Here is more info about it.
    
    ...
    
  • When using Bazel 7 or newer (or current Bazel HEAD), Stardoc will by default use the native starlark_doc_extract rule internally (#166).

    This means, in particular:

    • correct default values for rule attributes in all cases
    • documentation for module extensions
    • more complete documentation for repository rules
    • by default (this can be turned off via render_main_repo_name = False), we will render labels in your main repo with a repo component: your main module name (when using bzlmod) or WORKSPACE name (#168).

    You may temporarily disable the new extractor by calling Stardoc with use_starlark_doc_extract = False. However, after Bazel 7 is released, we plan to remove this argument and always use the new extractor.

Incompatible Changes

  • The Markdown renderer now uses Google EscapeVelocity instead of Apache Velocity for templating. The templating engines are almost compatible, with the exception of escapes in string literals: if in your template you had a string literal with a character escape, you would need to expand it.

    For example, instead of

    ${funcInfo.docString.replaceAll("\n", " ")}

    you would need

    ${funcInfo.docString.replaceAll("
    ", " ")}
  • When using the native starlark_doc_extract extractor, Stardoc requires two additional templates: repository_rule_template and
    module_extension_template. If you are using custom templates, you will probably want to define these, following the examples in
    stardoc/templates/markdown_tables.

  • When using the native starlark_doc_extract extractor, Stardoc cannot document generated .bzl files any more - because Bazel cannot load() generated .bzl files.

Other Notable Changes

  • The Markdown renderer's source now lives in the Stardoc repo; we build the renderer from source instead of using a bundled jar. Unfortunately, if you are not using bzlmod, this requires a rather complicated WORKSPACE setup; see below.

Contributors

Alexandre Rostovtsev, Fabian Meumertzheim

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "4441a965c97f8364c8eb901f951ca9a15c6e2c29ee0f10b56bf8b563463752ea",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.0/stardoc-0.6.0.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.6.0/stardoc-0.6.0.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()

The sequence of function calls and load statements after the io_bazel_stardoc repository definition ensures that this repository's dependencies are loaded (each function call defines additional repositories for Stardoc's dependencies, which are then used by subsequent load statements).

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.6.0")

For compatibility with WORKSPACE setup (see above), add repo_name = "io_bazel_stardoc" to the bazel_dep call.

Using the rules

See the source.

0.5.6

31 May 18:47
437c79d
Compare
Choose a tag to compare

Release 0.5.6 (initially tagged as 0.5.5)

Bugfix release: update @rules_java dependency to fix breakage with Bazel at HEAD.

Contributors

Alexandre Rostovtsev

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "dfbc364aaec143df5e6c52faf1f1166775a5b4408243f445f44b661cfdc3134f",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.5.6/stardoc-0.5.6.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.5.6", repo_name = "io_bazel_stardoc")

Using the rules

See the source.

0.5.4

16 May 20:25
8cd9ecf
Compare
Choose a tag to compare

Release 0.5.4

New Features

  • Stardoc supports bzlmod! (#141, special thanks to Fabian Meumertzheim)
  • Stardoc output files are now exposed in stardoc() target runfiles (#139)

Contributors

Alexandre Rostovtsev, Fabian Meumertzheim, Greg Estren, Ivo List, Keith Smiley, lberki, Philipp Schrader

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "ec57139e466faae563f2fc39609da4948a479bb51b6d67aedd7d9b1b8059c433",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.4/stardoc-0.5.4.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.5.4/stardoc-0.5.4.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

MODULE.bazel setup

bazel_dep(name = "stardoc", version = "0.5.4", repo_name = "io_bazel_stardoc")

Using the rules

See the source.

0.5.3

30 Sep 14:10
50cb915
Compare
Choose a tag to compare

Release 0.5.3

Bugfix release: fixes angle bracket escaping and a crash on labels with @@

Contributors

Alexandre Rostovtsev, Jon Shea

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

0.5.2

18 Jul 16:16
5c3882b
Compare
Choose a tag to compare

Bugfix release: fixes crash with config_common.toolchain_type.

Contributors

Alexandre Rostovtsev, Keith Smiley

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "05fb57bb4ad68a360470420a3b6f5317e4f722839abc5b17ec4ef8ed465aaa47",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.2/stardoc-0.5.2.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.5.2/stardoc-0.5.2.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

0.5.1

04 Apr 20:55
4b7da9f
Compare
Choose a tag to compare

Bugfix release: minor fixes, including a fix for build failure due to missing zlib version.

Contributors

aiuto, Alexandre Rostovtsev, Brian Silverman, Casey, Xùdōng Yáng

WORKSPACE setup

To use Stardoc, add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_stardoc",
    sha256 = "aa814dae0ac400bbab2e8881f9915c6f47c49664bf087c409a15f90438d2c23e",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz",
        "https://github.com/bazelbuild/stardoc/releases/download/0.5.1/stardoc-0.5.1.tar.gz",
    ],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

The load statement and function call after the io_bazel_stardoc repository
definition ensure that this repository's dependencies are loaded.

Using the rules

See the source.