Skip to content

Drasil.Database.SearchTools: Remove findAllCitations #4699

@balacij

Description

@balacij

Spawns from #4300

It is used exclusively in citeDB:

-- | Extract bibliography entries for a system.
citeDB :: System -> BibRef
citeDB si = sortBy compareAuthYearTitle $ findAllCitations (si ^. systemdb)

citeDB is used in two locations:

  1. Building the SRS' bibliography (see last line):
    -- | Helper for creating the different document sections.
    mkSections :: System -> DocDesc -> [Section]
    mkSections si dd = map doit dd
    where
    doit :: DocSection -> Section
    doit TableOfContents = mkToC dd
    doit (RefSec rs) = mkRefSec si dd rs
    doit (IntroSec is) = mkIntroSec si is
    doit (StkhldrSec sts) = mkStkhldrSec sts
    doit (SSDSec ss) = mkSSDSec si ss
    doit (AuxConstntSec acs) = mkAuxConsSec acs
    doit Bibliography = mkBib (citeDB si)
  2. Building a "Notebook" (see last line):
    -- | Helper for creating the notebook sections.
    mkSections :: System -> LsnDesc -> [Section]
    mkSections si = map doit
    where
    doit :: LsnChapter -> Section
    doit (Intro i) = mkIntro i
    doit (LearnObj lo) = mkLearnObj lo
    doit (Review r) = mkReview r
    doit (CaseProb cp) = mkCaseProb cp
    doit (Example e) = mkExample e
    doit (Smmry s) = mkSmmry s
    doit BibSec = mkBib (citeDB si)

Following our status quo, we should scan the documents we generate before generating them for any/all citations referenced.

This is marginally better because it means that we will only display the references we actually use in the documents.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions