-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make TOC generation work with num set to nil too
This commit changes the TOC style quite a bit from the earlier version. Read the below mini-blog-in-commit for more info. - Add new function org-hugo--get-headline-number - org-hugo-heading - Use above. - org-hugo--build-toc - Generate unordered list instead of ordered - Update/add tests! @punchagan: You are most likely one of the few affected by the backward incompatible change in this commit. To get sort of the old style of numbered headings in TOC (while unnumbered headings in post body), set `num' to `onlytoc`. Let me know how it works. === mini blog === Earlier, the TOC was exported as ordered list in Markdown. That imposed a limitation that allowed exporting only the last number from a section number. So instead of: 1. Section 1 1.1 Section 1.1 1.2 Section 1.2 It would export as: 1. Section 1 1. Section 1.1 2. Section 1.2 Now the TOC is generated as an *unordered* list in Markdown. - 1. Section 1 - 1.1 Section 1.1 - 1.2 Section 1.2 That would cause both bullets and numbers to show in HTML, so I am using a nifty little trick I discovered in #93 to hide those bullets **if the section numbers are present**. In addition, I also wrap the section numbers in "section-num" class so that user can choose to format them however they like using CSS (May be even hide them). === Fixes #76
- Loading branch information
1 parent
0bf0c7f
commit 4be378e
Showing
22 changed files
with
585 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.