<?php
/*
Plugin Name: SmoothTOC
Description: Automatically generates a Table of Contents for your posts and pages.
Version: 1.0
Author: Hardik Chavada
Author URI: https://www.youtube.com/@hardikchavada9883
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smooth-toc
Domain Path: /languages
*/


if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}


// Include necessary files
require_once plugin_dir_path( __FILE__ ) . 'includes/settings.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/toc-functions.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/admin-functions.php';

// Enqueue CSS and JS
function smoothtoc_enqueue_assets() {
    wp_enqueue_style( 'smoothtoc-style', plugin_dir_url( __FILE__ ) . 'css/easy-toc-style.css', array(), filemtime( plugin_dir_path( __FILE__ ) . 'css/easy-toc-style.css' ) );
    wp_enqueue_script( 'smoothtoc-script', plugin_dir_url( __FILE__ ) . 'js/easy-toc-script.js', array('jquery'), filemtime( plugin_dir_path( __FILE__ ) . 'js/easy-toc-script.js' ), true );
}
add_action( 'wp_enqueue_scripts', 'smoothtoc_enqueue_assets' );

