aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-23Revert "Merge tag 'upstream/0.6.2' into main" am: 90db889d03HEADmastermainYifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2924556 Change-Id: Icd7f3a65eba0eaf2edac7e9ee6af56eb54321c99 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-23Revert "Merge tag 'upstream/0.6.2' into main"Yifan Hong
This reverts commit 16b44b4e060da38bf5613220593fc48350a0aa80. Reason for revert: change breaks kleaf_docs build and there are no easy forward fix that cuts the protobuf dependency, which requires a working toolchain that compiles C++ code correctly. Bug: 321898888 Change-Id: I845e6c2c874d6b7ec1d403b9482f63c7996815c0
2024-01-17Merge tag 'upstream/0.6.2' into main am: 16b44b4e06Yifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2863358 Change-Id: If97afa3f90932aa17926fb6bd874cdee60a34ba4 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-08Merge tag 'upstream/0.6.2' into mainYifan Hong
Bug: 276493276 Change-Id: Ia35937702bbf7634a760801e6cf0c3d28d4436de
2023-08-11Prepare release 0.6.2 (#181)upstream/0.6.2Alexandre Rostovtsev
... and fix Windows CI failure (see https://github.com/bazelbuild/continuous-integration/issues/1012)
2023-08-08Update deps to support build with ↵Alexandre Rostovtsev
--incompatible_disable_starlark_host_transitions (#179) And to make sure we stay unbroken, add the flag to our ci config - which on Windows requires setting `BAZELISK_SHUTDOWN=1` to work around https://github.com/bazelbuild/continuous-integration/issues/1012 Fixes #145
2023-08-04Prepare release 0.6.1 (#178)upstream/0.6.1Alexandre Rostovtsev
2023-08-04Replace dict union "|" with dict.update for Bazel 5 compatibility (#177)Alexandre Rostovtsev
Surprisingly, the release tarballs of Stardoc 0.6 almost works with Bazel 5 - except for two usages of the dict union operator. Temporarily (until ~ Stardoc 0.7 release, which will require Bazel 7) replace the union operator with dict.update; it doesn't affect readability much. Fixes #175
2023-08-04List maven artifacts in MODULE.bazel to avoid rules_jvm_external pin warning ↵Alexandre Rostovtsev
(#176) Since we no longer have a single source of truth for maven artifacts, we need a consistency test. Use some old-school sed to extract the STARDOC_MAVEN_ARTIFACTS list from MODULE.bazel and deps.bzl, and add a test to ensure they are consistent. And - for good measure - add a similar test to ensure the version number in version.bzl and MODULE.bazel is consistent too. Fixes #174
2023-08-03trivial: Remove trailing whitespace (#173)Alexandre Rostovtsev
2023-08-03Prepare release 0.6.0, with starlark_doc_extract and HTML formatting ↵upstream/0.6.0Alexandre Rostovtsev
supported (#171)
2023-08-03Fix non-bzlmod distribution (#172)Alexandre Rostovtsev
Since we are building the renderer from source and using rules_jvm_external to pull in Maven deps, the WORKSPACE setup for a user of Stardoc is now significantly more complicated; the user will now need to do the multi-step rules_jvm_external initialization and maven_install. For convenience, let's wrap maven_install in a macro - and finally split out the legacy-test-only maven deps into their own .json file and repo. Update stardoc_repositories to pull in all the new deps we need to build Java code. Update maintainer guide.
2023-08-02Bump bazel dep and add docstring dedenting test cases (#170)Alexandre Rostovtsev
We want https://github.com/bazelbuild/bazel/commit/b71b2df2b22e052f8540a23051b589c6ef870d0a in order to dedent and trim doc strings from all sources (not just functions, but also rules, providers, attributes, etc.).
2023-08-02Enable render_main_repo_name by default with starlark_doc_extract (#168)Alexandre Rostovtsev
Most Stardoc users are probably documenting their rules for users from other repos - so we ought to render labels in the repo being documented with the repo name.
2023-08-01In Markdown table cells, apply HTML escaping only to code blocks, and apply ↵Alexandre Rostovtsev
it properly (#167) In Markdown table cells, apply HTML escaping only to code blocks, and apply it properly Since #161 removed HTML escaping for defaults and function docstrings, we should do the same for attribute and param docs in table cells. The only limitations Markdown places on table cells are: * no pipe characters (they must be escaped with a backslash) * no newlines (they must be transformed into `<br>` or an HTML entity) The latter restriction makes it impossible to have a fenced code block inside a table cell. Therefore: * we do not escape HTML or Markdown markup outside a fenced code block * we keep existing logic for escaping newlines outside a fenced code block * we fix fence detection (e.g. allowing more than 3 fence characters to support embedded code blocks in code blocks, allowing tildes as fence characters, properly handling language names, etc.); * in code block content, we escape HTML, and we escape newlines as HTML entities (since `<br>` does not work in a `<pre><code>` block) - finally fixing code block newlines in table cells. This is a followup to #161. Partially addresses #118
2023-08-01Fix impossible null comparison - identified by linter (#169)Alexandre Rostovtsev
2023-07-24Use native starlark_doc_extract rule for doc extraction if it is availableAlexandre Rostovtsev
* When available (i.e. in Bazel 7, or in current development Bazel at HEAD), try use the `starlark_doc_extract` native rule for doc extraction instead of the legacy pre-built extraction jar. This behavior can be disabled by passing `use_starlark_doc_extract = False` to the `stardoc` macro. * Add templates and markdown rendering functionality for repository rule and module extension info protos (which are output by `starlark_doc_extract`). * Temporary wart: for module extensions, by default we would want the summary blurb to look something like ``` my_ext = use_extension("@my_local_repo//some:file.bzl", "my_ext") my_ext.tag(foo, bar) ``` but alas, we don't have a good way to get the name of the local repo from Starlark when bzlmod is enabled. * ... and of course, update tests. Which means in some cases, we have to fork the golden files into current (i.e. `starlark_doc_extract`-enabled) and legacy flavors. Fixes #69 Fixes #76 Fixes #81 Fixes #123
2023-07-18Do not HTML-escape and use Markdown inline code for defaults (#161)Fabian Meumertzheim
Reverts #133 so that HTML escaping is not applied to Markdown. Instead, Markdown content such as docstrings can use HTML formatting and escape angle brackets with backslashes, HTML entities or inline code segments. Default values are embedded in inline code segments instead of `<code>` tags, which does not require escaping. As a result, docstrings behave just like regular Markdown contexts while default values are rendered without smart quotes and can contain both `<` and `` ` `` without causing escaping issues. Also includes tests based on #138. Fixes #137 Closes #138 Fixes #142 Closes #143 Requires https://github.com/bazelbuild/bazel/pull/18867 Co-authored-by: Adam Azarchs <adam.azarchs@10xgenomics.com>
2023-07-13More linter fixes: use ImmutableList where possible (#164)Alexandre Rostovtsev
2023-07-13Fix linter errors and switch from Apache Velocity to Google Escapevelocity ↵Alexandre Rostovtsev
for templating (#163) Internal tooling complains about any new Velocity usage
2023-07-13Move the markdown renderer from Bazel repo into Stardoc repo (#162)Alexandre Rostovtsev
Moving from https://github.com/bazelbuild/bazel/tree/3d2604806a9747f317c5b560bbf89cdc1be033ba * src/main/java/com/google/devtools/build/skydoc/renderer/RendererOptions.java and src/main/java/com/google/devtools/build/skydoc/renderer/RendererMain.java have been changed to use JCommander instead of Bazel's options library for command-line arg parsing. All other .java files have been copied from Bazel without any changes and without any file/directory renames. * integration tests from src/test/java/com/google/devtools/build/skydoc/testdata in Bazel have been merged into tests/testdata in Stardoc where appropriate (filter_rules_test, function_basic_test, function_wrap_multiple_lines_test, multi_level_namespace_test_with_allowlist, provider_basic_test, pure_markdown_template_test, repo_rules_test) * updated Stardoc's deps and to allow building the renderer. In particular, we now are forced to depend on rules_jvm_external unconditionally, even in releases. * removed renderer_binary.jar
2023-05-31Prepare release 0.5.6, now with java toolchains breakage fix with bzlmod too ↵upstream/0.5.6Alexandre Rostovtsev
(#159) I forgot to bump the rules_java dep in MODULE.bazel. We ought to have a consistency check for this...
2023-05-31Prepare release 0.5.5 with java toolchains breakage fix for Bazel at HEAD (#158)upstream/0.5.5Alexandre Rostovtsev
Update rules_java dep to fix "No matching toolchains" errors with Bazel at HEAD, i.e. after https://github.com/bazelbuild/bazel/commit/975866a3e09212766bd353a90a8c42efe91d53ab This error warrants an immediate release because it affects users of Stardoc releases, not just Stardoc itself. See https://buildkite.com/bazel/bazel-skylib/builds/2692#0188728a-5bf4-4bb0-8d3a-6bc726a54f26 for an example failure.
2023-05-24Add missing license blurb (#157)Alexandre Rostovtsev
Our internal system complains about the lack of license header in a .bzl file.
2023-05-19Ensure all tests use loadable .bzl modules (#155)Alexandre Rostovtsev
In preparation for switching to starlark_doc_extract, we need to fix Stardoc tests to use .bzl files that can really be loaded by Bazel. This means: * getting rid of misuses of aspect api * getting rid of old Android and Java symbols * getting rid of generated_bzl_test entirely, since Bazel cannot load dynamically generated .bzl modules. Also fix update-stardoc-tests.sh script - we need to ignore the _stardoc java_binary outputs introduced by #141.
2023-05-16Add MODULE.bazel and //stardoc/private to distro tarball (#154)upstream/0.5.4Alexandre Rostovtsev
Needed for a bzlmod-compatible release
2023-05-16Test Bzlmod support in CI (#152)Fabian Meumertzheim
Required updating the pinned Bazel commit and importing a patch to rules_jvm_external from the Bazel source tree. Fixes #110
2023-05-16Prepare release 0.5.4 with bzlmod support (#153)Alexandre Rostovtsev
2023-05-04Add support for Bzlmod (#141)Fabian Meumertzheim
Input .bzl files are turned into runfiles of a custom Stardoc binary, which allows reusing the Java runfiles library to load the files while taking repository mappings into account.
2023-04-21Replace references to bazel-dev with GitHub Discussions. (#151)lberki
2023-03-13Add license rules (#150)Alexandre Rostovtsev
Needed for bureaucratic compliance reasons.
2023-03-13Remove comment after the license (#148)Ivo List
2023-01-17Add bazel patch to work around underdefined dependency (#146)Keith Smiley
2022-11-09Add METADATA. am: cb554a8ee1 am: 398e266839 am: e83f522ee9android-14.0.0_r45android-14.0.0_r44android-14.0.0_r43android-14.0.0_r42android-14.0.0_r41android-14.0.0_r40android-14.0.0_r39android-14.0.0_r38android-14.0.0_r37android-14.0.0_r36android-14.0.0_r35android-14.0.0_r34android-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android-14.0.0_r27android-14.0.0_r26android-14.0.0_r25android-14.0.0_r24android-14.0.0_r23android-14.0.0_r22android-14.0.0_r21android-14.0.0_r20android-14.0.0_r19android-14.0.0_r18android-14.0.0_r17android-14.0.0_r16aml_rkp_341510000aml_rkp_341311000aml_rkp_341114000aml_rkp_341015010aml_rkp_341012000aml_hef_341613000aml_hef_341512030aml_hef_341415040aml_hef_341311010aml_hef_341114030aml_cfg_341510000android14-qpr2-s5-releaseandroid14-qpr2-s4-releaseandroid14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-releaseandroid14-qpr1-s2-releaseandroid14-qpr1-releaseandroid14-mainline-healthfitness-releaseandroid14-devandroid14-d2-s5-releaseandroid14-d2-s4-releaseandroid14-d2-s3-releaseandroid14-d2-s2-releaseandroid14-d2-s1-releaseandroid14-d2-releaseYifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2292919 Change-Id: I8eb29a4c893987eecf3f325a775055978e13d0f6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Merge tag 'upstream/0.5.3' into master am: ad7ada0eaa am: 44db2f4150 am: ↵Yifan Hong
290c4708ab Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2291529 Change-Id: Id2757e205e84b3885ecac7dc5151460a8273ba59 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Add METADATA. am: cb554a8ee1 am: 398e266839android-u-qpr3-beta-2_r0.8android-u-qpr3-beta-2.1_r0.8android-u-qpr3-beta-1_r0.8android-u-qpr2-beta-3_r0.8android-u-qpr2-beta-3.1_r0.8android-u-qpr2-beta-2_r0.8android-u-qpr2-beta-1_r0.7android-u-qpr1-beta-2_r0.8android-u-qpr1-beta-2.2_r0.7android-u-qpr1-beta-2.1_r0.8android-u-beta-1-gplandroid-15-dp-2_r0.7android-15-dp-1_r0.8android-15-beta-2_r0.8android-15-beta-2_r0.7android-15-beta-1_r0.8android-15-beta-1_r0.7android-14.0.0_r0.81android-14.0.0_r0.80android-14.0.0_r0.8android-14.0.0_r0.77android-14.0.0_r0.67android-14.0.0_r0.57android-14.0.0_r0.45android-14.0.0_r0.38android-14.0.0_r0.18main-kernel-build-2023main-16k-gs-shusky-5.15common-android14-6.1-2023-05-exp-releaseandroid-gs-shusky-udc-d1android-gs-shusky-5.15-u-qpr1-beta2android-gs-shusky-5.15-android15-dpandroid-gs-shusky-5.15-android15-betaandroid-gs-shusky-5.15-android14-qpr3-betaandroid-gs-shusky-5.15-android14-qpr2-betaandroid-gs-shusky-5.15-android14-qpr2android-gs-shusky-5.15-android14-qpr1-betaandroid-gs-shusky-5.15-android14-qpr1android-gs-shusky-5.15-android14-d1android-gs-akita-5.15-android15-betaandroid-gs-akita-5.15-android14-d2Yifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2292919 Change-Id: I68ee3b25732db916c2080fb07df957f57e73cc51 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Merge tag 'upstream/0.5.3' into master am: ad7ada0eaa am: 44db2f4150Yifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2291529 Change-Id: I90d0862db184d09e26890523695de4751d6d1c77 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Add METADATA. am: cb554a8ee1main-16k-with-phonesmain-16k-common-android14-5.15Yifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2292919 Change-Id: I93970b877221089ca41995a376e0b06b0d9ec9c0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Merge tag 'upstream/0.5.3' into master am: ad7ada0eaaYifan Hong
Original change: https://android-review.googlesource.com/c/platform/external/stardoc/+/2291529 Change-Id: I3624bb83c47ee17ca1ce050718aacab2d3742594 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09Add METADATA.Yifan Hong
Test: TH Change-Id: Ic0a605e5718d4c9bd8079d919a5b23f1ca4854c5 Signed-off-by: Yifan Hong <elsk@google.com>
2022-11-08Merge tag 'upstream/0.5.3' into masterYifan Hong
Change-Id: Ia38b870c188683b015b7f56a2d1bb0defe408c50 Signed-off-by: Yifan Hong <elsk@google.com>
2022-11-04Update rules_pkg to 0.8 (#140)Greg
Resolves config_setting visibility failures from https://github.com/bazelbuild/bazel/issues/12933: ``` ERROR: /var/lib/buildkite-agent/builds/bk-docker-zr2k/bazel-downstream-projects/stardoc/distro/BUILD:33:8: in pkg_tar_impl rule //distro:distro_bins: target '@rules_pkg//pkg/private:private_stamp_detect' is not visible from target '//distro:distro_bins'. Check the visibility declaration of the former target if you think the dependency is legitimate ``` See https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/1320#018435e1-7429-4329-808a-731599f24623.
2022-11-02Expose stardoc() output files as runfiles (#139)Philipp Schrader
* Expose stardoc() output files as runfiles There's currently a nuisance with the `stardoc()` rule that presents itself in `rules_python`: $ git clone https://github.com/bazelbuild/rules_python.git $ cd rules_python $ git checkout d314e96aaab18f60df50400d61214f7c1d71b8e6 $ bazel run //docs:update cp: cannot stat 'bazel-bin/docs/packaging.md_': No such file or directory cp: cannot stat 'bazel-bin/docs/pip.md_': No such file or directory cp: cannot stat 'bazel-bin/docs/pip_repository.md_': No such file or directory cp: cannot stat 'bazel-bin/docs/python.md_': No such file or directory A sample of the targets involved look like so: $ bazel cquery --output=build //docs:update + //docs:packaging-docs INFO: Invocation ID: 5fd7a652-0b0d-4827-98f5-c345b38b2178 INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured). INFO: Found 2 targets... # /home/jenkins/repos/rules_python/docs/BUILD:153:10 sh_binary( name = "update", target_compatible_with = [], data = ["//docs:packaging-docs", "//docs:pip-docs", "//docs:pip-repository", "//docs:core-docs"], srcs = ["//docs:update.sh"], ) # Rule update instantiated at (most recent call last): # /home/jenkins/repos/rules_python/docs/BUILD:153:10 in <toplevel> # /home/jenkins/repos/rules_python/docs/BUILD:121:8 stardoc( name = "packaging-docs", target_compatible_with = [], input = "//python:packaging.bzl", deps = ["//docs:packaging_bzl"], out = "//docs:packaging.md_", ) # Rule packaging-docs instantiated at (most recent call last): # /home/jenkins/repos/rules_python/docs/BUILD:121:8 in <toplevel> # Rule stardoc defined at (most recent call last): # /bazel-cache/phil/bazel/_bazel_phil/adc54b5b09500e464f8a73095f3bd8e3/external/io_bazel_stardoc/stardoc/stardoc.bzl:110:15 in <toplevel> The `update` target could instead reference the `*.md_` files directly instead of referencing the `stardoc()` targets. But it's not obvious that this is the desired work flow. It feels like users should be able to depend on the `stardoc()` target instead of its predeclared output. This patch fixes this by adding the predeclared outputs to the target's runfiles. That lets the `rules_python` doc update target work again. $ bazel run //docs:update 'bazel-bin/docs/packaging.md_' -> 'docs/packaging.md' 'bazel-bin/docs/pip.md_' -> 'docs/pip.md' 'bazel-bin/docs/pip_repository.md_' -> 'docs/pip_repository.md' 'bazel-bin/docs/python.md_' -> 'docs/python.md'
2022-09-30Prepare release 0.5.3 to fix crash on labels with @@ (#136)upstream/0.5.3Alexandre Rostovtsev
2022-09-29Update release binary to fix LabelParser crashes for bzlmod-using users (#135)Alexandre Rostovtsev
Needed to fix LabelParser to not crash on @@ syntax. Unbreaks Skylib; see https://buildkite.com/bazel/bazel-skylib/builds/2346#01837d20-1ec8-4e50-937c-7f3dbefed313
2022-08-22Fix 'extensions' link in getting_started_stardoc.md (#134)Jon Shea
2022-07-26Fix <angle bracket> escaping in more places (#133)Alexandre Rostovtsev
Specifically, we were failing to escape <brackets> in: * module docstrings; * function docstrings, including args, returns, and deprecated sections; * provider docs & provider field default values; * rule docs & rule attr default values; * aspect docs & aspect attr default values. (We had also failed to format rule and aspect attr default values in `<code>` tags.) Tests have been updated accordingly. Fixes #132.
2022-07-18Prepare release 0.5.2 to fix crash on config_common.toolchain_type (#131)upstream/0.5.2Alexandre Rostovtsev
See #130.
2022-07-14Update bazel and rules_pkg (#130)Keith Smiley
If you have a bzl file that contains `@bazel_tools//tools/cpp/toolchain_utils.bzl`, after this commit https://github.com/bazelbuild/bazel/commit/95f0135fbac934be696676f37e0285b2d311603a stardoc stopped working because it didn't know about this API, leading to this crash https://buildkite.com/bazel/rules-apple-darwin/builds/5829#0181f96c-ff6c-449e-936e-c32530bd3360 I assume this is because some of the stardoc internals pulls in the older version of `ConfigStarlarkCommonApi.java`. This bumps the shas in the first commit, and rebuilds them in the last commit. Feel free to drop my rebuilds and do a more trusted rebuild. Jars regenerated by Alexandre Rostovtsev <arostovtsev@google.com>
2022-04-27Switch to cfg = "exec" to fix buildifier failure (#129)Alexandre Rostovtsev