pandoc icon indicating copy to clipboard operation
pandoc copied to clipboard

Missing reference in `sitemap.json` with `chunkedhtml` writer

Open iagobaapellaniz opened this issue 1 year ago • 7 comments

Minimal working example:

This is the MD document

---
title: Wonderful Book
---

To my colleagues

# Introduction

This is a book about how to write a book

These are the files produced by pandoc ... to="chunkedhtml"

0-wonderful-book.html
1-introduction.html
index.html

This is the sitemap.json

{
    "section": {
        "id": "",
        "level": "0",
        "number": null,
        "path": "index.html",
        "title": "Wonderful Book"
    },
    "subsections": [
        {
            "section": {
                "id": "introduction",
                "level": "1",
                "number": "1",
                "path": "1-introduction.html",
                "title": "Introduction"
            },
            "subsections": []
        }
    ]
}

0-wonderful-book.html is missing in the sitemap.

Pandoc version? 3.1.9

iagobaapellaniz avatar Feb 21 '24 22:02 iagobaapellaniz

Please try with the latest version, 3.1.12.1 You can use https://pandoc.org/try/ if you don't want to install locally.

jgm avatar Feb 22 '24 01:02 jgm

Sorry if the issue is fixed on the latest version. I'm using https://github.com/JuliaBinaryWrappers/pandoc_jll.jl. Hence, I cannot update it by myself.

UPDATE2: pandoc_jll.jl is going to be updated to point v3.1.12, see https://github.com/JuliaPackaging/Yggdrasil/pull/8149.

I noticed the bug, but I did not check the latest version. I just rushed to report it. Nevertheless, I hope pandoc_jll updates sooner than later.

Then, is it fixed on v3.1.12.1?

UPDATE: BTW, seems that https://pandoc.org/try/ cannot write to chunkedhtml

iagobaapellaniz avatar Feb 22 '24 07:02 iagobaapellaniz

I updated Pandoc to the latest version and 0-wonderful-book.html is still missing from sitemap.json

I think either sitemap.json should contain a subsectionon which 0-wonderful-book.html appears, or the contents until the first header should go into the title page.

UPDATE: I could try to work on this (whatever the decision is), but I'm not an expert in the languages used for the chunkedhtml writer

iagobaapellaniz avatar Feb 22 '24 12:02 iagobaapellaniz

Yes, trypandoc does write chunkedhtml: https://pandoc.org/try/?params=%7B%22text%22%3A%22---%5Cntitle%3A+Wonderful+Book%5Cn---%5Cn%5CnTo+my+colleagues%5Cn%5Cn%23+Introduction%5Cn%5CnThis+is+a+book+about+how+to+write+a+book%5Cn%22%2C%22to%22%3A%22chunkedhtml%22%2C%22from%22%3A%22markdown%22%2C%22standalone%22%3Atrue%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3Anull%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D

jgm avatar Feb 23 '24 05:02 jgm

Here's the sitemap.json that produces (reformatted for readability):

{
  "section": {
    "id": "",
    "level": "0",
    "number": null,
    "path": "index.html",
    "title": "Wonderful Book"
  },
  "subsections": [
    {
      "section": {
        "id": "introduction",
        "level": "1",
        "number": "1",
        "path": "1-introduction.html#introduction",
        "title": "Introduction"
      },
      "subsections": []
    }
  ]
}

jgm avatar Feb 23 '24 05:02 jgm

Agreed that there ought to be an entry for 0-etc. I need to look into this further.

jgm avatar Feb 23 '24 05:02 jgm

Can you consider to keep 0-etc in de index.htm instead?

In my case I would prefer it. On the other hand referencing to something in 0-etc would be more difficult to implement

iagobaapellaniz avatar Feb 23 '24 08:02 iagobaapellaniz