Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue of infinite .documenter directories #207

Merged
merged 2 commits into from
Feb 3, 2025
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
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 @@
# 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 Expand Up @@ -721,7 +726,7 @@
# Code blocks
function render(io::IO, mime::MIME"text/plain", node::Documenter.MarkdownAST.Node, code::MarkdownAST.CodeBlock, page, doc; kwargs...)
if startswith(code.info, "@")
@warn """

Check warning on line 729 in src/writer.jl

View workflow job for this annotation

GitHub Actions / build

DocumenterVitepress: un-expanded `@doctest` block encountered on page src/code_example.md. The first few lines of code in this node are: ``` julia> 1 + 1 2 ```
DocumenterVitepress: un-expanded `$(code.info)` block encountered on page $(page.source).
The first few lines of code in this node are:
```
Expand Down
Loading