Skip to content

Commit 5c32b23

Browse files
Lilith Hafnertecosaur
authored andcommitted
Add documentation task to CI
Before now, documentation build errors would only be caught when testing manually or PRing a new version of StyledStrings.jl to the main Julia repo. To address this, a new CI task is introduced, and a few small changes made to make automated docs builds possible, namely: - Tweaking the documentation workflow - Introducing some docs build scripts under docs/ - Fixing a dodgy jldoctest We also add a documentation page for the internals.
1 parent 38ae1b3 commit 5c32b23

File tree

8 files changed

+64
-14
lines changed

8 files changed

+64
-14
lines changed

.github/workflows/CI.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,18 @@ jobs:
4343
files: lcov.info
4444
docs:
4545
name: Documentation
46-
runs-on: ubuntu-latest
4746
permissions:
4847
contents: write
48+
statuses: write
49+
runs-on: ubuntu-latest
4950
steps:
50-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v4
5152
- uses: julia-actions/setup-julia@v1
5253
with:
53-
version: '1'
54-
- uses: julia-actions/julia-buildpkg@v1
55-
- uses: julia-actions/julia-docdeploy@v1
54+
version: 'nightly'
55+
- name: Install dependencies
56+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
57+
- name: Build and deploy
5658
env:
5759
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
- run: |
59-
julia --project=docs -e '
60-
using Documenter: DocMeta, doctest
61-
using StyledStrings
62-
DocMeta.setdocmeta!(StyledStrings, :DocTestSetup, :(using StyledStrings); recursive=true)
63-
doctest(StyledStrings)'
60+
run: julia --project=docs/ docs/make.jl

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*.jl.*.cov
22
*.jl.cov
33
*.jl.mem
4-
/Manifest.toml
4+
**/Manifest.toml
55
/docs/build/

docs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
all:
2+
julia --color=yes make.jl

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"

docs/make.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using StyledStrings
2+
using Documenter
3+
4+
DocMeta.setdocmeta!(StyledStrings, :DocTestSetup, :(using StyledStrings); recursive=true)
5+
6+
makedocs(;
7+
modules = [StyledStrings],
8+
sitename = "Styled Strings",
9+
authors = "tecosaur <[email protected]> and contributors",
10+
repo = "https://github.com/JuliaLang/StyledStrings.jl/blob/{commit}{path}#{line}",
11+
format = Documenter.HTML(),
12+
pages = [
13+
"StyledStrings" => "index.md",
14+
],
15+
warnonly = [:cross_references],
16+
)
17+
18+
deploydocs(repo="github.com/JuliaLang/StyledStrings.jl")

docs/src/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,7 @@ StyledStrings.@styled_str
184184
StyledStrings.Face
185185
StyledStrings.addface!
186186
StyledStrings.SimpleColor
187+
Base.parse
188+
Base.tryparse
189+
Base.merge
187190
```

docs/src/internals.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Internals
2+
3+
Everything documented in this page is internal and subject to breaking changes,
4+
even in minor version updates of Julia or StyledStrings.jl. If you are curious
5+
about the internals, read on, but if you want to depend on them, please consider
6+
opening a pull request or issue to discuss making them part of the public API.
7+
8+
```@docs
9+
StyledStrings.ANSI_4BIT_COLORS
10+
StyledStrings.FACES
11+
StyledStrings.HTML_BASIC_COLORS
12+
StyledStrings.Legacy.ANSI_256_COLORS
13+
StyledStrings.Legacy.RENAMED_COLORS
14+
StyledStrings.Legacy.legacy_color
15+
StyledStrings.Legacy.load_env_colors!
16+
StyledStrings.ansi_4bit_color_code
17+
StyledStrings.eachregion
18+
StyledStrings.face!
19+
StyledStrings.getface
20+
StyledStrings.loadface!
21+
StyledStrings.loaduserfaces!
22+
StyledStrings.resetfaces!
23+
StyledStrings.termcolor
24+
StyledStrings.termcolor24bit
25+
StyledStrings.termcolor8bit
26+
StyledStrings.withfaces
27+
```

src/regioniterator.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ an iterator which provides each substring and the applicable annotations as a
2727
2828
# Examples
2929
30-
```jldoctest; setup = :(import AnnotatedString; import StyledStrings.eachregion)
31-
julia> collect(eachregion(Base.AnnotatedString(
30+
```jldoctest
31+
julia> collect(StyledStrings.eachregion(Base.AnnotatedString(
3232
"hey there", [(1:3, :face => :bold), (5:9, :face => :italic)])))
3333
3-element Vector{Tuple{SubString{String}, Vector{Pair{Symbol, Any}}}}:
3434
("hey", [:face => :bold])

0 commit comments

Comments
 (0)