Skip to content

Commit

Permalink
Show example for versioning tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChampionAsh5357 committed Oct 10, 2023
1 parent 42e572b commit 57a8b04
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion src/pages/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ If the pseudocode is not explanatory enough to understand the concept, then a fu

If a change occurs between a minor or patch versions of NeoForge, then relevant changes in the documentation should be split into separate sections or put into tabs. This maintains the accuracy of the information depending on the version the modder is currently developing for.

```md
````md
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Expand All @@ -69,22 +69,75 @@ import TabItem from '@theme/TabItem';
<TabItem value="latest" label="Latest">

<!-- Markdown here -->
```java
public void latestMethod() {
// ...
}
```

</TabItem>
<!-- There must be an empty line before and after the Markdown text in a tab. -->
<TabItem value="20.2.67" label="[20.2.35,20.2.67]">

<!-- Markdown here -->
```java
public void previousMethod() {
// ...
}
```

</TabItem>
<TabItem value="20.2.34" label="[20.2.0,20.2.34]">

<!-- Markdown here -->
```java
public void firstMethod() {
// ...
}
```

</TabItem>
</Tabs>
````

Output:

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs defaultValue="latest">
<TabItem value="latest" label="Latest">

<!-- Markdown here -->
```java
public void latestMethod() {
// ...
}
```

</TabItem>
<TabItem value="20.2.67" label="[20.2.35,20.2.67]">

<!-- Markdown here -->
```java
public void previousMethod() {
// ...
}
```

</TabItem>
<TabItem value="20.2.34" label="[20.2.0,20.2.34]">

<!-- Markdown here -->
```java
public void firstMethod() {
// ...
}
```

</TabItem>
</Tabs>

## Style Guide

This documentation uses [Docusaurus][docusaurus], which internally uses [MDX][mdx], to generate the pages. You can find more detailed information about available features on their pages. This style guide will be more focused towards common features and formatting we use in the Markdown files.
Expand Down

1 comment on commit 57a8b04

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: 57a8b04a164d4a29d23eb9f206b6773ed6e16ea6
Status: ✅ Deploy successful!
Preview URL: https://1be28df8.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-14.neoforged-docs-previews.pages.dev

Please sign in to comment.