{"id":10700,"date":"2026-05-19T04:30:12","date_gmt":"2026-05-18T20:30:12","guid":{"rendered":"https:\/\/aeosub.com\/mocursor-toc\/"},"modified":"2026-05-19T04:30:12","modified_gmt":"2026-05-18T20:30:12","slug":"mocursor-toc","status":"publish","type":"post","link":"https:\/\/aeosub.com\/zh\/mocursor-toc\/","title":{"rendered":"Mocursor Smart TOC"},"content":{"rendered":"<div class=\"post-img\" style=\"margin-bottom: 25px\"><img decoding=\"async\" src=\"https:\/\/ps.w.org\/mocursor-toc\/assets\/banner-772x250.jpg?rev=3536255\" alt=\"Mocursor Smart TOC\" style=\"width: 100%;height: auto;border-radius: 12px\"><\/div>\n<div class=\"plugin-info-card\" style=\"border: 1px solid #e2e8f0;border-radius: 10px;overflow: hidden;margin-bottom: 30px;font-family: -apple-system, system-ui, sans-serif;background: #fff\">\n<table style=\"width: 100%;border-collapse: collapse;font-size: 14px\">\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 15px 20px;text-align: left;width: 35%;color: #4a5568;background: #fcfcfc\"><img decoding=\"async\" src=\"https:\/\/ps.w.org\/mocursor-toc\/assets\/icon.svg?rev=3536255\" style=\"width: 40px;height: 40px;border-radius: 6px;margin-right: 12px;vertical-align: middle\"> Developer<\/th>\n<td style=\"padding: 15px 20px;font-weight: 500\"><a href=\"https:\/\/profiles.wordpress.org\/mosescursor\/\" target=\"_blank\" rel=\"noopener\">Moses Cursor Ssebunya<\/a><\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Version<\/th>\n<td style=\"padding: 12px 20px\">v1.0.2<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Active Installs<\/th>\n<td style=\"padding: 12px 20px\">0 +<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Requires \/ Tested<\/th>\n<td style=\"padding: 12px 20px\">6.4 \/ 7.0<\/td>\n<\/tr>\n<tr style=\"border-bottom: 1px solid #edf2f7\">\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Last Updated<\/th>\n<td style=\"padding: 12px 20px\">2026-05-18 7:47pm GMT<\/td>\n<\/tr>\n<tr>\n<th style=\"padding: 12px 20px;text-align: left;color: #4a5568;background: #fcfcfc\">Official Link<\/th>\n<td style=\"padding: 12px 20px\"><a href=\"https:\/\/wordpress.org\/plugins\/mocursor-toc\/\" target=\"_blank\" style=\"text-decoration: none;color: #4a3bca;font-weight: bold\" rel=\"noopener\">View Details \u2192<\/a><\/td>\n<\/tr>\n<\/table><\/div>\n<div class=\"plugin-short-desc\" style=\"margin: 20px 0;padding: 12px 15px;background: #f9fafb;border-left: 4px solid #4a3bca;border-radius: 6px;font-style: italic;color: #4a5568\">A powerful, lightweight Gutenberg block that automatically generates a linked, navigable table of contents from your post headings.<\/div>\n<p><strong>Mocursor Smart TOC<\/strong> is a lightweight, feature-packed Gutenberg block that automatically generates a linked table of contents from the headings in your posts and pages. Simply drop it into your content \u2014 it just works. Also available as a <code>[mctoc]<\/code> shortcode for classic editor users.<\/p>\n<p>The block is <strong>fully dynamic<\/strong>, <strong>accessible<\/strong>, <strong>lightweight<\/strong>, and <strong>theme-aware<\/strong>. It uses WordPress design tokens and CSS custom properties so it inherits your theme&#8217;s colors, fonts, and spacing automatically.<\/p>\n<h4>Shortcode Support<\/h4>\n<p>The Mocursor Smart TOC block is also available as a <code>[mctoc]<\/code> shortcode for use in the classic editor, widgets, or theme templates.<\/p>\n<p><strong>Basic usage:<\/strong><\/p>\n<pre><code>[mctoc]\n<\/code><\/pre>\n<p><strong>With options:<\/strong><\/p>\n<pre><code>[mctoc title=\"On This Page\" include_h2=\"true\" include_h3=\"true\" include_h4=\"false\" numbering=\"nested\" collapsed=\"true\" sticky=\"true\" offset=\"100\" skip=\"1\" exclude_headings=\"Related Posts,Comments\" back_to_top=\"true\"]\n<\/code><\/pre>\n<p><strong>Available shortcode attributes:<\/strong><\/p>\n<ul>\n<li><code>title<\/code> \u2014 TOC heading text (default: &#8220;Table of Contents&#8221;)<\/li>\n<li><code>include_h2<\/code> \u2014 Include H2 headings: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;true&#8221;)<\/li>\n<li><code>include_h3<\/code> \u2014 Include H3 headings: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;true&#8221;)<\/li>\n<li><code>include_h4<\/code> \u2014 Include H4 headings: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;true&#8221;)<\/li>\n<li><code>exclude_headings<\/code> \u2014 Comma-separated heading texts to exclude<\/li>\n<li><code>numbering<\/code> \u2014 Numbering style: &#8220;none&#8221;, &#8220;decimal&#8221;, or &#8220;nested&#8221; (default: &#8220;none&#8221;)<\/li>\n<li><code>collapsed<\/code> \u2014 Start collapsed: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;false&#8221;)<\/li>\n<li><code>sticky<\/code> \u2014 Enable sticky mode: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;false&#8221;)<\/li>\n<li><code>offset<\/code> \u2014 Scroll offset in pixels for fixed headers (default: 80)<\/li>\n<li><code>skip<\/code> \u2014 Number of headings to skip from the start (default: 0)<\/li>\n<li><code>back_to_top<\/code> \u2014 Show &#8220;Back to Top&#8221; link: &#8220;true&#8221; or &#8220;false&#8221; (default: &#8220;false&#8221;)<\/li>\n<\/ul>\n<h4>Ideal Use Cases<\/h4>\n<p>Mocursor Smart TOC is perfect for:<\/p>\n<ul>\n<li><strong>Long-form blog posts<\/strong> \u2014 Help readers navigate 2,000+ word articles with ease.<\/li>\n<li><strong>Documentation and knowledge bases<\/strong> \u2014 Technical docs, how-to guides, and reference pages.<\/li>\n<li><strong>Online courses and tutorials<\/strong> \u2014 Give learners a clear roadmap of every lesson section.<\/li>\n<li><strong>Legal, policy, and compliance pages<\/strong> \u2014 Terms of service, privacy policies, and similar documents.<\/li>\n<li><strong>Product and feature pages<\/strong> \u2014 Long product descriptions with multiple sections.<\/li>\n<li><strong>Recipe and travel blogs<\/strong> \u2014 Readers can jump to the section they care about.<\/li>\n<li><strong>Wiki-style internal sites<\/strong> \u2014 Any WordPress site used as an internal wiki or resource library.<\/li>\n<li><strong>Accessibility-focused sites<\/strong> \u2014 The TOC gives keyboard and screen reader users a reliable way to navigate.<\/li>\n<li><strong>Classic editor users<\/strong> \u2014 The shortcode works perfectly in the classic editor.<\/li>\n<\/ul>\n<h4>Why Choose Mocursor Smart TOC?<\/h4>\n<ol>\n<li><strong>Zero configuration needed<\/strong> \u2014 Drop the block in and it works immediately.<\/li>\n<li><strong>100% Gutenberg-native + Shortcode<\/strong> \u2014 Built as a real Gutenberg block with a classic shortcode fallback.<\/li>\n<li><strong>Dynamic and always up to date<\/strong> \u2014 Server-rendered, always matches the current content.<\/li>\n<li><strong>Incredibly lightweight<\/strong> \u2014 No JavaScript frameworks. Pure vanilla JS for all interactivity.<\/li>\n<li><strong>Deeply customizable<\/strong> \u2014 Rich inspector controls for heading levels, numbering, collapsibility, sticky mode, and more.<\/li>\n<li><strong>Accessible by default<\/strong> \u2014 Proper ARIA attributes, keyboard navigation, semantic HTML, and focus management.<\/li>\n<li><strong>Theme-aware<\/strong> \u2014 Uses WordPress design tokens and CSS custom properties.<\/li>\n<li><strong>No lock-in<\/strong> \u2014 Deactivate the plugin and your content is untouched.<\/li>\n<li><strong>Privacy-friendly<\/strong> \u2014 No external requests, no tracking, no analytics, no cookies.<\/li>\n<li><strong>Open source<\/strong> \u2014 Licensed under GPLv2.<\/li>\n<\/ol>\n<h4>Block Features<\/h4>\n<ul>\n<li>Automatic heading detection for H2, H3, and H4<\/li>\n<li>Heading level filtering with individual checkboxes<\/li>\n<li>Exclude specific headings by text<\/li>\n<li>Skip first N headings option<\/li>\n<li>Three numbering styles: None, Decimal, Nested<\/li>\n<li>Collapsible TOC with configurable default state<\/li>\n<li>Smooth scrolling with configurable offset<\/li>\n<li>Active heading highlight via IntersectionObserver<\/li>\n<li>Back to Top link<\/li>\n<li>Sticky mode<\/li>\n<li>Live editor preview<\/li>\n<li>Full block editor design controls (colors, typography, spacing, borders)<\/li>\n<li>Shortcode support with full attribute control<\/li>\n<\/ul>\n<h4>How to Use<\/h4>\n<p><strong>Method 1: Block Editor<\/strong><\/p>\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Open any post or page in the block editor.<\/li>\n<li>Click the block inserter (+), search for &#8220;Mocursor Smart TOC&#8221;, and insert the block.<\/li>\n<li>Customize via the block settings sidebar.<\/li>\n<li>Publish \u2014 the TOC renders with smooth scrolling and active heading tracking.<\/li>\n<\/ol>\n<p><strong>Method 2: Shortcode<\/strong><\/p>\n<ol>\n<li>In any post, page, or widget, type <code>[mctoc]<\/code>.<\/li>\n<li>Optionally add attributes: <code>[mctoc title=\"Contents\" numbering=\"decimal\" collapsed=\"true\"]<\/code>.<\/li>\n<\/ol>\n<p><strong>Method 3: PHP Template<\/strong><\/p>\n<pre><code>&lt;?php echo do_shortcode( '[mctoc title=\"Page Contents\" numbering=\"nested\"]' ); ?&gt;\n<\/code><\/pre>\n<p><strong>Tips:<\/strong><\/p>\n<ul>\n<li>Place the TOC inside a Group block with a max-width for a contained look.<\/li>\n<li>Enable sticky mode for sidebar layouts.<\/li>\n<li>Use the shortcode in classic editor widgets or template files.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A powerful, lightweight Gutenberg block that automatically generates a linked, navigable table of contents from your post headings.<\/p>","protected":false},"author":1,"featured_media":9317,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[252],"tags":[555],"class_list":["post-10700","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-trends","tag-wordpress-plugin"],"_links":{"self":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts\/10700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/comments?post=10700"}],"version-history":[{"count":0,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/posts\/10700\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/media\/9317"}],"wp:attachment":[{"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/media?parent=10700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/categories?post=10700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aeosub.com\/zh\/wp-json\/wp\/v2\/tags?post=10700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}