From f9be2b816aeb1f5eedbc5291373d08eebf65d36c Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 7 Jan 2026 11:11:53 -0800 Subject: [PATCH] feat(docs): add resources admonition with external links (#36761) Co-authored-by: Claude Opus 4.5 --- docs/docs/api.mdx | 5 + docs/docs/configuration/alerts-reports.mdx | 5 + .../configuration/async-queries-celery.mdx | 4 + docs/docs/configuration/cache.mdx | 5 + .../configuration/configuring-superset.mdx | 4 + docs/docs/configuration/databases.mdx | 128 ++++++++++++++++-- docs/docs/configuration/sql-templating.mdx | 4 + docs/docs/configuration/theming.mdx | 8 ++ docs/docs/contributing/contributing.mdx | 4 + docs/docs/contributing/development.mdx | 7 +- docs/docs/installation/kubernetes.mdx | 5 + docs/docs/quickstart.mdx | 6 + docs/docs/security/securing_superset.mdx | 5 + .../creating-your-first-dashboard.mdx | 11 ++ docs/docs/using-superset/exploring-data.mdx | 9 ++ docs/docusaurus.config.ts | 12 ++ docs/src/styles/custom.css | 39 ++++++ docs/src/theme/Admonition/Types.js | 63 +++++++++ 18 files changed, 310 insertions(+), 14 deletions(-) create mode 100644 docs/src/theme/Admonition/Types.js diff --git a/docs/docs/api.mdx b/docs/docs/api.mdx index 11e0b86fe87..52f6be851bd 100644 --- a/docs/docs/api.mdx +++ b/docs/docs/api.mdx @@ -16,6 +16,11 @@ Superset's public **REST API** follows the documented here. The docs below are generated using [Swagger React UI](https://www.npmjs.com/package/swagger-ui-react). +:::resources +- [Blog: The Superset REST API](https://preset.io/blog/2020-10-01-superset-api/) +- [Blog: Accessing APIs with Superset](https://preset.io/blog/accessing-apis-with-superset/) +::: + :@:/. ``` +:::resources +- [Apache Doris Docs: Superset Integration](https://doris.apache.org/docs/ecosystem/bi/apache-superset/) +::: + #### AWS Athena ##### PyAthenaJDBC @@ -360,6 +365,13 @@ uses the default user without a password (and doesn't encrypt the connection): clickhousedb://localhost/default ``` +:::resources +- [ClickHouse Docs: Superset Integration](https://clickhouse.com/docs/integrations/superset) +- [Altinity: Connect ClickHouse to Superset](https://docs.altinity.com/integrations/clickhouse-and-superset/connect-clickhouse-to-superset/) +- [Instaclustr: Connecting to ClickHouse from Superset](https://www.instaclustr.com/support/documentation/clickhouse/using-a-clickhouse-cluster/connecting-to-clickhouse-from-apache-superset/) +- [Blog: ClickHouse and Apache Superset](https://preset.io/blog/2021-5-26-clickhouse-superset/) +::: + #### Cloudflare D1 To use Cloudflare D1 with superset, install the [superset-engine-d1](https://github.com/sqlalchemy-cf-d1/superset-engine-d1) library. @@ -432,6 +444,11 @@ Docker Compose. echo "sqlalchemy-cratedb" >> ./docker/requirements-local.txt ``` +:::resources +- [CrateDB Docs: Apache Superset Integration](https://cratedb.com/docs/guide/integrate/apache-superset/index.html) +- [Blog: Visualizing Time-Series Data with CrateDB and Superset](https://preset.io/blog/timeseries-cratedb-superset/) +::: + [CrateDB Cloud]: https://cratedb.com/product/cloud [CrateDB Self-Managed]: https://cratedb.com/product/self-managed [sqlalchemy-cratedb]: https://pypi.org/project/sqlalchemy-cratedb/ @@ -564,8 +581,10 @@ The expected connection string for Arrow Flight (Dremio 4.9.1+. Default port is dremio+flight://{username}:{password}@{host}:{port}/dremio ``` -This [blog post by Dremio](https://www.dremio.com/tutorials/dremio-apache-superset/) has some -additional helpful instructions on connecting Superset to Dremio. +:::resources +- [Dremio Docs: Superset Integration](https://docs.dremio.com/current/client-applications/superset/) +- [Blog: Connecting Dremio to Apache Superset](https://www.dremio.com/tutorials/dremio-apache-superset/) +::: #### Apache Drill @@ -608,6 +627,10 @@ We recommend reading the the [GitHub README](https://github.com/JohnOmernik/sqlalchemy-drill#usage-with-odbc) to learn how to work with Drill through ODBC. +:::resources +- [Tutorial: Query MongoDB in Superset with Apache Drill](https://medium.com/@thoren.lederer/query-data-from-mongodb-in-apache-superset-with-the-help-of-apache-drill-full-tutorial-b34c33eac6c1) +::: + import useBaseUrl from "@docusaurus/useBaseUrl"; #### Apache Druid @@ -674,6 +697,10 @@ much like you would create an aggregation manually, but specify `postagg` as a ` then have to provide a valid json post-aggregation definition (as specified in the Druid docs) in the JSON field. +:::resources +- [Blog: Real-Time Business Insights with Apache Druid and Superset](https://www.deep.bi/blog/real-time-business-insights-with-apache-druid-and-apache-superset) +::: + #### Elasticsearch The recommended connector library for Elasticsearch is @@ -744,6 +771,10 @@ To disable SSL verification, add the following to the **SQLALCHEMY URI** field: elasticsearch+https://{user}:{password}@{host}:9200/?verify_certs=False ``` +:::resources +- [Blog: Superset Announces Elasticsearch Support](https://preset.io/blog/2019-12-16-elasticsearch-in-superset/) +::: + #### Exasol The recommended connector library for Exasol is @@ -792,6 +823,10 @@ or firebolt://{client_id}:{client_secret}@{database}/{engine_name}?account_name={name} ``` +:::resources +- [Firebolt Docs: Connecting to Apache Superset](https://docs.firebolt.io/guides/integrations/connecting-to-apache-superset) +::: + #### Google BigQuery The recommended connector library for BigQuery is @@ -878,15 +913,21 @@ To be able to upload CSV or Excel files to BigQuery in Superset, you'll need to Currently, the Google BigQuery Python SDK is not compatible with `gevent`, due to some dynamic monkeypatching on python core library by `gevent`. So, when you deploy Superset with `gunicorn` server, you have to use worker type except `gevent`. +:::resources +- [Tutorial: Build A StackOverflow Dashboard — Connecting Superset to BigQuery](https://preset.io/blog/2020-08-04-google-bigquery/) +::: + #### Google Sheets Google Sheets has a very limited [SQL API](https://developers.google.com/chart/interactive/docs/querylanguage). The recommended connector library for Google Sheets is [shillelagh](https://github.com/betodealmeida/shillelagh). -There are a few steps involved in connecting Superset to Google Sheets. This -[tutorial](https://preset.io/blog/2020-06-01-connect-superset-google-sheets/) has the most up to date -instructions on setting up this connection. +There are a few steps involved in connecting Superset to Google Sheets. + +:::resources +- [Tutorial: Connect Superset to Google Sheets](https://preset.io/blog/2020-06-01-connect-superset-google-sheets/) +::: #### Hana @@ -908,6 +949,10 @@ The expected connection string is formatted as follows: hive://hive@{hostname}:{port}/{database} ``` +:::resources +- [Cloudera: Connect Apache Hive to Superset](https://docs-archive.cloudera.com/HDPDocuments/HDP3/HDP-3.0.0/integrating-hive/content/hive_connect_hive_to_apache_superset.html) +::: + #### Hologres Hologres is a real-time interactive analytics service developed by Alibaba Cloud. It is fully compatible with PostgreSQL 11 and integrates seamlessly with the big data ecosystem. @@ -1059,6 +1104,10 @@ The connection string is formatted as follows: oracle://:@: ``` +:::resources +- [Oracle Developers: Steps to use Apache Superset and Oracle Database](https://medium.com/oracledevs/steps-to-use-apache-superset-and-oracle-database-ae0858b4f134) +::: + #### Parseable [Parseable](https://www.parseable.io) is a distributed log analytics database that provides SQL-like query interface for log data. The recommended connector library is [sqlalchemy-parseable](https://github.com/parseablehq/sqlalchemy-parseable). @@ -1077,7 +1126,10 @@ parseable://admin:admin@demo.parseable.com:443/ingress-nginx Note: The stream_name in the URI represents the Parseable logstream you want to query. You can use both HTTP (port 80) and HTTPS (port 443) connections. ->>>>>>> +:::resources +- [Blog: Parseable with Apache Superset](https://www.parseable.com/blog/parseable-with-apache-superset) +::: + #### Apache Pinot The recommended connector library for Apache Pinot is [pinotdb](https://pypi.org/project/pinotdb/). @@ -1101,6 +1153,11 @@ Add below argument while creating database connection in Advanced -> Other -> EN {"connect_args":{"use_multistage_engine":"true"}} ``` +:::resources +- [Apache Pinot Docs: Superset Integration](https://docs.pinot.apache.org/integrations/superset) +- [StarTree: Data Visualization with Apache Superset and Pinot](https://startree.ai/resources/data-visualization-with-apache-superset-and-pinot) +::: + #### Postgres Note that, if you're using docker compose, the Postgres connector library [psycopg2](https://www.psycopg.org/docs/) @@ -1137,6 +1194,28 @@ More information about PostgreSQL connection options can be found in the and the [PostgreSQL docs](https://www.postgresql.org/docs/9.1/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS). +:::resources +- [Blog: Data Visualization in PostgreSQL With Apache Superset](https://www.tigerdata.com/blog/data-visualization-in-postgresql-with-apache-superset) +::: + +#### QuestDB + +[QuestDB](https://questdb.io/) is a high-performance, open-source time-series database with SQL support. +The recommended connector library is the PostgreSQL driver [psycopg2](https://www.psycopg.org/docs/), +as QuestDB supports the PostgreSQL wire protocol. + +The connection string is formatted as follows: + +``` +postgresql+psycopg2://{username}:{password}@{hostname}:{port}/{database} +``` + +The default port for QuestDB's PostgreSQL interface is `8812`. + +:::resources +- [QuestDB Docs: Apache Superset Integration](https://questdb.com/docs/third-party-tools/superset/) +::: + #### Presto The [pyhive](https://pypi.org/project/PyHive/) library is the recommended way to connect to Presto through SQLAlchemy. @@ -1179,6 +1258,10 @@ SSL Secure extra add json config to extra connection information. } ``` +:::resources +- [Tutorial: Presto SQL + S3 Data + Superset Data Lake](https://hackernoon.com/presto-sql-s3-data-superset-data-lake) +::: + #### RisingWave The recommended connector library for RisingWave is @@ -1252,6 +1335,10 @@ If your private key is stored on server, you can replace "privatekey_body" with } ``` +:::resources +- [Snowflake Builders Blog: Building Real-Time Operational Dashboards with Apache Superset and Snowflake](https://medium.com/snowflake/building-real-time-operational-dashboards-with-apache-superset-and-snowflake-23f625e07d7c) +::: + #### Apache Solr The [sqlalchemy-solr](https://pypi.org/project/sqlalchemy-solr/) library provides a @@ -1273,6 +1360,10 @@ The expected connection string is formatted as follows: hive://hive@{hostname}:{port}/{database} ``` +:::resources +- [Tutorial: How to Connect Apache Superset with Apache SparkSQL](https://medium.com/free-or-open-source-software/how-to-connect-apache-superset-with-apache-sparksql-50efe48ac0e4) +::: + #### Arc There are two ways to connect Superset to Arc: @@ -1356,8 +1447,8 @@ Here's what the connection string looks like: starrocks://:@:/. ``` -:::note -StarRocks maintains their Superset docuementation [here](https://docs.starrocks.io/docs/integrations/BI_integrations/Superset/). +:::resources +- [StarRocks Docs: Superset Integration](https://docs.starrocks.io/docs/integrations/BI_integrations/Superset/) ::: #### TDengine @@ -1441,6 +1532,11 @@ postgresql://{username}:{password}@{host}:{port}/{database name}?sslmode=require [Learn more about TimescaleDB!](https://docs.timescale.com/) +:::resources +- [Timescale DevRel: Visualize time series data with TimescaleDB and Apache Superset](https://attilatoth.dev/speaking/timescaledb-superset/) +- [Tutorial: PostgreSQL with TimescaleDB — Visualizing Real-Time Data with Superset](https://www.slingacademy.com/article/postgresql-with-timescaledb-visualizing-real-time-data-with-superset/) +::: + #### Trino Supported trino version 352 and higher @@ -1566,9 +1662,11 @@ or factory function (which returns an `Authentication` instance) to `auth_method All fields in `auth_params` are passed directly to your class/function. -**Reference**: - -- [Trino-Superset-Podcast](https://trino.io/episodes/12.html) +:::resources +- [Starburst Docs: Superset Integration](https://docs.starburst.io/clients/superset.html) +- [Podcast: Trino and Superset](https://trino.io/episodes/12.html) +- [Blog: Trino and Apache Superset](https://preset.io/blog/2021-6-22-trino-superset/) +::: #### Vertica @@ -1680,6 +1778,10 @@ The connection string looks like: postgresql://{username}:{password}@{host}:{port}/{database} ``` +:::resources +- [Blog: Introduction to YugabyteDB and Apache Superset](https://preset.io/blog/introduction-yugabytedb-apache-superset/) +::: + ## Connecting through the UI Here is the documentation on how to leverage the new DB Connection UI. This will provide admins the ability to enhance the UX for users who want to connect to new databases. diff --git a/docs/docs/configuration/sql-templating.mdx b/docs/docs/configuration/sql-templating.mdx index 43bd5783e74..b6337e06876 100644 --- a/docs/docs/configuration/sql-templating.mdx +++ b/docs/docs/configuration/sql-templating.mdx @@ -590,3 +590,7 @@ Loads a string as a `datetime` object. This is useful when performing date opera do something else {% endif %} ``` + +:::resources +- [Blog: Intro to Jinja Templating in Apache Superset](https://preset.io/blog/intro-jinja-templating-apache-superset/) +::: diff --git a/docs/docs/configuration/theming.mdx b/docs/docs/configuration/theming.mdx index 86243742cc3..8f88ec8fda3 100644 --- a/docs/docs/configuration/theming.mdx +++ b/docs/docs/configuration/theming.mdx @@ -395,3 +395,11 @@ For programmatic theme management, Superset provides REST endpoints: - `POST /api/v1/theme/import/` - Import themes from YAML These endpoints require appropriate permissions and are subject to RBAC controls. + +:::resources +- [Video: Live Demo — Theming Apache Superset](https://www.youtube.com/watch?v=XsZAsO9tC3o) +- [CSS and Theming](https://docs.preset.io/docs/css-and-theming) - Additional theming techniques and CSS customization +- [Blog: Customizing Apache Superset Dashboards with CSS](https://preset.io/blog/customizing-superset-dashboards-with-css/) +- [Blog: Customizing Dashboards with CSS — Tips and Tricks](https://preset.io/blog/customizing-apache-superset-dashboards-with-css-additional-tips-and-tricks/) +- [Blog: Customizing Chart Colors](https://preset.io/blog/customizing-chart-colors-with-superset-and-preset/) +::: diff --git a/docs/docs/contributing/contributing.mdx b/docs/docs/contributing/contributing.mdx index 109a3692df9..d3aec8e3d11 100644 --- a/docs/docs/contributing/contributing.mdx +++ b/docs/docs/contributing/contributing.mdx @@ -136,3 +136,7 @@ Security team members should also follow these general expectations: - Actively participate in assessing, discussing, fixing, and releasing security issues in Superset. - Avoid discussing security fixes in public forums. Pull request (PR) descriptions should not contain any information about security issues. The corresponding JIRA ticket should contain a link to the PR. - Security team members who contribute to a fix may be listed as remediation developers in the CVE report, along with their job affiliation (if they choose to include it). + +:::resources +- [Blog: Comprehensive Tutorial for Contributing Code to Apache Superset](https://preset.io/blog/tutorial-contributing-code-to-apache-superset/) +::: diff --git a/docs/docs/contributing/development.mdx b/docs/docs/contributing/development.mdx index c43e7031525..6c2a6ca9351 100644 --- a/docs/docs/contributing/development.mdx +++ b/docs/docs/contributing/development.mdx @@ -972,7 +972,12 @@ The `test-storybook` job runs automatically in CI on every pull request, ensurin The topic of authoring new plugins, whether you'd like to contribute it back or not has been well documented in the -[the documentation](https://superset.apache.org/docs/contributing/creating-viz-plugins), and in [this blog post](https://preset.io/blog/building-custom-viz-plugins-in-superset-v2). +[documentation](https://superset.apache.org/docs/contributing/creating-viz-plugins). + +:::resources +- [Blog: Building Custom Viz Plugins in Superset v2](https://preset.io/blog/building-custom-viz-plugins-in-superset-v2) +- [Blog: Enhancing Superset Visualization Plugins](https://preset.io/blog/enhancing-superset-visualization-plugins-part-1/) +::: To contribute a plugin to Superset, your plugin must meet the following criteria: diff --git a/docs/docs/installation/kubernetes.mdx b/docs/docs/installation/kubernetes.mdx index 9f515a63010..06e5991b591 100644 --- a/docs/docs/installation/kubernetes.mdx +++ b/docs/docs/installation/kubernetes.mdx @@ -444,3 +444,8 @@ To load the examples, add the following to the `my_values.yaml` file: init: loadExamples: true ``` + +:::resources +- [Tutorial: Mastering Data Visualization — Installing Superset on Kubernetes with Helm Chart](https://mahira-technology.medium.com/mastering-data-visualization-installing-superset-on-kubernetes-cluster-using-helm-chart-e4ec99199e1e) +- [Tutorial: Installing Apache Superset in Kubernetes](https://aws.plainenglish.io/installing-apache-superset-in-kubernetes-1aec192ac495) +::: diff --git a/docs/docs/quickstart.mdx b/docs/docs/quickstart.mdx index 4e23b422e99..8bc03df3680 100644 --- a/docs/docs/quickstart.mdx +++ b/docs/docs/quickstart.mdx @@ -80,3 +80,9 @@ From this point on, you can head on to: - [Installing on Kubernetes](/docs/installation/kubernetes/) Or just explore our [Documentation](https://superset.apache.org/docs/intro)! + +:::resources +- [Video: Superset in 2 Minutes](https://www.youtube.com/watch?v=AqousXQ7YHw) +- [Video: Superset 101](https://www.youtube.com/watch?v=mAIH3hUoxEE) +- [Tutorial: Creating Your First Dashboard](/docs/using-superset/creating-your-first-dashboard) +::: diff --git a/docs/docs/security/securing_superset.mdx b/docs/docs/security/securing_superset.mdx index f98f86c5fe0..a0d5f7b5914 100644 --- a/docs/docs/security/securing_superset.mdx +++ b/docs/docs/security/securing_superset.mdx @@ -172,3 +172,8 @@ Rotating the `SUPERSET_SECRET_KEY` is a critical security procedure. It is manda **Procedure for Rotating the Key** The procedure for safely rotating the SECRET_KEY must be followed precisely to avoid locking yourself out of your instance. The official Apache Superset documentation maintains the correct, up-to-date procedure. Please follow the official guide here: https://superset.apache.org/docs/configuration/configuring-superset/#rotating-to-a-newer-secret_key + +:::resources +- [Blog: Running Apache Superset on the Open Internet](https://preset.io/blog/running-apache-superset-on-the-open-internet-a-report-from-the-fireline/) +- [Blog: How Security Vulnerabilities are Reported & Handled in Apache Superset](https://preset.io/blog/how-security-vulnerabilities-are-reported-and-handled-in-apache-superset/) +::: diff --git a/docs/docs/using-superset/creating-your-first-dashboard.mdx b/docs/docs/using-superset/creating-your-first-dashboard.mdx index 52e5af34d1c..7a214037a71 100644 --- a/docs/docs/using-superset/creating-your-first-dashboard.mdx +++ b/docs/docs/using-superset/creating-your-first-dashboard.mdx @@ -114,6 +114,12 @@ Aggregate functions aren't allowed in calculated columns. +:::resources +- [Using Metrics and Calculated Columns](https://docs.preset.io/docs/using-metrics-and-calculated-columns) - In-depth guide to the semantic layer +- [Blog: Understanding the Superset Semantic Layer](https://preset.io/blog/understanding-superset-semantic-layer/) +- [Blog: Unlocking the Power of Virtual Datasets](https://preset.io/blog/unlocking-the-power-of-virtual-datasets-in-apache-superset/) +::: + ### Creating charts in Explore view Superset has 2 main interfaces for exploring data: @@ -227,3 +233,8 @@ The following URL parameters can be used to modify how the dashboard is rendered For example, when running the local development build, the following will disable the Top Nav and remove the Filter Bar: `http://localhost:8088/superset/dashboard/my-dashboard/?standalone=1&show_filters=0` + +:::resources +- [Dashboard Customization](https://docs.preset.io/docs/dashboard-customization) - Advanced dashboard styling and layout options +- [Blog: BI Dashboard Best Practices](https://preset.io/blog/bi-dashboard-best-practices/) +::: diff --git a/docs/docs/using-superset/exploring-data.mdx b/docs/docs/using-superset/exploring-data.mdx index d3e263c4629..6a62f448e15 100644 --- a/docs/docs/using-superset/exploring-data.mdx +++ b/docs/docs/using-superset/exploring-data.mdx @@ -326,3 +326,12 @@ various options in this section, refer to the Lastly, save your chart as Tutorial Resample and add it to the Tutorial Dashboard. Go to the tutorial dashboard to see the four charts side by side and compare the different outputs. + +:::resources +- [Chart Walkthroughs](https://docs.preset.io/docs/chart-walkthroughs) - Detailed guides for most chart types +- [Blog: Why Apache ECharts is the Future of Apache Superset](https://preset.io/blog/2021-4-1-why-echarts/) +- [Blog: ECharts Time-Series Visualizations in Superset](https://preset.io/blog/echarts-time-series-visualizations-in-superset/) +- [Blog: Finding New Insights with Drill By](https://preset.io/blog/drill-by/) +- [Blog: From Drill Down to Drill By](https://preset.io/blog/drill-down-and-drill-by/) +- [Blog: Cross-Filtering in Apache Superset](https://preset.io/blog/cross-filtering-in-Superset-and-Preset/) +::: diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index f5590de7d10..cfb4121457c 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -46,6 +46,10 @@ if (!versionsConfig.components.disabled) { editUrl: 'https://github.com/apache/superset/edit/master/docs/components', remarkPlugins: [remarkImportPartial, remarkLocalizeBadges], + admonitions: { + keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'], + extendDefaults: true, + }, docItemComponent: '@theme/DocItem', includeCurrentVersion: versionsConfig.components.includeCurrentVersion, lastVersion: versionsConfig.components.lastVersion, @@ -70,6 +74,10 @@ if (!versionsConfig.developer_portal.disabled) { editUrl: 'https://github.com/apache/superset/edit/master/docs/developer_portal', remarkPlugins: [remarkImportPartial, remarkLocalizeBadges], + admonitions: { + keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'], + extendDefaults: true, + }, docItemComponent: '@theme/DocItem', includeCurrentVersion: versionsConfig.developer_portal.includeCurrentVersion, lastVersion: versionsConfig.developer_portal.lastVersion, @@ -343,6 +351,10 @@ const config: Config = { return `https://github.com/apache/superset/edit/master/docs/${versionDocsDirPath}/${docPath}`; }, remarkPlugins: [remarkImportPartial, remarkLocalizeBadges], + admonitions: { + keywords: ['note', 'tip', 'info', 'warning', 'danger', 'resources'], + extendDefaults: true, + }, includeCurrentVersion: versionsConfig.docs.includeCurrentVersion, lastVersion: versionsConfig.docs.lastVersion, // Make 'next' the default onlyIncludeVersions: versionsConfig.docs.onlyIncludeVersions, diff --git a/docs/src/styles/custom.css b/docs/src/styles/custom.css index 28095185e84..dbc825d6685 100644 --- a/docs/src/styles/custom.css +++ b/docs/src/styles/custom.css @@ -134,3 +134,42 @@ ul.dropdown__menu svg { --ifm-font-base-color: #bbb5ac; --ifm-border-color: #797063; } + +/* Custom "resources" admonition for additional resources/links */ +.alert--resources { + --ifm-alert-background-color: #f8f9fa; + --ifm-alert-border-color: #6c757d; + --ifm-alert-foreground-color: #495057; + background-color: var(--ifm-alert-background-color); + border-left: 5px solid var(--ifm-alert-border-color); +} + +.alert--resources .admonition-heading h5 { + color: var(--ifm-alert-foreground-color); +} + +.alert--resources .admonition-icon svg { + fill: var(--ifm-alert-foreground-color); + stroke: var(--ifm-alert-foreground-color); +} + +/* Resources admonition - dark mode */ +[data-theme='dark'] .alert--resources { + --ifm-alert-background-color: #2d3748; + --ifm-alert-border-color: #718096; + --ifm-alert-foreground-color: #e2e8f0; +} + +/* Style links within resources admonition */ +.alert--resources a { + color: var(--ifm-link-color); + text-decoration: none; +} + +.alert--resources a:hover { + text-decoration: underline; +} + +[data-theme='dark'] .alert--resources a { + color: var(--ifm-color-primary-light); +} diff --git a/docs/src/theme/Admonition/Types.js b/docs/src/theme/Admonition/Types.js new file mode 100644 index 00000000000..5434cf7a2f5 --- /dev/null +++ b/docs/src/theme/Admonition/Types.js @@ -0,0 +1,63 @@ +/** + * 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. + */ + +import React from 'react'; +import DefaultAdmonitionTypes from '@theme-original/Admonition/Types'; + +function ResourcesIcon() { + return ( + + {/* Bookmark/link icon */} + + + ); +} + +function ResourcesAdmonition(props) { + return ( +
+
+
+ + + + {props.title || 'Additional Resources'} +
+
+
{props.children}
+
+ ); +} + +const AdmonitionTypes = { + ...DefaultAdmonitionTypes, + resources: ResourcesAdmonition, +}; + +export default AdmonitionTypes;