amoeba commented on code in PR #2890:
URL: https://github.com/apache/arrow-adbc/pull/2890#discussion_r2178302278


##########
docs/source/ext/adbc_misc.py:
##########
@@ -0,0 +1,238 @@
+# 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.
+
+"""Misc directives for the ADBC docs."""
+
+import dataclasses
+import functools
+import itertools
+import typing
+from pathlib import Path
+
+import docutils
+from docutils.statemachine import StringList
+from sphinx.util.docutils import SphinxDirective
+from sphinx.util.nodes import nested_parse_with_titles
+from sphinx.util.typing import OptionSpec
+
+
[email protected](frozen=True)
+class DriverStatus:
+    vendor: str
+    implementation: str
+    status: typing.Literal["Experimental", "Beta", "Stable"]
+    packages: typing.List[typing.Tuple[str, str, str]]  # (repo, package, URL)
+
+    @property
+    def badge_type(self) -> str:
+        if self.status == "Experimental":
+            return "danger"
+        elif self.status == "Beta":
+            return "warning"
+        elif self.status == "Stable":
+            return "success"
+        else:
+            raise ValueError(f"Unknown status {self.status} for 
{self.implementation}")
+
+
[email protected]
+def _driver_status(path: Path) -> DriverStatus:
+    # we could pull in a full markdown parser, but for now just munge the text

Review Comment:
   I think it would be really nice to use frontmatter here, should we do this 
as a follow-on?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to