Skip to content

Commit

Permalink
Merge pull request #83 from JuliaDocs/80-bibinternal-0.3.7
Browse files Browse the repository at this point in the history
Compatibility with BibInternal v0.3.7
  • Loading branch information
goerz authored Nov 14, 2024
2 parents 481cdf5 + 9f8717c commit 891bac8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ version = "1.3.4+dev"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
BibInternal = "2027ae74-3657-4b95-ae00-e2f7d55c3e64"
Bibliography = "f1be7e48-bf82-45af-a471-ae754a193061"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand All @@ -17,7 +16,6 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[compat]
AbstractTrees = "0.4"
BibInternal = "=0.3.6"
Bibliography = "0.2.15"
Dates = "1"
Documenter = "1"
Expand Down
19 changes: 17 additions & 2 deletions src/formatting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ function format_published_in(
else
@assert entry.type == "unpublished" "Unexpected type $(repr(entry.type))"
# @unpublished should be rendered entirely via the Note field.
if isempty(get(entry.fields, "note", ""))
if !has_note(entry)
@warn "unpublished $(entry.id) does not have a 'note'"
end
end
Expand Down Expand Up @@ -512,8 +512,23 @@ function format_vol_num_series(
end


function has_note(entry)
if hasproperty(entry, :note)
return !isempty(entry.note)
else
return !isempty(get(entry.fields, "note", ""))
end
end


function format_note(entry)
return strip(get(entry.fields, "note", "")) |> tex_to_markdown
if hasproperty(entry, :note)
# BibInternal v0.3.7
return strip(entry.note) |> tex_to_markdown
else
# BibInternal <=v0.3.6
return strip(get(entry.fields, "note", "")) |> tex_to_markdown
end
end


Expand Down

0 comments on commit 891bac8

Please sign in to comment.