{"id":78317,"date":"2017-11-29T23:19:46","date_gmt":"2017-11-29T23:19:46","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/shortcode-table-of-contents\/"},"modified":"2018-07-31T19:00:51","modified_gmt":"2018-07-31T19:00:51","slug":"shortcode-toc","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/shortcode-toc\/","author":8208220,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.3","stable_tag":"trunk","tested":"4.9.29","requires":"4.0","requires_php":"","requires_plugins":"","header_name":"Shortcode Table of Contents","header_author":"James Kemp","header_description":"Display an automated table of contents via shortcode.","assets_banners_color":"5aaae0","last_updated":"2018-07-31 19:00:51","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/jamesckemp\/","header_plugin_uri":"http:\/\/jckemp.com","header_author_uri":"https:\/\/jckemp.com","rating":4.7,"author_block_rating":0,"active_installs":300,"downloads":27931,"num_ratings":6,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":"1","4":0,"5":"5"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1778245","resolution":"128x128","location":"assets"},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1778245","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1778245","resolution":"1544x500","location":"assets"},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1778245","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1","1.0.2","1.0.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1779328","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1779328","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1779328","resolution":"3","location":"assets"},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1779328","resolution":"4","location":"assets"}},"screenshots":{"1":"Add the <code>[toc]<\/code> shortcode to any post\/page\/custom-post-type, at any position in the content.","2":"A nested list will be generated based on the headings within your chosen HTML element.","3":"Add the <code>anchor-text<\/code> parameter.","4":"When the <code>anchor-text<\/code> parameter is set, the text will be appended to your headings so your users can easily copy the link to that section."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[150136,7205,150135,10851,10852],"plugin_category":[],"plugin_contributors":[81392],"plugin_business_model":[],"class_list":["post-78317","plugin","type-plugin","status-publish","hentry","plugin_tags-anchorific","plugin_tags-anchors","plugin_tags-shortcode-table-of-contents","plugin_tags-table-of-contents","plugin_tags-toc","plugin_contributors-jamesckemp","plugin_committers-jamesckemp"],"banners":{"banner":"https:\/\/ps.w.org\/shortcode-toc\/assets\/banner-772x250.png?rev=1778245","banner_2x":"https:\/\/ps.w.org\/shortcode-toc\/assets\/banner-1544x500.png?rev=1778245","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/shortcode-toc\/assets\/icon-128x128.png?rev=1778245","icon_2x":"https:\/\/ps.w.org\/shortcode-toc\/assets\/icon-256x256.png?rev=1778245","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/shortcode-toc\/assets\/screenshot-1.png?rev=1779328","caption":"Add the <code>[toc]<\/code> shortcode to any post\/page\/custom-post-type, at any position in the content."},{"src":"https:\/\/ps.w.org\/shortcode-toc\/assets\/screenshot-2.png?rev=1779328","caption":"A nested list will be generated based on the headings within your chosen HTML element."},{"src":"https:\/\/ps.w.org\/shortcode-toc\/assets\/screenshot-3.png?rev=1779328","caption":"Add the <code>anchor-text<\/code> parameter."},{"src":"https:\/\/ps.w.org\/shortcode-toc\/assets\/screenshot-4.png?rev=1779328","caption":"When the <code>anchor-text<\/code> parameter is set, the text will be appended to your headings so your users can easily copy the link to that section."}],"raw_content":"<!--section=description-->\n<p>Simply use the <code>[toc content=\".your-container\"]<\/code> shortcode to automatically generate a table of contents for any HTML container.<\/p>\n\n<p>The shortcode accepts a number of parameters:<\/p>\n\n<ul>\n<li><code>content<\/code> <em>string<\/em> <strong>required<\/strong>\nA CSS selector indicating the container of your content.<\/li>\n<li><code>headers<\/code> <em>string<\/em>\nA comma separated list of heading selectors that you want to include.<\/li>\n<li><code>speed<\/code> <em>int<\/em>\nSpeed of sliding back to top.<\/li>\n<li><code>anchor-class<\/code> <em>string<\/em>\nClass of anchor links.<\/li>\n<li><code>anchor-text<\/code> <em>string<\/em>\nPrepended or appended to anchor headings. Leave blank to disable anchor links.<\/li>\n<li><code>top_class<\/code> <em>string<\/em>\nBack to top button or link class.<\/li>\n<li><code>spy<\/code> <em>true\/false<\/em>\nEnable scroll spy. This will highlight the list items as you scroll past them.<\/li>\n<li><code>position<\/code> <em>append\/prepend<\/em>\nPosition of anchor text.<\/li>\n<li><code>spy-offset<\/code> <em>int<\/em>\nSpecify heading offset for spy scrolling.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/shortcode-toc<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>Upload the plugin files to the <code>\/wp-content\/plugins\/shortcode-toc<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<\/ol><\/dd>\n<dt>Can I use the shortcode multiple times on a page?<\/dt>\n<dd><p>No. Currently it'll only work once per page.<\/p><\/dd>\n<dt>The table of contents isn't showing up.<\/dt>\n<dd><p>Did you set the <code>content<\/code> parameter of the shortcode to a valid CSS selector on your page? This is a required argument.<\/p><\/dd>\n<dt>Can I build a table of contents for just h2 and h3 tags?<\/dt>\n<dd><p>Yup, your shortcode would look like this <code>[toc content=\".your-container\" headers=\"h2,h3\"]<\/code><\/p><\/dd>\n<dt>Is there a PHP version of the shortcode?<\/dt>\n<dd><p>You can use the <code>do_shortcode()<\/code> function like this:<\/p>\n\n<pre><code>&lt;?php echo do_shortcode( '[toc content=\".your-container\"]' ); ?&gt;\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<p><strong>v1.0.3 (31\/07\/2018)<\/strong>\n[fix] Revert back to original anchorific. Bower one was an old version.<\/p>\n\n<p><strong>v1.0.2 (01\/12\/2017)<\/strong>\n[update] Use latest anchorific.<\/p>\n\n<p><strong>v1.0.1 (30\/11\/2017)<\/strong>\n[update] Remove anchor text by default.\n[fix] Ensure 'spy' param works with true\/false values.<\/p>\n\n<p><strong>v1.0.0 (29\/11\/2017)<\/strong>\n[release] Initial release.<\/p>","raw_excerpt":"Display an automated table of contents via shortcode.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/78317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=78317"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/jamesckemp"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=78317"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=78317"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=78317"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=78317"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=78317"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=78317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}