Beispiel #1
0
        public void CheckSameReferenceWithDifferentPagesProducesSingleEntryInBibliography()
        {
            var citeProc     = new CiteProcRunner(MlaCslStyle, () => DocearDatabase);
            var citeInserter = new TestCitationInserter(citeProc);

            var citation1 = new EntryAndPagePair(DocearDatabase["price65"], "1");
            var citation2 = new EntryAndPagePair(DocearDatabase["price65"], "2");

            var entryAndPagePairs =
                new[]
            {
                citation1,
                citation2
            };

            var inlineCitation1 = citeInserter.CreateInlineCitation(citation1);
            var inlineCitation2 = citeInserter.CreateInlineCitation(citation2);

            var jsCitations = new object[0];
            var jsResult    = citeProc.RestoreProcessorState(jsCitations);



            var bibliographyResult = citeProc.MakeBibliography();
        }
Beispiel #2
0
        public void XXXNew()
        {
            var database = BibTexHelper.LoadBibTextDatabase(@"Sample Files\Mendeley 2.bib");
            //var database = BibTexHelper.LoadBibTextDatabase(@"Sample Files\b4w.bib");
            //var database = BibTexHelper.LoadBibTextDatabase(@"Sample Files\BigFile.bib");
            var citeproc  = new CiteProcRunner(HavardCslStyle, () => database);
            var converter = new BibTexToCSLConverter(citeproc);

            var result = converter.CreateItem(database);
            var q      = citeproc.ToJSON(result.JSObject);

            File.WriteAllText(@"F:\new.txt", q);

//			Debug.WriteLine(q);
        }
Beispiel #3
0
        public void Test02()
        {
            var database = BibTexHelper.LoadBibTexDatabase(@"Sample Files\Docear.bib");
            var citeproc = new CiteProcRunner(HavardCslStyle, () => database);

            var idList = database.GetEntryNames().ToArray();

            idList = database.GetEntryNames().Take(300).ToArray();
            Console.WriteLine("Total of " + idList.Length + " items.");


            citeproc.UpdateItems(idList, false, true);

            //var bib = citeproc.MakeBibliography();

            //foreach (var entry in bib.Entries) Console.WriteLine(entry);
        }
Beispiel #4
0
        public void Test01(int x)
        {
            var citeproc    = new CiteProcRunner(HavardCslStyle, () => DocearDatabase);
            var listOfItems = new[] { "Agarwal05", "Agrawal08", "Aho75" };

            var result = citeproc.UpdateItems(listOfItems, false, true);

            foreach (var s in result)
            {
                Console.WriteLine(s);
            }

            var bib = citeproc.MakeBibliography();

            foreach (var entry in bib.Entries)
            {
                Console.WriteLine(entry);
            }
        }
Beispiel #5
0
        public void NewInlineCitation()
        {
            var citeproc = new CiteProcRunner(HavardCslStyle, () => DocearDatabase);

            var citation = new JSInlineCitation(citeproc);

            Console.WriteLine(citeproc.ToJSON(citation));

            Assert.NotNull(citation.CitationItems);
            Assert.NotNull(citation.Properties);
            Console.WriteLine(citeproc.ToJSON(citation));

            var citationItem = citation.CitationItems.AddNew();

            Console.WriteLine(citeproc.ToJSON(citation));

            citationItem.ID     = "123";
            citationItem.Prefix = "bollox";
            Console.WriteLine(citeproc.ToJSON(citation));
        }
Beispiel #6
0
 public TestCitationInserter(CiteProcRunner citeProc)
 {
     this.citeProc = citeProc;
 }