Skip to content

Commit

Permalink
Complete testing of 8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neelsmith committed Jan 5, 2022
1 parent ab0f717 commit e10bcf9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/src/citable.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ We'll take advantage of Julia's type hierarchy to create an abstract `CitablePub
We'll identify the book using the `Isbn10Urn` type we previously defined. Again, we'll keep the example simple, and just include strings for authors and a title. You could elaborate this type however you choose.

```@example book
abstract type CitablePublication end
abstract type CitablePublication <: Citable end
struct CitableBook <: CitablePublication
urn::Isbn10Urn
title::AbstractString
Expand Down
13 changes: 7 additions & 6 deletions docs/src/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ function fromcex(trait::ReadingListCex, cexsrc::AbstractString, T;
delimiter = "|", configuration = nothing)
lines = split(cexsrc, "\n")
datalines = filter(ln -> !isempty(ln), lines)
isbns = CitableBook[]
inblock = false
for ln in lines
for ln in datalines
if ln == "#!citecollection"
inblock = true
elseif inblock
Expand All @@ -326,6 +327,11 @@ function fromcex(trait::ReadingListCex, cexsrc::AbstractString, T;
end
```

!!! warning

To keep this example brief and avoid introducing other packages, our implementation of `fromcex` naively assumes `cexsrc` will contain a single CEX block introduced by the `#!citecollection` heading. This would break on real world CEX data sources: in a real application, we would instead use the `CiteEXchange` package to parse and extract appropriate blocks. See the [documentation of `CiteEXchange`](https://cite-architecture.github.io/CiteEXchange.jl/stable/), or look at how a package like [`CitableCorpus`](https://cite-architecture.github.io/CitableCorpus.jl/stable/) uses `CiteEXchange` in its implementation of `fromcex` for different data type.


Once again, we can now invoke `fromcex` with just the parameters for the CEX data and desired Julia type to create, and `CitableBase` will find our implementation.

```@example collections
Expand All @@ -339,8 +345,6 @@ fromcex(cexoutput, ReadingList)

```@example collections
fname = joinpath(root, "RL", "test", "data", "dataset.cex")
```
```@example collections
fileRL = fromcex(fname, ReadingList, FileReader)
```

Expand All @@ -349,9 +353,6 @@ url = "https://raw.githubusercontent.com/cite-architecture/CitableBase.jl/dev/RL
urlRL = fromcex(url, ReadingList, UrlReader)
```

```@example collections
rl == fileRL == urlRL
```

## Implementing required and optional frnctions from `Base.Iterators`

Expand Down

0 comments on commit e10bcf9

Please sign in to comment.