Break pages in html_document by chapters as done in bookdown

I can have code folding and floating toc with this YAML, but get one single html:

---
title: "TEST-1"
output:
  html_document:
    code_folding: hide
    toc: true
    toc_depth: 3
    toc_float:
      collapsed: false
    fig_caption: TRUE
    split_chapter
---
# 1. Approach
  
  Ta ta ta

# 2. Area of Study

* 2.2 Geological setting
Ti ti ti

While with this YAML , I can break by chapters but cannot have code folding or floating toc:

---
title: "TEST-2"
site: bookdown::bookdown_site
output: bookdown::gitbook
documentclass: book
---

# 1. Approach
  
  Ta ta ta

# 2. Area of Study

* 2.2 Geological setting
Ti ti ti

Is there any way to have html_document to be broken into pages by chapter as done with bookdown, but keep code folding and floating toc?

I have tried the following, but still results into 1 single html page:

---
title: "Your Book Title"
author: "Author Name"
site: bookdown::bookdown_site
output:
  bookdown::html_document2:
    toc: true
    toc_float: true
    code_folding: show
    split_by: chapter
documentclass: book
---

# 1. Approach1
  
  Ta ta ta


# 2. Area2

* 2.2 Geological setting
Ti ti ti

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Code folding can be added using JS if you really need it

Please read our documentation html_document2 is a single file format.

gitbook is a book format and TOC is part of the format on the left. No bootstrap in this format, so no floating toc.

You can see if bs4_book format suits you better.

Nowadays, I would advice to start a new project using Quarto and its book format: Creating a Book – Quarto