Skip to content

Commit

Permalink
Update Documenter.jl script example (#156)
Browse files Browse the repository at this point in the history
* Update Documenter.jl script example

Minimize the differences between the script for Documenter.jl and DocumenterVitepress.jl, to highlight the format part and take clutter away

* Fix missed name in last commit
  • Loading branch information
abhro authored Jun 19, 2024
1 parent eaf1fe8 commit d76a150
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions docs/src/documenter_to_vitepress_docs_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@ Then the very first step here is to update the `make.jl` file to follow the Docu

== From Documenter.jl

a. The `make.jl` file with `Documenter.jl` should look like this:
The `make.jl` file with `Documenter.jl` should look like this:

```julia
using Example
using Documenter

DocMeta.setdocmeta!(test, :DocTestSetup, :(using test); recursive=true)
DocMeta.setdocmeta!(Example, :DocTestSetup, :(using Example); recursive=true)

makedocs(;
modules = [test],
authors = "jay-sanjay <[email protected]> and contributors",
modules = [Example],
repo = Remotes.GitHub("ExampleOrg", "Example.jl"),
authors = "Jay-sanjay <[email protected]>, and contributors",
sitename = "Example.jl",
format = Documenter.HTML(;
canonical = "https://jay-sanjay.github.io/Example.jl",
canonical = "https://github.com/ExampleOrg/Example.jl",
edit_link = "main",
assets = String[],
),
pages=[
pages = [
"Home" => "index.md",
"Tutorials" => "tutorials.md",
"Api" => "api.md",
"API" => "api.md",
"Contributing" => "contributing.md"
],
)
Expand All @@ -45,7 +46,7 @@ Then the very first step here is to update the `make.jl` file to follow the Docu

== to DocumenterVitepress.jl

b. The same `make.jl` file with `DocumenterVitepress.jl` will look like this:
The same `make.jl` file with `DocumenterVitepress.jl` will look like this:

```julia
using Example
Expand All @@ -60,12 +61,12 @@ Then the very first step here is to update the `make.jl` file to follow the Docu
authors = "Jay-sanjay <[email protected]>, and contributors",
sitename = "Example.jl",
format = DocumenterVitepress.MarkdownVitepress(
repo="https://github.com/ExampleOrg/Example.jl",
repo = "https://github.com/ExampleOrg/Example.jl",
),
pages = [
"Home" => "index.md",
"Tutorials" => "tutorials.md",
"Api" => "api.md",
"API" => "api.md",
"Contributing" => "contributing.md"
],
)
Expand All @@ -75,44 +76,45 @@ Then the very first step here is to update the `make.jl` file to follow the Docu
target = "build", # this is where Vitepress stores its output
devbranch = "main",
branch = "gh-pages",
push_preview = true
push_preview = true,
)
```

:::

2. Next to build new docs from docs/src
2. Next, to build new docs from docs/src,
```sh
$ cd docs
docs $
```
3. Then, in docs start a julia session and activate a new environment.
3. Then, in docs/, start a julia session and activate a new environment.
```sh
docs $ julia
julia> ]
pkg> activate .
```
4. Add packages as necessary. Here, we will need

```julia
```julia-repl
pkg> add DocumenterVitepress, Documenter
```

5. Then run the `make.jl` file to build the documentation.

```julia
```julia-repl
julia> include("make.jl")
```

6. Finally hit `;` to enter in the shell mode and run:
6. Finally, hit `;` to enter the shell mode and run:

```sh
shell> npm i
```
The above command shall create a folder named `node_modules` and `package-lock.json` in your docs folder.

7. Next hit 'Backspace' to get back to the julia REPL and run:
```julia
7. Next, hit 'Backspace' to get back to the Julia REPL and run:
```julia-repl
juila> DocumenterVitepress.dev_docs("docs/build")
```

8. Finally the live preview of your documentation at `hhttp://localhost:5173/Example.jl/` in your browser.

0 comments on commit d76a150

Please sign in to comment.