diff --git a/_includes/directory-tree.html b/_includes/directory-tree.html
index db24d9687..c185665b2 100644
--- a/_includes/directory-tree.html
+++ b/_includes/directory-tree.html
@@ -9,13 +9,15 @@
Parameters that can be passed as include or Front Matter directory-tree hash:
+ li The generated tree is a list item. Do not wrap an
tag around it.
+
dir_class Add a class attribute with the specified classes to - tags of all directories.
If not set, wrap a tag around titles of all directories.
strong Wrap a tag around titles of the pages that have `strong: true` in the Front Matter.
Default: false.
{%- endcomment -%}
-
+{%- unless include.li or page.directory-tree.li %}{%- endunless %}
{%- if include.dir_class -%}
{%- assign dir_li = '- ' -%}
{%- else -%}
@@ -111,4 +113,4 @@
{%- endfor %}
-
+{% unless include.li or page.directory-tree.li -%}{%- endunless %}
diff --git a/_layouts/doc.html b/_layouts/doc.html
index 8cca60927..409b6a7f0 100644
--- a/_layouts/doc.html
+++ b/_layouts/doc.html
@@ -109,6 +109,7 @@
{% include directory-tree.html
dir="/doc/modules"
+ li=true
strong=true
dir_class="r-docs-subnav list-group-item" %}