From 4749e90e43565f8ecd27276922ebcbb53d7504cb Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Fri, 17 May 2024 15:33:01 +0200 Subject: [PATCH] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20Change=20prettyurl?= =?UTF-8?q?s=20and=20use=20LiveServer=20for=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to more recent documentation, prettyurls should be set to true and LiveServer.jl should be used. ✅ Closes: #54 --- copier.yml | 1 + docs/make.jl | 2 +- template/docs/Project.toml.jinja | 1 + template/docs/make.jl.jinja | 2 +- template/docs/src/90-developer.md.jinja | 13 +++++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/copier.yml b/copier.yml index 3f626e1a..bf084f69 100644 --- a/copier.yml +++ b/copier.yml @@ -7,6 +7,7 @@ PackageUUID: type: str help: UUID v4 (Generate this with uuidgen or in Julia with `using UUIDs; uuid4()`) validator: "{% if PackageUUID | length == 0 %}Can't be empty{% endif %}" + default: "{{ 999999999999999999999999999999999 | ans_random | to_uuid }}" PackageOwner: type: str diff --git a/docs/make.jl b/docs/make.jl index 00045403..1e877cf4 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -21,7 +21,7 @@ makedocs(; repo = "https://github.com/abelsiqueira/COPIERTemplate.jl/blob/{commit}{path}#{line}", sitename = "COPIERTemplate.jl", format = Documenter.HTML(; - prettyurls = get(ENV, "CI", "false") == "true", + prettyurls = true, canonical = "https://abelsiqueira.github.io/COPIERTemplate.jl", assets = ["assets/style.css"], ), diff --git a/template/docs/Project.toml.jinja b/template/docs/Project.toml.jinja index f7f5ec45..68da6cc0 100644 --- a/template/docs/Project.toml.jinja +++ b/template/docs/Project.toml.jinja @@ -4,6 +4,7 @@ # [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589" {{ PackageName }} = "{{ PackageUUID }}" [compat] diff --git a/template/docs/make.jl.jinja b/template/docs/make.jl.jinja index 1902e454..b8a29bc5 100644 --- a/template/docs/make.jl.jinja +++ b/template/docs/make.jl.jinja @@ -21,7 +21,7 @@ makedocs(; repo = "https://github.com/{{ PackageOwner }}/{{ PackageName }}.jl/blob/{commit}{path}#{line}", sitename = "{{ PackageName }}.jl", format = Documenter.HTML(; - prettyurls = get(ENV, "CI", "false") == "true", + prettyurls = true, canonical = "https://{{ PackageOwner }}.github.io/{{ PackageName }}.jl", assets = ["assets/style.css"], ), diff --git a/template/docs/src/90-developer.md.jinja b/template/docs/src/90-developer.md.jinja index d774dbc3..c2a5a652 100644 --- a/template/docs/src/90-developer.md.jinja +++ b/template/docs/src/90-developer.md.jinja @@ -93,3 +93,16 @@ If this is the first time you work with this repository, follow the instructions ``` - Then you can open a pull request and work with the reviewer to address any issues. + +## Building and viewing the documentation locally + +Following the latest suggestions, we recommend using `LiveServer` to build the documentation. +Here is how you do it: + +1. Run `julia --project=docs` to open Julia in the environment of the docs. +1. If this is the first time building the docs + 1. Press `]` to enter `pkg` mode + 1. Run `pkg> dev .` to use the development version of your package + 1. Press backspace to leave `pkg` mode +1. Run `julia> using LiveServer` +1. Run `julia> servedocs()`