hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Add basic toc generation for pandoc

Open pagdot opened this issue 3 years ago • 3 comments

As requested in #8152

I've pretty much copied the toc parser code from asciidocext and modified it where necessary.

For toc generation with pandoc to work, I have to generate a standalone document.

This lead to a few (solved) issues:

  • added CSS causing issues: Solved by extracting <body> and ignoring everything else
  • pandoc complains about missing title metadata: Solved by providing dummy title on commandline

pagdot avatar Aug 21 '21 10:08 pagdot

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 21 '21 10:08 CLAassistant

Is this issue completed? Is there anything remaining to implement? Will it be merged?

MilkClouds avatar Apr 27 '22 15:04 MilkClouds

Sorry for the delay, I'm not a Pandoc user and this has not been on top of my priority list.

The code looks good, but we need a test.

Since this PR was started I created a new integration test harness that allows integration tests to run full site builds from the package they live in (e.g. the pandoc package). Look for hugolib.NewIntegrationTest in the master branch.

bep avatar Apr 27 '22 18:04 bep

Eagerly waiting for this feature. @pagdot any updates?

nealkruis avatar Oct 05 '22 23:10 nealkruis

rebased on the current master and added a very basic integration test. I'd like to verify that toc extractions work in a test, but don't really know how

pagdot avatar Oct 06 '22 17:10 pagdot

This PR has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. Please check https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#code-contribution and verify that this code contribution fits with the description. If yes, tell is in a comment. This PR will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

github-actions[bot] avatar Oct 07 '23 01:10 github-actions[bot]

@bep Does this look good to you or is still anything missing?

pagdot avatar Oct 09 '23 13:10 pagdot