Skip to content

Tooltips in TOC #2561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docusaurus/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ docs/node_modules/**
*.py

# LLMs.txt files and related
# llms*.txt
# **/llms*.txt

# Internal tmp tests
llms*.txt
**/llm*.txt
pr-*.diff
*-results.json
73 changes: 68 additions & 5 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const sidebars = {
collapsible: false,
className: 'category-cms-configurations',
items: [

{
type: 'doc',
label: 'Configurations introduction',
Expand All @@ -223,9 +224,25 @@ const sidebars = {
label: 'Admin panel',
collapsed: true,
customProps: {
updated: true,
updated: false,
text: "The section has been simplified",
tooltip: `We simplified the admin panel configuration section to make it easier to navigate and find what you need.</div>
<div>The new structure groups configurations by their purpose, making it more intuitive to locate specific settings.</div>
<div><em>Notes: </em>
<ul>
<li>Lifecycle functions documentation has been moved to the Development section.</li>
<li>Email and Upload Providers documentation have been included in the corresponding Features pages.</li>
</div>`
},
items: [
// {
// type: 'html',
// value: 'placeholder', // a value is required for the HTML type, but it is not rendered
// customProps: {
// text: "The section has been simplified",
// tooltip: `We simplified the admin panel configuration section to make it easier to navigate and find what you need.</div><div>The new structure groups configurations by their purpose, making it more intuitive to locate specific settings.</div>`
// }
// },
{
type: 'link',
label: 'Introduction',
Expand Down Expand Up @@ -284,14 +301,27 @@ const sidebars = {
]
},
'cms/configurations/api',
'cms/configurations/cron',
{
type: 'doc',
id: 'cms/configurations/cron',
customProps: {
updated: false,
// tooltip: `<strong>Important changes</strong><br/><br/>
// <span>This tooltip can be used to display short pieces of information.</span><br><br>
// We may use bullets in the tooltip as well:<br>
// <ul>
// <li>This item is purely informative</li>
// <li>Please avoid using links here as those tooltips are not hoverable</li>
// </ul><br/>`
},
},
{
type: 'category',
collapsed: true,
collapsible: true,
label: "Database",
customProps: {
updated: false,
tooltip: 'This section now regroups all the database-related configurations and guides, including migrations and transactions.'
},
items: [
{
Expand Down Expand Up @@ -369,9 +399,34 @@ const sidebars = {
label: 'Admin panel customization',
collapsed: true,
customProps: {
updated: true,
updated: false,
// text: `The section has been reorganized`,
// tooltip: `We have reorganized the admin panel customization section to make it easier to navigate and find what you need.</div>
// <div>The new structure groups customizations by their purpose, making it more intuitive to locate specific settings.</div>
// <div><em>Notes: </em>
// <ul>
// <li>Deployment-related configuration has been moved to the Configurations > Admin panel > Admin panel server page.</li>
// <li>Host, port, and path configuration documentation has been moved to the Configurations > Server page.</li>
// </ul>`
tooltip: "This section has been reorganized, see details below.",
},
items: [
{
type: 'html',
value: 'placeholder', // a value is required for the HTML type, but it is not rendered
customProps: {
text: `The section has been reorganized`,
tooltip: `We have reorganized the admin panel customization section to make it easier to navigate and find what you need.</div>
<br/><br/>
<div>The new structure groups customizations by their purpose, making it more intuitive to locate specific settings.</div>
<br/>
<div><em>Notes: </em>
<ul>
<li>Deployment-related configuration has been moved to the Configurations > Admin panel > <a href="/cms/configurations/admin-panel#admin-panel-server">Admin panel server</a> page.</li>
<li>Host, port, and path configuration documentation has been moved to the Configurations > <a href="/cms/configurations/server">Server page</a></li>
</ul>`
},
},
{
type: 'doc',
id: 'cms/admin-panel-customization',
Expand Down Expand Up @@ -423,6 +478,14 @@ const sidebars = {
collapsible: false,
className: 'category-cms-typescript', // TODO: add CSS for icon
items: [
{
type: 'html',
value: 'placeholder', // a value is required for the HTML type, but it is not rendered
customProps: {
text: "This section is new",
tooltip: "We grouped all the TypeScript-related content into a new section, including configurations, development tips, and guides."
}
},
{
type: 'doc',
id: 'cms/typescript',
Expand Down Expand Up @@ -1002,4 +1065,4 @@ const sidebars = {
// ]
};

module.exports = sidebars;
module.exports = sidebars;
15 changes: 15 additions & 0 deletions docusaurus/src/components/InfoIcon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import clsx from 'clsx';

export default function InfoIcon({ tooltip, className }) {
if (!tooltip) return null;

return (
<span className={clsx('info-icon', className)}>
<div className="info-icon__tooltip">
<div dangerouslySetInnerHTML={{ __html: tooltip }} />
<div className="tooltip-arrow"></div>
</div>
</span>
);
}
Loading
Loading