Skip to content
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

fix: disable heading detection for carousel, accordion and tabs #2154

Merged
merged 18 commits into from
Aug 29, 2024

Conversation

metaboulie
Copy link
Contributor

@metaboulie metaboulie commented Aug 29, 2024

Fixes #2139

📝 Summary

This pull request addresses the issue of excluding certain headings within specific tags (marimo-carousel, marimo-tabs, marimo-accordion) from being included in the document outline generated by the getOutline function, ensures that the document outline generated by the getOutline function is accurate and excludes irrelevant headings within specified custom tags.

🔍 Description of Changes

Changes Made

  1. Excluded Tags Array: Introduced a constant array excludedTags containing the tags marimo-carousel, marimo-tabs, and marimo-accordion.
  2. Updated getOutline Function: Modified the getOutline function to skip headings that are within any of the tags specified in the excludedTags array.
  3. Test Cases: Added test cases to ensure that headings within the excluded tags are not included in the outline, while headings outside these tags are correctly included.

Problem Addressed

Previously, the getOutline function would include all headings (h1, h2, h3) in the document, even if they were within certain custom tags like marimo-carousel, marimo-tabs, and marimo-accordion. This was problematic because headings within these tags should not be part of the document outline.

Resolution

The problem was resolved by:

  • Adding a check in the getOutline function to determine if a heading is within any of the excluded tags.
  • If a heading is found within an excluded tag, it is skipped and not added to the outline.
  • This ensures that only relevant headings are included in the document outline, improving the accuracy and relevance of the generated outline.

Uploading Screenshot 2024-08-29 at 21.23.40.png…

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

📜 Reviewers

@akshayka OR @mscolnick

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2024 1:24pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2024 1:24pm

Copy link
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice job! and thank you for the tests!

@mscolnick mscolnick changed the title fix #2130: disable heading detection for carousel, accordion and tabs fix #2139: disable heading detection for carousel, accordion and tabs Aug 29, 2024
@mscolnick mscolnick merged commit 88be8cc into marimo-team:main Aug 29, 2024
27 of 28 checks passed
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.8.5-dev4

@metaboulie metaboulie deleted the outline branch August 29, 2024 13:53
@metaboulie metaboulie changed the title fix #2139: disable heading detection for carousel, accordion and tabs fix: disable heading detection for carousel, accordion and tabs Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable heading detection for mo.carousel
2 participants