Skip to content

Commit

Permalink
Merge branch 'master' into as/better_build
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 authored May 12, 2024
2 parents 388fd95 + 70aa87d commit de286c6
Show file tree
Hide file tree
Showing 11 changed files with 530 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DocumenterVitepress"
uuid = "4710194d-e776-4893-9690-8d956a29c365"
authors = ["Lazaro Alonso <[email protected]>", "Anshul Singhvi <[email protected]>"]
version = "0.0.15"
version = "0.0.19"

[deps]
ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# DocumenterVitepress.jl
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://luxdl.github.io/DocumenterVitepress.jl)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://luxdl.github.io/DocumenterVitepress.jl/dev)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://luxdl.github.io/DocumenterVitepress.jl/stable/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://luxdl.github.io/DocumenterVitepress.jl/dev/)
[![CI Documenter](https://github.com/LuxDL/DocumenterVitepress.jl/actions/workflows/Documenter.yml/badge.svg)](https://github.com/LuxDL/DocumenterVitepress.jl/actions/workflows/Documenter.yml)

<img src="https://luxdl.github.io/DocumenterVitepress.jl/stable/logo.png" align="right" style="padding-left:10px;" width="180"/>

> [!TIP]
> Visit at https://luxdl.github.io/DocumenterVitepress.jl/dev
> Visit at https://luxdl.github.io/DocumenterVitepress.jl/dev/
This package provides a Markdown / MkDocs backend to [Documenter.jl](https://documenter.juliadocs.org/stable/).

Expand Down Expand Up @@ -58,15 +58,15 @@ Because this is based on the Vitepress static site generator, you have to use No
## Install npm dependencies
```shell
docs > npm i
docs> npm i
```
## run docs locally

```shell
docs> npm run docs:dev
```
and edit your `make.jl` file to add `build_vitepress = false` as a keyword argument to the `MarkdownVitepress` config, in order to save time. If you keep this running, perhaps in a separate Terminal window, it will automatically rebuild whenever you run `make.jl`.
and edit your `make.jl` file to add `build_vitepress = false` as a keyword argument to the `MarkdownVitepress` config, to save time. If you keep this running, perhaps in a separate Terminal window, it will automatically rebuild whenever you run `make.jl`.

***

Expand Down
7 changes: 3 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"devDependencies": {
"markdown-it": "^14.0.0",
"markdown-it": "^14.1.0",
"markdown-it-mathjax3": "^4.3.2",
"vitepress": "^1.0.0-rc.43",
"vitepress-plugin-tabs": "^0.5.0",
"vitest": "^1.3.0"
"vitepress": "^1.0.2",
"vitepress-plugin-tabs": "^0.5.0"
},
"scripts": {
"docs:dev": "vitepress dev build/.documenter",
Expand Down
6 changes: 3 additions & 3 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { transformerMetaWordHighlight } from '@shikijs/transformers';

// https://vitepress.dev/reference/site-config
export default defineConfig({
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // TODO: replace this in makedocs!
title: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
description: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
lastUpdated: true,
cleanUrls: true,
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
head: [['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }]],
head: [['link', { rel: 'icon', href: '/DocumenterVitepress.jl/dev/favicon.ico' }]],

markdown: {
math: true,
Expand Down Expand Up @@ -52,7 +52,7 @@ export default defineConfig({
{ icon: 'github', link: 'REPLACE_ME_DOCUMENTER_VITEPRESS' }
],
footer: {
message: 'Made with <a href="https://documenter.juliadocs.org/stable/" target="_blank"><strong>Documenter.jl</strong></a>, <a href="https://vitepress.dev" target="_blank"><strong>VitePress</strong></a> and <a href="https://luxdl.github.io/DocumenterVitepress.jl/stable" target="_blank"><strong>DocumenterVitepress.jl</strong></a> <br>',
message: 'Made with <a href="https://documenter.juliadocs.org/stable/" target="_blank"><strong>Documenter.jl</strong></a>, <a href="https://vitepress.dev" target="_blank"><strong>VitePress</strong></a> and <a href="https://luxdl.github.io/DocumenterVitepress.jl/stable/" target="_blank"><strong>DocumenterVitepress.jl</strong></a> <br>',
copyright: `© Copyright ${new Date().getUTCFullYear()}.`
}
}
Expand Down
158 changes: 142 additions & 16 deletions docs/src/code_example.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,120 @@
# Julia code example
# Julia code examples

**Fonts**

This package uses the JuliaMono font by default, but you can override this in CSS.

This is what some common symbols look like:

```julia
] [ = $ ; ( @ { " ) ? . } ⊽ ⊼ ⊻ ⊋ ⊊ ⊉ ⊈ ⊇ ⊆ ≥ ≤ ≢ ≡ ≠ ≉ ≈ ∪ ∩ ∜ ∛ √ ∘ ∌
|> /> ^ % ` ∈
```
## @example
The `Julia` code used here is done using the following packages versions:
````@example version
**Input**
````
```@example version
using Pkg
Pkg.status()
```
````
**Output**
And a simple task:
```@example version
using Pkg
Pkg.status()
```
````@example simple_sum
And a simple sum:
**Input**
````
```@example simple_sum
2 + 2
```
````
**Output**
## ANSI example
```@example simple_sum
2 + 2
```
````@ansi
## @ansi
**Input**
````
```@ansi
printstyled("this is my color"; color = :red)
```
````
**Output**
```@ansi
printstyled("this is my color"; color = :red)
```
A more colorful example from [documenter](https://documenter.juliadocs.org/stable/showcase/#Raw-ANSI-code-output):
````@ansi
**Input**
````
```@ansi
for color in 0:15
print("\e[38;5;$color;48;5;$(color)m ")
print("\e[49m", lpad(color, 3), " ")
color % 8 == 7 && println()
color % 8 == 7 && println() # ‎[!code highlight]
end
```
````
**Output**
## Font
```@ansi
for color in 0:15
print("\e[38;5;$color;48;5;$(color)m ")
print("\e[49m", lpad(color, 3), " ")
color % 8 == 7 && println() # [!code highlight]
end
```
This package uses the JuliaMono font by default, but you can override this in CSS.
## @eval
From [Julia's documentation](https://docs.julialang.org/en/v1/) landing page.
This is what some common symbols look like:
**Input**
````
```@eval
io = IOBuffer()
release = isempty(VERSION.prerelease)
v = "$(VERSION.major).$(VERSION.minor)"
!release && (v = v*"-$(first(VERSION.prerelease))")
print(io, """
# Julia $(v) Documentation

```julia
] [ = $ ; ( @ { " ) ? . } ⊽ ⊼ ⊻ ⊋ ⊊ ⊉ ⊈ ⊇ ⊆ ≥ ≤ ≢ ≡ ≠ ≉ ≈ ∪ ∩ ∜ ∛ √ ∘ ∌
|> /> ^ % ` ∈
Welcome to the documentation for Julia $(v).

""")
if true # !release
print(io,"""
!!! warning "Work in progress!"
This documentation is for an unreleased, in-development, version of Julia.
""")
end
import Markdown
Markdown.parse(String(take!(io)))
```
## Eval example
From [Julia's documentation](https://docs.julialang.org/en/v1/) landing page.
```@eval
file = "julia-1.10.2.pdf"
url = "https://raw.githubusercontent.com/JuliaLang/docs.julialang.org/assets/$(file)"
import Markdown
Markdown.parse("""
!!! note
The documentation is also available in PDF format: [$file]($url).
""")
```
````
**Output**
```@eval
io = IOBuffer()
release = isempty(VERSION.prerelease)
Expand Down Expand Up @@ -72,4 +144,58 @@ Markdown.parse("""
!!! note
The documentation is also available in PDF format: [$file]($url).
""")
```
## @repl
**Input**
````
```@repl
a = 1;
b = 2;
a + b
```
````
**Output**
```@repl
a = 1;
b = 2;
a + b
```
**Input**
````
```@repl
a = 1;
b = 2; # [!code focus] # hide
a + b
```
````
**Output**
```@repl
a = 1;
b = 2; # hide
a + b
```
## @doctest
**Input**
````
```@doctest
julia> 1 + 1
2
```
````
**Output**
```@doctest
julia> 1 + 1
2
```
2 changes: 1 addition & 1 deletion docs/src/components/AsideTrustees.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
href="https://rafaqz.github.io/DimensionalData.jl/dev/"
target="_blank"
>
<img width="32" height="32" src="https://rafaqz.github.io/DimensionalData.jl/dev/logoDD.png" />
<img width="32" height="32" src="https://rafaqz.github.io/DimensionalData.jl/dev/logo.png" />
<span>
<p class="extra-info">Named Dimensions</p>
<p class="heading">DimensionalData.jl</p>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ features:
---
```


```@raw html
<p style="margin-bottom:2cm"></p>
<div class="vp-doc" style="width:80%; margin:auto">
Expand All @@ -58,3 +58,4 @@ Just remember to edit the navbar in `docs/src/.vitepress/config.mts`, if you wan
To install a logo or favicon, you can put `logo.png` and `favicon.ico` in `docs/src/assets`, and they will be automatically detected.
</div>
```
Loading

0 comments on commit de286c6

Please sign in to comment.