Skip to content

Commit

Permalink
Merge pull request #207 from LuxDL/as/fix-dot-documenter
Browse files Browse the repository at this point in the history
Fix the issue of infinite .documenter directories
  • Loading branch information
lazarusA authored Feb 3, 2025
2 parents 8db5ba3 + e66875f commit f67d372
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ bib = CitationBibliography(
style=:numeric # default
)
# dev local
try run(`pkill -f vitepress`) catch end # [!code error]

makedocs(;
sitename = "DocumenterVitepress",
Expand Down
14 changes: 10 additions & 4 deletions docs/src/documenter_to_vitepress_docs_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ Then the very first step here is to update the `make.jl` file to follow the Docu

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

# you might need to stop the Vitepress server if it's running before
# updating or creating new files
try run(`pkill -f vitepress`) catch end # [!code error]

makedocs(;
modules = [Example],
repo = Remotes.GitHub("ExampleOrg", "Example.jl"),
Expand Down Expand Up @@ -86,6 +82,16 @@ Then the very first step here is to update the `make.jl` file to follow the Docu

:::

::: details stop any vitepress session

```julia
# you might need to stop the Vitepress server if it's running before
# updating or creating new files
try run(`pkill -f vitepress`) catch end # [!code error]
```

:::

2. Next, to build new docs from docs/src,
```sh
$ cd docs
Expand Down
16 changes: 12 additions & 4 deletions docs/src/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@
## Simple method

You can simply add `using DocumenterVitepress` to your `make.jl` file, and replace `format = HTML(...)` in `makedocs` with:
```julia
# you might need to stop the Vitepress server if it's running before
# updating or creating new files
try run(`pkill -f vitepress`) catch end # [!code error]

```julia
makedocs(...,
format = MarkdownVitepress(
repo = "<url_to_your_repo>",
)
)
```

and that should be it!

::: details stop any vitepress session

```julia
# you might need to stop the Vitepress server if it's running before
# updating or creating new files
try run(`pkill -f vitepress`) catch end # [!code error]
```

:::

The section [Advanced method](@ref) describes how to get more control over your Vitepress build.

### Preview Documentation Development Instantly
Expand Down
5 changes: 5 additions & 0 deletions src/writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,13 @@ function render(doc::Documenter.Document, settings::MarkdownVitepress=MarkdownVi
# and copy the previous build files to the new location.
if settings.md_output_path != "."
for file_or_dir in current_build_files_or_dirs

src = joinpath(builddir, file_or_dir)
dst = joinpath(builddir, settings.md_output_path, file_or_dir)

if src == joinpath(builddir, settings.md_output_path)
continue
end
if src != dst
cp(src, dst; force = true)
rm(src; recursive = true)
Expand Down

0 comments on commit f67d372

Please sign in to comment.