Inheritance: JavaScriptRunner
			public CitationInserter(DocumentController documentController)
			{
				this.documentController = documentController;
				citeProc = documentController.CiteProc;
				document = documentController.document;
				inlineCitationCache = documentController.inlineCitationCache;

				citationList = new List<JSCitationIDAndIndexPair>(documentController.document.Fields.Count);
			}
Beispiel #2
0
            public CitationInserter(DocumentController documentController)
            {
                this.documentController = documentController;
                citeProc            = documentController.CiteProc;
                document            = documentController.document;
                inlineCitationCache = documentController.inlineCitationCache;

                citationList = new List <JSCitationIDAndIndexPair>(documentController.document.Fields.Count);
            }
Beispiel #3
0
        void ResetCiteProc()
        {
            if (citeProc == null)
            {
                return;
            }

            citeProc.Dispose();

            citeProc = null;
        }
		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);
		}
		void ResetCiteProc()
		{
			if (citeProc == null) return;

			citeProc.Dispose();

			citeProc = null;
		}
		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));
		}
			public TestCitationInserter(CiteProcRunner citeProc)
			{
				this.citeProc = citeProc;
			}
		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();

		}
		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 #10
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);
			}
		}