|
- | - B
+ |
-
|
|
- | - F
+ |
-
|
|
|
@@ -119,12 +119,12 @@ class TocDirectiveSpec extends MarkdownBaseSpec {
|
B
|
|
- | - C
+ |
-
|
|
- | - E
+ |
|
|
|
C
@@ -146,9 +146,9 @@ class TocDirectiveSpec extends MarkdownBaseSpec {
|
A
|
|
@@ -168,9 +168,9 @@ class TocDirectiveSpec extends MarkdownBaseSpec {
|
A
|
|
- | - B
+ |
-
|
- | - C
+ |
|
|
|
diff --git a/docs/src/main/resources/tab-switching/examples.java b/docs/src/main/resources/tab-switching/examples.java
index 349e7bee..5684dc55 100644
--- a/docs/src/main/resources/tab-switching/examples.java
+++ b/docs/src/main/resources/tab-switching/examples.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2015 - 2017 Lightbend, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
// #java_first
class JavaFirst {
public static void main(String[] args) {
diff --git a/docs/src/main/resources/tab-switching/examples.scala b/docs/src/main/resources/tab-switching/examples.scala
index b823ae87..f79a03f5 100644
--- a/docs/src/main/resources/tab-switching/examples.scala
+++ b/docs/src/main/resources/tab-switching/examples.scala
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2015 - 2017 Lightbend, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
// #scala_first
object ScalaFirst extends App {
println("Hello scala!")
diff --git a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxKeys.scala b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxKeys.scala
index 896971cc..c957efad 100644
--- a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxKeys.scala
+++ b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxKeys.scala
@@ -24,6 +24,8 @@ trait ParadoxKeys {
val paradox = taskKey[File]("Build the paradox site.")
val paradoxMarkdownToHtml = taskKey[Seq[(File, String)]]("Convert markdown files to HTML.")
val paradoxNavigationDepth = settingKey[Int]("Determines depth of TOC for page navigation.")
+ val paradoxNavigationExpandDepth = settingKey[Option[Int]]("Depth of auto-expanding navigation below the active page.")
+ val paradoxNavigationIncludeHeaders = settingKey[Boolean]("Whether to include headers in the navigation.")
val paradoxLeadingBreadcrumbs = settingKey[List[(String, String)]]("Any leading breadcrumbs (label -> url)")
val paradoxOrganization = settingKey[String]("Paradox dependency organization (for theme dependencies).")
val paradoxProcessor = taskKey[ParadoxProcessor]("ParadoxProcessor to use when generating the site.")
diff --git a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala
index 9718a7a8..543c9f3d 100644
--- a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala
+++ b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala
@@ -43,6 +43,8 @@ object ParadoxPlugin extends AutoPlugin {
paradoxSourceSuffix := ".md",
paradoxTargetSuffix := ".html",
paradoxNavigationDepth := 2,
+ paradoxNavigationExpandDepth := None,
+ paradoxNavigationIncludeHeaders := false,
paradoxProperties := Map.empty,
paradoxTheme := Some(builtinParadoxTheme("generic")),
paradoxDefaultTemplateName := "page",
@@ -130,6 +132,8 @@ object ParadoxPlugin extends AutoPlugin {
paradoxGroups.value,
paradoxProperties.value,
paradoxNavigationDepth.value,
+ paradoxNavigationExpandDepth.value,
+ paradoxNavigationIncludeHeaders.value,
paradoxTemplate.value,
new PageTemplate.ErrorLogger(s => streams.value.log.error(s))
)
diff --git a/plugin/src/sbt-test/paradox/navigation/build.sbt b/plugin/src/sbt-test/paradox/navigation/build.sbt
new file mode 100644
index 00000000..4aef2426
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/build.sbt
@@ -0,0 +1,10 @@
+lazy val docs = project
+ .in(file("."))
+ .enablePlugins(ParadoxPlugin)
+ .settings(
+ name := "Paradox Navigation Test",
+ paradoxTheme := None,
+ paradoxNavigationDepth := 1,
+ paradoxNavigationExpandDepth := Some(1),
+ paradoxNavigationIncludeHeaders := true
+ )
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/1.html b/plugin/src/sbt-test/paradox/navigation/expected/1.html
new file mode 100644
index 00000000..7d394f60
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/1.html
@@ -0,0 +1,8 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/1/a.html b/plugin/src/sbt-test/paradox/navigation/expected/1/a.html
new file mode 100644
index 00000000..e6c4fcd8
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/1/a.html
@@ -0,0 +1,12 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/1/a/i.html b/plugin/src/sbt-test/paradox/navigation/expected/1/a/i.html
new file mode 100644
index 00000000..c712bb62
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/1/a/i.html
@@ -0,0 +1,16 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/1/a/ii.html b/plugin/src/sbt-test/paradox/navigation/expected/1/a/ii.html
new file mode 100644
index 00000000..7d919a50
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/1/a/ii.html
@@ -0,0 +1,16 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/1/b.html b/plugin/src/sbt-test/paradox/navigation/expected/1/b.html
new file mode 100644
index 00000000..0f02d0c7
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/1/b.html
@@ -0,0 +1,8 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/2.html b/plugin/src/sbt-test/paradox/navigation/expected/2.html
new file mode 100644
index 00000000..5c7620af
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/2.html
@@ -0,0 +1,8 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/2/a.html b/plugin/src/sbt-test/paradox/navigation/expected/2/a.html
new file mode 100644
index 00000000..4c73c2cc
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/2/a.html
@@ -0,0 +1,8 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/2/b.html b/plugin/src/sbt-test/paradox/navigation/expected/2/b.html
new file mode 100644
index 00000000..cd83affb
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/2/b.html
@@ -0,0 +1,8 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/expected/index.html b/plugin/src/sbt-test/paradox/navigation/expected/index.html
new file mode 100644
index 00000000..8e0488ec
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/expected/index.html
@@ -0,0 +1,4 @@
+
diff --git a/plugin/src/sbt-test/paradox/navigation/project/plugins.sbt b/plugin/src/sbt-test/paradox/navigation/project/plugins.sbt
new file mode 100644
index 00000000..be8b011a
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/project/plugins.sbt
@@ -0,0 +1 @@
+addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % sys.props("project.version"))
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1.md
new file mode 100644
index 00000000..d654202c
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1.md
@@ -0,0 +1 @@
+# 1
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a.md
new file mode 100644
index 00000000..62b95e96
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a.md
@@ -0,0 +1 @@
+# 1/a
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/i.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/i.md
new file mode 100644
index 00000000..f487d5c6
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/i.md
@@ -0,0 +1,5 @@
+# 1/a/i
+## h2 1
+### h3 1
+## h2 2
+### h3 2
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/ii.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/ii.md
new file mode 100644
index 00000000..4a2000a8
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/a/ii.md
@@ -0,0 +1,5 @@
+# 1/a/ii
+## h2 1
+### h3 1
+## h2 2
+### h3 2
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/b.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/b.md
new file mode 100644
index 00000000..bc38e2ac
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/1/b.md
@@ -0,0 +1 @@
+# 1/b
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2.md
new file mode 100644
index 00000000..b1eab243
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2.md
@@ -0,0 +1 @@
+# 2
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/a.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/a.md
new file mode 100644
index 00000000..82916325
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/a.md
@@ -0,0 +1 @@
+# 2/a
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/b.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/b.md
new file mode 100644
index 00000000..78e40079
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/2/b.md
@@ -0,0 +1 @@
+# 2/b
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/_template/page.st b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/_template/page.st
new file mode 100644
index 00000000..4901fc07
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/_template/page.st
@@ -0,0 +1 @@
+$page.navigation$
diff --git a/plugin/src/sbt-test/paradox/navigation/src/main/paradox/index.md b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/index.md
new file mode 100644
index 00000000..94f79ec1
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/src/main/paradox/index.md
@@ -0,0 +1,12 @@
+@@@ index
+
+* [1](1.md)
+ - [a](1/a.md)
+ + [i](1/a/i.md)
+ + [ii](1/a/ii.md)
+ - [b](1/b.md)
+* [2](2.md)
+ - [a](2/a.md)
+ - [b](2/b.md)
+
+@@@
diff --git a/plugin/src/sbt-test/paradox/navigation/test b/plugin/src/sbt-test/paradox/navigation/test
new file mode 100644
index 00000000..8f2daafb
--- /dev/null
+++ b/plugin/src/sbt-test/paradox/navigation/test
@@ -0,0 +1,11 @@
+> paradox
+
+$ must-mirror target/paradox/site/main/index.html expected/index.html
+$ must-mirror target/paradox/site/main/1.html expected/1.html
+$ must-mirror target/paradox/site/main/1/a.html expected/1/a.html
+$ must-mirror target/paradox/site/main/1/a/i.html expected/1/a/i.html
+$ must-mirror target/paradox/site/main/1/a/ii.html expected/1/a/ii.html
+$ must-mirror target/paradox/site/main/1/b.html expected/1/b.html
+$ must-mirror target/paradox/site/main/2.html expected/2.html
+$ must-mirror target/paradox/site/main/2/a.html expected/2/a.html
+$ must-mirror target/paradox/site/main/2/b.html expected/2/b.html
diff --git a/plugin/src/sbt-test/paradox/site/expected/a.html b/plugin/src/sbt-test/paradox/site/expected/a.html
index 537bc819..6f19b93e 100644
--- a/plugin/src/sbt-test/paradox/site/expected/a.html
+++ b/plugin/src/sbt-test/paradox/site/expected/a.html
@@ -14,17 +14,17 @@
A
AA
A
@@ -33,42 +33,42 @@ A<
Next is the TOC.
Followed by the index of a select number of pages.
diff --git a/plugin/src/sbt-test/paradox/site/expected/a/a.html b/plugin/src/sbt-test/paradox/site/expected/a/a.html
index 76f35188..d681080c 100644
--- a/plugin/src/sbt-test/paradox/site/expected/a/a.html
+++ b/plugin/src/sbt-test/paradox/site/expected/a/a.html
@@ -15,17 +15,17 @@
AA
A
AB
diff --git a/plugin/src/sbt-test/paradox/site/expected/a/b.html b/plugin/src/sbt-test/paradox/site/expected/a/b.html
index ecbaa37a..f5fdb62c 100644
--- a/plugin/src/sbt-test/paradox/site/expected/a/b.html
+++ b/plugin/src/sbt-test/paradox/site/expected/a/b.html
@@ -16,17 +16,17 @@
AB
AA
AC
diff --git a/plugin/src/sbt-test/paradox/site/expected/a/c.html b/plugin/src/sbt-test/paradox/site/expected/a/c.html
index fb4170ee..9f751db4 100644
--- a/plugin/src/sbt-test/paradox/site/expected/a/c.html
+++ b/plugin/src/sbt-test/paradox/site/expected/a/c.html
@@ -16,17 +16,17 @@
AC
AB
BA
diff --git a/plugin/src/sbt-test/paradox/site/expected/b/a.html b/plugin/src/sbt-test/paradox/site/expected/b/a.html
index 940e4155..596cba4c 100644
--- a/plugin/src/sbt-test/paradox/site/expected/b/a.html
+++ b/plugin/src/sbt-test/paradox/site/expected/b/a.html
@@ -15,17 +15,17 @@
BA
AC
BAA
diff --git a/plugin/src/sbt-test/paradox/site/expected/b/a/a.html b/plugin/src/sbt-test/paradox/site/expected/b/a/a.html
index 192f96ab..1c0615ce 100644
--- a/plugin/src/sbt-test/paradox/site/expected/b/a/a.html
+++ b/plugin/src/sbt-test/paradox/site/expected/b/a/a.html
@@ -16,17 +16,17 @@
BAA
BA
BB
diff --git a/plugin/src/sbt-test/paradox/site/expected/b/b.html b/plugin/src/sbt-test/paradox/site/expected/b/b.html
index 51095c22..21530523 100644
--- a/plugin/src/sbt-test/paradox/site/expected/b/b.html
+++ b/plugin/src/sbt-test/paradox/site/expected/b/b.html
@@ -16,17 +16,17 @@
BB
BAA
CA
diff --git a/plugin/src/sbt-test/paradox/site/expected/c/a.html b/plugin/src/sbt-test/paradox/site/expected/c/a.html
index 2028a0ff..e66cb859 100644
--- a/plugin/src/sbt-test/paradox/site/expected/c/a.html
+++ b/plugin/src/sbt-test/paradox/site/expected/c/a.html
@@ -15,17 +15,17 @@
CA
BB
CA