Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135,263 changes: 135,263 additions & 0 deletions __tests__/__snapshots__/markdown-parsing.test.ts.snap

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions __tests__/fixtures/code-blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Code Blocks Test
description: Tests code block rendering with syntax highlighting
keywords: code, syntax, highlighting
further-reading:
video-overview:
video-content:
---

## JavaScript

```javascript
const engine = new BABYLON.Engine(canvas, true);
const scene = new BABYLON.Scene(engine);
const camera = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 5, -10), scene);
```

## TypeScript

```typescript
interface MeshOptions {
name: string;
position: BABYLON.Vector3;
rotation?: BABYLON.Vector3;
}

const createMesh = (options: MeshOptions): BABYLON.Mesh => {
const mesh = BABYLON.MeshBuilder.CreateBox(options.name, {}, scene);
mesh.position = options.position;
return mesh;
};
```

## Shell Commands

```shell
npm install babylonjs --save
```

## GLSL

```glsl
precision highp float;
varying vec2 vUV;
uniform sampler2D textureSampler;

void main(void) {
gl_FragColor = texture2D(textureSampler, vUV);
}
```

## Inline Code

Use `BABYLON.Engine` to create the engine and `scene.render()` to render.
67 changes: 67 additions & 0 deletions __tests__/fixtures/complex-mixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Complex Mixed Content Test
description: Tests complex combinations of markdown features
keywords: mixed, complex, html
further-reading:
video-overview:
video-content:
---

## Lists

### Unordered Lists

- First item
- Second item with **bold**
- Third item with `code`
- Nested item
- Another nested item
- Deep nested

### Ordered Lists

1. Step one
2. Step two
3. Step three
1. Sub-step
2. Another sub-step

## Blockquotes

> This is a simple blockquote.

> "VRM" is **a file format for handling 3D humanoid avatar** data for use in VR applications.
> It is based on glTF 2.0.

> **Note:** This is an important note with a [link](https://example.com) inside.

## HTML in Markdown

Press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd> to open the inspector.

Use the <code>scene.debugLayer.show()</code> method.

<br/>

## Mixed Formatting

This paragraph has **bold text**, *italic text*, ***bold italic***, ~~strikethrough~~, and `inline code` all together.

## Complex Table

| Method | Parameters | Returns | Description |
| ------ | ---------- | ------- | ----------- |
| `createScene()` | `engine: Engine` | `Scene` | Creates a new scene |
| `addMesh()` | `name: string, options?: object` | `Mesh` | Adds a mesh to scene |
| `render()` | none | `void` | Renders the frame |

## Escaped Characters

Use \*asterisks\* and \[brackets\] literally.

## Line Breaks

First line with two trailing spaces
Second line right after.

Hard break above.
49 changes: 49 additions & 0 deletions __tests__/fixtures/custom-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Custom Components Test
description: Tests all custom MDX components
keywords: playground, youtube, alert, nme
further-reading:
video-overview:
video-content:
---

## Playground Examples

<Playground id="#2KRNG9" title="Basic Scene" description="A simple scene setup"/>

<Playground id="#HVHYJC#82" title="HtmlMesh Example" description="Example of using HtmlMesh" image="/img/playgroundsAndNMEs/htmlMeshPG.png"/>

<Playground id="#YX6IB8#758" engine="webgpu" title="Ocean Demo" description="Ocean simulation" image="/img/extensions/webgpu/ocean.png" isMain={true} category="WebGPU"/>

## Node Material Editor

<NME id="#3WEKUZ#1" title="Custom Perlin2D" description="A node material with Perlin2D block" image="/img/playgroundsAndNMEs/NMEPerlin2DCustomBlock.jpg"/>

<nme id="" title="NME Editor" description="The starting basic template"/>

## Node Geometry Editor

<NGE id="#W1WROK" title="Aggregator" description="Simple example of Aggregator Node"/>

## YouTube Videos

<Youtube id="qqMuuSM7GvI"/>

<Youtube id="v02wuOGD0Sg"/>

## Alert Components

<Alert severity="warning" title="Warning" description="The CDN should not be used in production environments."/>

<Alert severity="info">
This is an info alert with **markdown** content inside.
It supports multiple lines.
</Alert>

## CodePen

<CodePen pen="ByaZQEp" tab="html,result" title="Configurator Test"/>

## CodeSandbox

<CodeSandbox id="msdvk8" title="Inspector V2" height="600px"/>
27 changes: 27 additions & 0 deletions __tests__/fixtures/frontmatter-variations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Frontmatter Variations Test
image: /img/pageImages/testPage.jpg
image-url: /img/defaultImage.png
description: Tests various frontmatter field combinations
keywords: frontmatter, metadata, gray-matter
further-reading:
- title: First Related Article
url: /features/first
- title: Second Related Article
url: /features/second
- title: External Resource
url: https://www.example.com/resource
video-overview: dISLIZ4SdAM
video-content:
- title: Getting Started
url: https://youtu.be/qqMuuSM7GvI
- title: Advanced Topics
url: https://youtu.be/v02wuOGD0Sg
toc-levels: 0
---

## Content After Frontmatter

This tests that complex frontmatter is correctly parsed and separated from content.

The content should start here, not include any frontmatter data.
36 changes: 36 additions & 0 deletions __tests__/fixtures/gfm-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: GFM Features Test
description: Tests GitHub Flavored Markdown features
keywords: gfm, tables, strikethrough
further-reading:
video-overview:
video-content:
---

## Tables

| Feature | Status | Notes |
| ------- | ------ | ----- |
| Tables | ✅ | Working |
| Strikethrough | ✅ | Working |
| Task Lists | ✅ | Working |

## Strikethrough

This is ~~deleted text~~ in a sentence.

## Task Lists

- [x] Completed task
- [ ] Incomplete task
- [x] Another completed task

## Autolinks

Visit https://www.babylonjs.com for more info.

## Footnotes

Here is a sentence with a footnote[^1].

[^1]: This is the footnote content.
31 changes: 31 additions & 0 deletions __tests__/fixtures/headings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Test Headings Page
image: /img/test.jpg
description: A test page for heading IDs
keywords: test, headings, slug
further-reading:
video-overview:
video-content:
---

# Main Heading

## Getting Started

Some introductory text.

### Installation Steps

Step by step guide.

#### Sub Detail

More details here.

## API Reference

Another section with **bold** and *italic* text.

### Special Characters in Heading: `code` & "quotes"

Content below special heading.
49 changes: 49 additions & 0 deletions __tests__/fixtures/links-and-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Links and Images Test
description: Tests various link and image patterns
keywords: links, images, internal, external
further-reading:
- title: Related Article
url: /features/featuresDeepDive
- title: External Link
url: https://www.babylonjs.com
video-overview: qqMuuSM7GvI
video-content:
- title: Tutorial Video
url: https://youtu.be/qqMuuSM7GvI
toc-levels: 2
---

## Internal Links

Check out the [Features Manager](/features/featuresDeepDive/webXR/webXRFeaturesManager) for more info.

See [Load Files with Assets Manager](/contribute/contributeToDocs) for the guide.

## External Links

Visit [Babylon.js Homepage](https://www.babylonjs.com) for the latest news.

Check [caniuse.com](https://caniuse.com/#feat=webxr) for browser support.

## GitHub References

by [deltakosh](https://github.com/deltakosh) ([#14931](https://github.com/BabylonJS/Babylon.js/pull/14931))

## API Links

See [VideoTexture](/typedoc/classes/babylon.videotexture) documentation.

## Markdown Images

![Horse Animation](/img/features/animation/horse_frames.jpg)

![Scene Overview](/img/features/scene_overview.png)

## HTML Images

<img src="/img/tools/guiEditor/overview.jpg" title="GUI Editor"/>

## Mixed Content

Here is a paragraph with **bold**, *italic*, `inline code`, and a [link](https://example.com).
33 changes: 33 additions & 0 deletions __tests__/fixtures/math-equations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Math Equations Test
description: Tests math equation rendering
keywords: math, katex, equations
further-reading:
video-overview:
video-content:
---

## Inline Math

The formula $E = mc^2$ is well known. Also $\alpha + \beta = \gamma$.

## Block Math

$$
Proj_{ortho} = \begin{bmatrix}
a & 0 & 0 & 0\\
0 & b & 0 & 0\\
0 & 0 & c & 0\\
i0 & i1 & d & 1
\end{bmatrix}
$$

## Fractions and Complex

$$
c = \frac{2}{f - n}
$$

$$
\sum_{i=0}^{n} x_i = x_0 + x_1 + \ldots + x_n
$$
Loading