Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Conversation

@samredai
Copy link
Contributor

@samredai samredai commented Apr 20, 2022

This adds some shortcodes to the landing-page theme that allows us to include hint-boxes and codetabs (code blocks in a tabbed container for multiple languages). Here's an example of what this looks like:
hint_boxes_and_codetabs

Here's the code directly in the markdown file that utilized the shortcodes to create what's seen above.

---
url: example
toc: true
---
# Example

## Hint Boxes

{{< hint info >}}
This is an info hint box
{{< /hint >}}

{{< hint success >}}
This is a success hint box
{{< /hint >}}

{{< hint warning >}}
This is a warning hint box
{{< /hint >}}

{{< hint error >}}
This is an error hint box
{{< /hint >}}

## Codetabs

{{% codetabs "Example" %}}

{{% addtab "Python" checked %}}
{{% addtab "Java" %}}
{{% addtab "Scala" %}}

{{% tabcontent "Python" %}}
```py
print("Hello, World")
```
{{% /tabcontent %}}

{{% tabcontent "Java" %}}
```java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}
```
{{% /tabcontent %}}

{{% tabcontent "Scala" %}}
```scala
object HelloWorld extends App {
    println("Hello, World")
}
```
{{% /tabcontent %}}

{{% /codetabs %}}

The reason for adding this is to use them for the quickstarts which will be a part of the landing-page.

@samredai samredai mentioned this pull request Apr 25, 2022
@rdblue rdblue merged commit c3d8ca6 into apache:main May 18, 2022
@rdblue
Copy link
Contributor

rdblue commented May 18, 2022

Looks great. Thanks, @samredai!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants