hugo
hugo copied to clipboard
Add basic toc generation for pandoc
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
Is this issue completed? Is there anything remaining to implement? Will it be merged?
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.
Eagerly waiting for this feature. @pagdot any updates?
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
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.
@bep Does this look good to you or is still anything missing?