From 4065433498b99f7e9b9482539108b5709f21ec7f Mon Sep 17 00:00:00 2001 From: "Worker Pants (Pantsbuild GitHub Automation Bot)" <133242086+WorkerPants@users.noreply.github.com> Date: Wed, 15 May 2024 01:07:31 -0400 Subject: [PATCH] Fix markdown syntax in "Making subsystems exportable ..." docs (Cherry-pick of #20902) (#20928) This makes two minor adjustments to the "Making subsystems exportable ..." docs from #20730: - close the `:::note` admonitions with `:::` - indent some items to be nested within the relevant list items Fixes #20891 Co-authored-by: Huon Wilson --- .../common-subsystem-tasks.mdx | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/docs/writing-plugins/common-subsystem-tasks.mdx b/docs/docs/writing-plugins/common-subsystem-tasks.mdx index d5bafb9fd73..70490d9ae3d 100644 --- a/docs/docs/writing-plugins/common-subsystem-tasks.mdx +++ b/docs/docs/writing-plugins/common-subsystem-tasks.mdx @@ -54,25 +54,27 @@ class FortranLintFieldSet(FieldSet): :::note Support depends on language backend of the subsystem Only some language backends support `pants export`. These include the Python and JVM backends. Only tools which are themselves written to use a backend with this feature can be exported. For example, a Python-based tool which operates on a different language is exportable. - +::: 1. Make the subsystem a subclass of `ExportableTool` -:::note Language backends may have done this in their Tool base class. For example, the Python backend with `PythonToolRequirementsBase` and JVM with `JvmToolBase` are already subclasses. + :::note Language backends may have done this in their Tool base class. + For example, the Python backend with `PythonToolRequirementsBase` and JVM with `JvmToolBase` are already subclasses. + ::: -```python -from pants.backend.python.subsystems.python_tool_base import PythonToolBase -from pants.core.goals.resolves import ExportableTool + ```python + from pants.backend.python.subsystems.python_tool_base import PythonToolBase + from pants.core.goals.resolves import ExportableTool -class FortranLint(PythonToolBase, ExportableTool): - ... -``` + class FortranLint(PythonToolBase, ExportableTool): + ... + ``` 2. Register your class with a `UnionRule` with `ExportableTool` -```python -def rules(): - return [ - UnionRule(ExportableTool, FortranLint) - ] -``` + ```python + def rules(): + return [ + UnionRule(ExportableTool, FortranLint) + ] + ```