Skip to content

Commit

Permalink
changes in line with #956
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed May 11, 2022
1 parent 6077d23 commit 469e6fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ExprTools = "0.1"
FranklinTemplates = "0.8.16"
HTTP = "0.8, 0.9"
Literate = "2.9"
LiveServer = "0.4, 0.5, 0.6, 0.7"
LiveServer = "0.4, 0.5, 0.6, 0.7, 0.8"
NodeJS = "0.6, 1"
OrderedCollections = "1"
TOML = "1.0"
Expand Down
16 changes: 10 additions & 6 deletions src/converter/latex/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Resolve a `\\figalt{alt}{rpath}` (find a fig and include it with alt).
function lx_figalt(lxc::LxCom, _)
rpath = stent(lxc.braces[2])
alt = stent(lxc.braces[1])
# unix path relative to the root folder
path = parse_rpath(rpath; canonical=false, code=true)
fdir, fext = splitext(path)
# there are several cases
Expand All @@ -160,16 +161,19 @@ function lx_figalt(lxc::LxCom, _)
(".png", ".jpeg", ".jpg", ".svg", ".gif", ".json"), (fext,))
for ext candext
candpath = fdir * ext
syspath = joinpath(PATHS[:site], split(candpath, PATH_SEP)...)
syspath = joinpath(PATHS[:site], split(candpath, "/")...)
isfile(syspath) && return ext == ".json" ? html_plotly(candpath) : html_img(candpath, alt)
end
# now try in the output dir just in case (provided we weren't already
# looking there)
p1, p2 = splitdir(fdir)
if splitdir(p1)[2] != "output"
# looking there) the dir split is "/"
ps = split(fdir, "/", keepempty=false)
if ps[end-1] != "output"
for ext candext
candpath = joinpath(p1, "output", p2 * ext)
syspath = joinpath(PATHS[:site], split(candpath, PATH_SEP)...)
candpath = "/" * join([ps[1:end-1]..., "output", ps[end] * ext], "/")
syspath = joinpath(
PATHS[:site],
split(candpath, "/")...
)
isfile(syspath) && return ext == ".json" ? html_plotly(candpath) : html_img(candpath, alt)
end
end
Expand Down

2 comments on commit 469e6fe

@tlienart
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/60105

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.73 -m "<description of version>" 469e6fe7294ac99c46e7761b475f2f4384ec9923
git push origin v0.10.73

Please sign in to comment.