mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
feat(docs): add resources admonition with external links (#36761)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
63
docs/src/theme/Admonition/Types.js
Normal file
63
docs/src/theme/Admonition/Types.js
Normal file
@@ -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 (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
{/* Bookmark/link icon */}
|
||||
<path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
|
||||
function ResourcesAdmonition(props) {
|
||||
return (
|
||||
<div className="admonition admonition-resources alert alert--resources">
|
||||
<div className="admonition-heading">
|
||||
<h5>
|
||||
<span className="admonition-icon">
|
||||
<ResourcesIcon />
|
||||
</span>
|
||||
{props.title || 'Additional Resources'}
|
||||
</h5>
|
||||
</div>
|
||||
<div className="admonition-content">{props.children}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const AdmonitionTypes = {
|
||||
...DefaultAdmonitionTypes,
|
||||
resources: ResourcesAdmonition,
|
||||
};
|
||||
|
||||
export default AdmonitionTypes;
|
||||
Reference in New Issue
Block a user