Skip to content

Commit

Permalink
Fix tables and math (#10)
Browse files Browse the repository at this point in the history
* Implement and test tables, math

---------

Co-authored-by: Lazaro Alonso <[email protected]>
  • Loading branch information
asinghvi17 and lazarusA authored Feb 17, 2024
1 parent 48c1303 commit 69d73dd
Show file tree
Hide file tree
Showing 6 changed files with 614 additions and 16 deletions.
8 changes: 6 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
using Documenter
using DocumenterVitepress

makedocs(; sitename="DocumenterVitepress", authors="LuxDL et al.",
makedocs(;
sitename="DocumenterVitepress",
authors="LuxDL et al.",
modules=[DocumenterVitepress],
warnonly = true,
checkdocs=:all,
format=DocumenterVitepress.MarkdownVitepress(),
draft=false,
source="src", build=joinpath(@__DIR__, "docs_site")
)
)

# To edit the sidebar, you must edit `docs/src/.vitepress/config.mts`.
5 changes: 4 additions & 1 deletion docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from 'vitepress'
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import mathjax3 from "markdown-it-mathjax3";

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -10,8 +11,10 @@ export default defineConfig({
cleanUrls: true,

markdown: {
math: true,
config(md) {
md.use(tabsMarkdownPlugin)
md.use(tabsMarkdownPlugin),
md.use(mathjax3)
},
theme: {
light: "github-light",
Expand Down
71 changes: 71 additions & 0 deletions docs/src/markdown-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,52 @@ export default {
}
```

### Code groups

::: code-group

```js [config.js]
/**
* @type {import('vitepress').UserConfig}
*/
const config = {
// ...
}

export default config
```

```ts [config.ts]
import type { UserConfig } from 'vitepress'

const config: UserConfig = {
// ...
}

export default config
```

:::

### Code focus

```js
export default {
data () {
return {
msg: 'Focused!' // [!code focus]
}
}
}
```
### Lists

1. a
1. b
1. c
1. d
1. e

## Custom Containers

**Input**
Expand Down Expand Up @@ -160,6 +206,31 @@ d content 2

::::


## GitHub-flavored Alerts
See: https://vitepress.dev/guide/markdown#github-flavored-alerts

> [!WARNING]
> Critical content.
## Tables
See: https://vitepress.dev/guide/markdown#github-style-tables

| Tables | Are | Cool |
| ------------- | :-----------: | ----: |
| col 3 is | right-aligned | \$1600 |
| col 2 is | centered | \$12 |
| zebra stripes | are neat | \$1 |

## Equations

When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

Don't type anything after the last double dollar sign, and make sure there are no spaces after the opening double dollar sign in the display math!


## More

Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
Loading

0 comments on commit 69d73dd

Please sign in to comment.