File tree 4 files changed +22
-6
lines changed
4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
7
7
8
+ ## [ Unreleased]
9
+
10
+ ### Added
11
+ - Literate will now remove Documenter-style ` @extref ` links under the same
12
+ circumstances as ` @ref ` and ` @id ` . Recent versions of Documenter use
13
+ ` @extref ` to links to the documentation of external packages. See
14
+ https://github.com/JuliaDocs/Documenter.jl/issues/2366 for details of
15
+ the Documenter implementation. ([ #245 ] )
16
+
8
17
## [ v2.17.0] - 2024-04-14
9
18
### Added
10
19
- Literate can now output [ Quarto] ( https://quarto.org/ ) notebooks (markdown documents with
@@ -303,6 +312,7 @@ https://discourse.julialang.org/t/ann-literate-jl/10651 for release announcement
303
312
[ #229 ] : https://github.com/fredrikekre/Literate.jl/issues/229
304
313
[ #230 ] : https://github.com/fredrikekre/Literate.jl/issues/230
305
314
[ #233 ] : https://github.com/fredrikekre/Literate.jl/issues/233
315
+ [ #245 ] : https://github.com/fredrikekre/Literate.jl/issues/245
306
316
[ 0872a96 ] : https://github.com/fredrikekre/Literate.jl/commit/0872a96
307
317
[ 0f9e836 ] : https://github.com/fredrikekre/Literate.jl/commit/0f9e836
308
318
[ 1d02868 ] : https://github.com/fredrikekre/Literate.jl/commit/1d02868
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ if we set `documenter = true`:
31
31
````
32
32
33
33
### [ ` Literate.notebook ` ] ( @ref ) :
34
- - Documenter style ` @ref ` s and ` @id ` will be removed. This means that you can use
35
- ` @ref ` and ` @id ` in the source file without them leaking to the notebook.
34
+ - Documenter style ` @ref ` s, ` @extref ` s and ` @id ` will be removed. This means that you can use
35
+ ` @ref ` , ` @extref ` and ` @id ` in the source file without them leaking to the notebook.
36
36
- Documenter style markdown math
37
37
````
38
38
```math
@@ -57,5 +57,5 @@ if we set `documenter = true`:
57
57
```
58
58
59
59
### [ ` Literate.script ` ] ( @ref ) :
60
- - Documenter style ` @ref ` s and ` @id ` will be removed. This means that you can use
61
- ` @ref ` and ` @id ` in the source file without them leaking to the script.
60
+ - Documenter style ` @ref ` s, ` @extref ` s and ` @id ` will be removed. This means that you can use
61
+ ` @ref ` , ` @extref ` and ` @id ` in the source file without them leaking to the script.
Original file line number Diff line number Diff line change @@ -217,9 +217,11 @@ function replace_default(content, sym;
217
217
218
218
# Run some Documenter specific things
219
219
if ! isdocumenter (config)
220
- # # - remove documenter style `@ref`s and `@id`s
220
+ # # - remove documenter style `@ref`s, `@extref`s and `@id`s
221
221
push! (repls, r" \[ ([^]]+?)\]\( @ref\) " s => s "\1 " ) # [foo](@ref) => foo
222
222
push! (repls, r" \[ ([^]]+?)\]\( @ref .*?\) " s => s "\1 " ) # [foo](@ref bar) => foo
223
+ push! (repls, r" \[ ([^]]+?)\]\( @extref\) " s => s "\1 " ) # [foo](@extref) => foo
224
+ push! (repls, r" \[ ([^]]+?)\]\( @extref .*?\) " s => s "\1 " ) # [foo](@extref bar) => foo
223
225
push! (repls, r" \[ ([^]]+?)\]\( @id .*?\) " s => s "\1 " ) # [foo](@id bar) => foo
224
226
end
225
227
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ end # testset parser
220
220
content = """
221
221
# # [Example](@id example-id)
222
222
# [foo](@ref), [bar](@ref bbaarr)
223
+ # [baz](@extref), [bax](@extref bbaaxx)
223
224
x = 1
224
225
#md # Only markdown
225
226
# Only markdown #md
@@ -580,6 +581,7 @@ end end
580
581
581
582
# [Example](@id example-id)
582
583
[foo](@ref), [bar](@ref bbaarr)
584
+ [baz](@extref), [bax](@extref bbaaxx)
583
585
584
586
````@example inputfile
585
587
x = 1
@@ -1027,7 +1029,8 @@ end end
1027
1029
"""
1028
1030
"source": [
1029
1031
"# Example\\ n",
1030
- "foo, bar"
1032
+ "foo, bar\\ n",
1033
+ "baz, bax"
1031
1034
]
1032
1035
""" ,
1033
1036
@@ -1263,6 +1266,7 @@ end end
1263
1266
notebook = read (joinpath (outdir, " inputfile.ipynb" ), String)
1264
1267
@test ! occursin (" # [Example](@id example-id" , notebook)
1265
1268
@test ! occursin (" [foo](@ref), [bar](@ref bbaarr)" , notebook)
1269
+ @test ! occursin (" [baz](@ref), [bax](@ref bbaaxx)" , notebook)
1266
1270
1267
1271
# name
1268
1272
Literate. notebook (inputfile, outdir, name = " foobar" , execute = false )
You can’t perform that action at this time.
0 commit comments