Skip to content

Sreejesh06/Floating-TOC-Extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

39 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Floating TOC Extension

A beautiful, draggable table of contents that floats alongside any webpage, making navigation a breeze!


✨ Features

  • πŸ“‹ Automatic Content Detection: Intelligently identifies your page's main content and headings
  • πŸ–±οΈ Fully Draggable: Position the TOC anywhere on the page
  • 🎨 Sleek Design: Clean, modern interface that complements any website
  • πŸŒ“ Dark Mode Support: Automatically adapts to light and dark websites
  • ⌨️ Keyboard Shortcuts: Toggle with Alt + T for quick access
  • πŸ’Ύ Position Memory: Remembers where you placed it between visits

πŸš€ Getting Started

Installation

  1. Clone this repository:

    git clone <https://github.com/yourusername/floating-toc-extension.git>
    
  2. Install dependencies:

    cd floating-toc-extension
    npm install
    
  3. Build the extension:

    npm run build
    
  4. Load the extension in Chrome:

    • Open chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the dist folder from this project

πŸ› οΈ Development

Project Structure

floating-toc-extension/
β”œβ”€β”€ src/                     # Source code
β”‚   β”œβ”€β”€ components/          # React components
β”‚   β”‚   β”œβ”€β”€ Toc/             # Main TOC component
β”‚   β”‚   └── TocItem/         # Individual TOC item component
β”‚   β”œβ”€β”€ hooks/               # Custom React hooks
β”‚   β”œβ”€β”€ background.js        # Extension background script
β”‚   β”œβ”€β”€ content.js           # Content script injected into pages
β”‚   β”œβ”€β”€ popup.js             # Popup script
β”‚   └── styles.css           # Global styles
β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ icons/                # Extension icons
β”‚   β”œβ”€β”€ manifest.json         # Extension manifest
β”‚   └── popup.html            # Popup HTML
└── webpack.config.js         # Webpack configuration


Commands

  • Build for production:

    npm run build
    
  • Watch mode for development:

    npm run watch
    

🀝 Contributing

We'd love your contributions! Here's how you can help:

  1. 🍴 Fork the repository

  2. 🌿 Create your feature branch:

    git checkout -b feature/amazing-feature
    
  3. πŸ’Ύ Commit your changes:

    git commit -m 'Add some amazing feature'
    
  4. πŸ“€ Push to the branch:

    git push origin feature/amazing-feature
    
  5. πŸ”„ Open a Pull Request


Development Tips

  • The extension uses React for the UI components
  • CSS is included directly in the components
  • Webpack bundles everything together
  • The content script injects the TOC into each webpage

πŸ“ Known Issues

  • TOC may not work correctly on highly dynamic websites
  • Some sites with unusual heading structures might not be detected properly

πŸ“œ License

This project is licensed under the MIT License – see the LICENSE file for details.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published