forked from lightbend/paradox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow any fragment to be switched as part of a group
Expanding on the proposal in lightbend#95, added support for having other parts of the documentation change as well when changing a group.
- Loading branch information
Showing
7 changed files
with
129 additions
and
20 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
36 changes: 36 additions & 0 deletions
36
core/src/test/scala/com/lightbend/paradox/markdown/InlineWrapDirectiveSpec.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright © 2015 - 2016 Lightbend, Inc. <http://www.lightbend.com> | ||
* | ||
* 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. | ||
*/ | ||
|
||
package com.lightbend.paradox.markdown | ||
|
||
import com.lightbend.paradox.tree.Tree.Location | ||
|
||
class InlineWrapDirectiveSpec extends MarkdownBaseSpec { | ||
|
||
"The inline `wrap` directive" should "render wrapping `span`s" in { | ||
markdown("@span[Simple sentence here]") shouldEqual html("<p><span>Simple sentence here</span></p>") | ||
} | ||
|
||
it should "render the example from the docs" in { | ||
markdown("@span[Scala variant containing ***markdown*** and @ref:[Linking](test.md)] { .group-scala }") shouldEqual html(""" | ||
|<p><span class="group-scala">Scala variant containing <strong><em>markdown</em></strong> and <a href="test.html">Linking</a></span></p>""") | ||
} | ||
|
||
it should "support a custom id and custom CSS classes at the same time" in { | ||
markdown("@span[Simple sentence here.] { #yeah .red .blue }") shouldEqual html("""<p><span id="yeah" class="red blue">Simple sentence here.</div></p>""") | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<pre class="prettyprint tab-group-a"><code class="language-scala">private class SomethingElse</code></pre> | ||
<pre class="prettyprint tab-group-b"><code class="language-scala">import scala.util.Try</code></pre> | ||
<pre class="prettyprint group-a"><code class="language-scala">private class SomethingElse</code></pre> | ||
<pre class="prettyprint group-b"><code class="language-scala">import scala.util.Try</code></pre> |
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