Skip to content
Snippets Groups Projects
Commit 85be9fe2 authored by Liliana Sanfilippo's avatar Liliana Sanfilippo
Browse files

edu sources

parent 39579ca1
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ interface BibEntry {
interface BibtexParserProps {
bibtexSources: string[]; // Accept an array of BibTeX strings
special?: string
}
......@@ -53,7 +54,7 @@ function formatPages(pages: string | undefined): JSX.Element | null {
}
export const BibtexParser: React.FC<BibtexParserProps> = ({ bibtexSources }) => {
export const BibtexParser: React.FC<BibtexParserProps> = ({ bibtexSources , special}) => {
const [parsedEntries, setParsedEntries] = useState<BibEntry[]>([]);
// Parse BibTeX on component mount or when sources change
......@@ -126,8 +127,11 @@ export const BibtexParser: React.FC<BibtexParserProps> = ({ bibtexSources }) =>
return output;
};
let specialthing = "";
if (special) {
specialthing = `#${special}`;
}
// Helper function to render individual citations based on their type
const renderCitation = (entry: BibEntry, index: number) => {
......@@ -142,7 +146,7 @@ export const BibtexParser: React.FC<BibtexParserProps> = ({ bibtexSources }) =>
switch (entryType) {
case "article":
return (
<li key={index} typeof="schema:ScholarlyArticle" role="doc-biblioentry" property="schema:citation" id={`desc-${citationNumber}`}>
<li key={index} typeof="schema:ScholarlyArticle" role="doc-biblioentry" property="schema:citation" id={`desc-${citationNumber}${specialthing}`}>
{/* Citation number as comment */}
{/*<!-- Citation num ${citationNumber} --> */}
{formatAuthors(entryTags.AUTHOR || entryTags.EDITOR || "")}
......
import BibtexParser from "../components/makeSources";
export default function EduSources(){
return (
<div>
<BibtexParser bibtexSources={bibtexSources} special="edu" />
</div>
);
}
const bibtexSources = [
`@article{article,
author = {Aswegen, Ellie and Pendergast, Donna},
year = {2023},
month = {08},
pages = {1-15},
title = {The impact of interest: an emergent model of interest development in the early years},
volume = {193},
journal = {Early Child Development and Care},
doi = {10.1080/03004430.2023.2245575}
}`
]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment