mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 19:47:13 +00:00
docs: show beta directive (#25013)

This commit is contained in:
@@ -15,6 +15,8 @@ from pathlib import Path
|
||||
|
||||
import toml
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst.directives.admonitions import BaseAdmonition
|
||||
from docutils.statemachine import StringList
|
||||
from sphinx.util.docutils import SphinxDirective
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
@@ -66,8 +68,23 @@ class ExampleLinksDirective(SphinxDirective):
|
||||
return [list_node]
|
||||
|
||||
|
||||
class Beta(BaseAdmonition):
|
||||
required_arguments = 0
|
||||
node_class = nodes.admonition
|
||||
|
||||
def run(self):
|
||||
self.content = self.content or StringList(
|
||||
[
|
||||
"This feature is in beta. It is actively being worked on, so the API may change."
|
||||
]
|
||||
)
|
||||
self.arguments = self.arguments or ["Beta"]
|
||||
return super().run()
|
||||
|
||||
|
||||
def setup(app):
|
||||
app.add_directive("example_links", ExampleLinksDirective)
|
||||
app.add_directive("beta", Beta)
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
@@ -897,6 +897,13 @@ div.admonition {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
div.admonition-beta {
|
||||
color: #d35400; /* A darker rich orange color */
|
||||
background-color: #FDF2E9; /* A light orange-tinted background color */
|
||||
border-color: #E59866; /* A darker soft orange border color */
|
||||
}
|
||||
|
||||
|
||||
div.admonition p:last-child,
|
||||
div.admonition dl:last-child,
|
||||
div.admonition dd:last-child,
|
||||
|
Reference in New Issue
Block a user