Skip to content

Commit

Permalink
Update the "#+toc: headlines N local" test
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Aug 7, 2018
1 parent 8e21f31 commit 4ed632e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/site/content-org/all-posts.org
Expand Up @@ -4624,8 +4624,18 @@ This post should also be created in =content/section-a/=.
:PROPERTIES:
:EXPORT_FILE_NAME: toc-local
:END:
#+begin_description
Test the ~#+toc: headlines N local~ syntax where a TOC is exported
containing headlines only up to level-N relative to the headline in
which that keyword is used.
#+end_description
Below, TOC is exported with only level-1 headings in this post.
#+toc: headlines 1

Below exported TOC should look the same as above even when it's
generated using the ~local~ param as it is at the root level of this
post.
#+toc: headlines 1 local
**** Post sub-heading 1
Below, TOC is exported with only level-1 headings *relative to* this
"Post sub-heading 1" section.
Expand Down
19 changes: 19 additions & 0 deletions test/site/content/posts/toc-local.md
@@ -1,5 +1,10 @@
+++
title = "TOC Local"
description = """
Test the `#+toc: headlines N local` syntax where a TOC is exported
containing headlines only up to level-N relative to the headline in
which that keyword is used.
"""
tags = ["keyword", "toc", "local"]
draft = false
+++
Expand All @@ -18,6 +23,20 @@ Below, TOC is exported with only level-1 headings in this post.
</div>
<!--endtoc-->

Below exported TOC should look the same as above even when it's
generated using the `local` param as it is at the root level of this
post.

<div class="ox-hugo-toc toc local level-1">
<div></div>

- [Post sub-heading 1](#post-sub-heading-1)
- [Post sub-heading 2](#post-sub-heading-2)
- [Post sub-heading 3](#post-sub-heading-3)

</div>
<!--endtoc-->


## Post sub-heading 1 {#post-sub-heading-1}

Expand Down

0 comments on commit 4ed632e

Please sign in to comment.