Skip to content

TOC not complete when using Readfile #1370

@johnhansarickWallaroo

Description

@johnhansarickWallaroo

I tried scanning the issues so hopefully this isn't a repeat.

I use readfile for different purposes (including snippets of the same code into multiple pages, etc), and one thing I've noticed is if headers are in the readfile, then the TOC isn't generating those links.

For example, if we have this:

## Introduction

This will help you install this program.

{{< readfile "/includes/warning_notice.md" >}}

and if warning_notice.md contains:

### General Warnings

Hi!  Don't forget if you install this program then press G, your computer will explode!

The TOC will be:

## Introduction

I may have to revamp the toc.html shortcode myself, but has anything else looked into this, and is there a flag we can add to the readfile shortcode (or the toc?) to include the headers from readfile command into the toc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions