Skip to content

Commit af2f1ff

Browse files
committed
Remove bibtext-parse-js
1 parent 5a78f47 commit af2f1ff

13 files changed

+2052
-6883
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"dependencies": {
1010
"@mimorisuzuko/yuuka": "1.0.7",
11-
"bibtex-parse-js": "^0.0.24",
1211
"next": "15.1.5",
1312
"react": "19.0.0",
1413
"react-dom": "19.0.0"

src/@types/bib.d.ts

-4
This file was deleted.

src/@types/bibtex-parse-js.d.ts

-30
This file was deleted.

src/components/Publications.tsx

+63-96
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import fs from "node:fs/promises";
2-
import libpath from "node:path";
3-
import bibtex from "bibtex-parse-js";
41
import type { ReactNode } from "react";
2+
import {
3+
type Publication,
4+
arxivs,
5+
journalsWithReview,
6+
oralsDomestic,
7+
papersDomesticWithReview,
8+
papersInternationalWithReview,
9+
postersAndDemosDomestic,
10+
postersAndDemosInternationalWithReview
11+
} from "../shared/bibs";
512

613
const isMe = (name: string) => {
714
return (
@@ -38,18 +45,16 @@ const renderAuthorEn = (author: string) => {
3845
};
3946

4047
const renderPublicationEn = ({
41-
entryTags: {
42-
author,
43-
title,
44-
booktitle,
45-
series,
46-
pages,
47-
numpages,
48-
year,
49-
url,
50-
_others_,
51-
_miyashitacomurl_
52-
}
48+
author,
49+
title,
50+
booktitle,
51+
series,
52+
pages,
53+
numpages,
54+
year,
55+
url,
56+
_others_,
57+
_miyashitacomurl_
5358
}: Publication) => {
5459
const ret = [...renderAuthorEn(author)];
5560

@@ -93,23 +98,21 @@ const renderPublicationEn = ({
9398
};
9499

95100
const renderJournalEn = ({
96-
entryTags: {
97-
author,
98-
title,
99-
booktitle,
100-
journal,
101-
series,
102-
volume,
103-
number,
104-
articleno,
105-
issue_date,
106-
pages,
107-
numpages,
108-
year,
109-
url,
110-
_others_,
111-
_miyashitacomurl_
112-
}
101+
author,
102+
title,
103+
booktitle,
104+
journal,
105+
series,
106+
volume,
107+
number,
108+
articleno,
109+
issue_date,
110+
pages,
111+
numpages,
112+
year,
113+
url,
114+
_others_,
115+
_miyashitacomurl_
113116
}: Publication) => {
114117
const ret = [...renderAuthorEn(author)];
115118

@@ -174,20 +177,18 @@ const renderJournalEn = ({
174177
};
175178

176179
const renderPublicationJa = ({
177-
entryTags: {
178-
author,
179-
title,
180-
journal,
181-
booktitle,
182-
volume,
183-
number,
184-
pages,
185-
year,
186-
_others_,
187-
_miyashitacomurl_,
188-
_videourl_,
189-
_pressrelease_
190-
}
180+
author,
181+
title,
182+
journal,
183+
booktitle,
184+
volume,
185+
number,
186+
pages,
187+
year,
188+
_others_,
189+
_miyashitacomurl_,
190+
_videourl_,
191+
_pressrelease_
191192
}: Publication) => {
192193
const ret = [];
193194
const authors = author.split(" and ");
@@ -263,7 +264,13 @@ const renderPublicationJa = ({
263264
};
264265

265266
const renderPublicationArxiv = ({
266-
entryTags: { author, title, year, eprint, archivePrefix, url, primaryClass }
267+
author,
268+
title,
269+
year,
270+
eprint,
271+
archivePrefix,
272+
url,
273+
primaryClass
267274
}: Publication) => {
268275
const ret = [];
269276
const authors = author.split(" and ");
@@ -289,45 +296,7 @@ const renderPublicationArxiv = ({
289296
return ret;
290297
};
291298

292-
export default async function Publications() {
293-
const arxiv = await fs.readFile(
294-
libpath.join(process.cwd(), "src/shared/bibs/arxiv.bib"),
295-
"utf-8"
296-
);
297-
const journalsWithReview = await fs.readFile(
298-
libpath.join(process.cwd(), "src/shared/bibs/journals-w-review.bib"),
299-
"utf-8"
300-
);
301-
const oralsDomestic = await fs.readFile(
302-
libpath.join(process.cwd(), "src/shared/bibs/orals-domestic.bib"),
303-
"utf-8"
304-
);
305-
const papersDomesticWithReview = await fs.readFile(
306-
libpath.join(process.cwd(), "src/shared/bibs/papers-domestic-w-review.bib"),
307-
"utf-8"
308-
);
309-
const papersInternationalWithReview = await fs.readFile(
310-
libpath.join(
311-
process.cwd(),
312-
"src/shared/bibs/papers-international-w-review.bib"
313-
),
314-
"utf-8"
315-
);
316-
const postersAndDemosDomestic = await fs.readFile(
317-
libpath.join(
318-
process.cwd(),
319-
"src/shared/bibs/posters-and-demos-domestic.bib"
320-
),
321-
"utf-8"
322-
);
323-
const postersAndDemosInternationalWithReview = await fs.readFile(
324-
libpath.join(
325-
process.cwd(),
326-
"src/shared/bibs/posters-and-demos-international-w-review.bib"
327-
),
328-
"utf-8"
329-
);
330-
299+
export default function Publications() {
331300
return (
332301
<div
333302
css={{
@@ -351,12 +320,10 @@ export default async function Publications() {
351320
>
352321
<h3>Journal w/ review</h3>
353322
<ol>
354-
{bibtex.toJSON(journalsWithReview).map((a, i) => {
323+
{journalsWithReview.map((a, i) => {
355324
return (
356325
<li key={i}>
357-
{/[\u4E00-\u9FAF\u3040-\u3096\u30A1-\u30FA]/.test(
358-
a.entryTags.journal!
359-
)
326+
{/[\u4E00-\u9FAF\u3040-\u3096\u30A1-\u30FA]/.test(a.journal!)
360327
? renderPublicationJa(a)
361328
: renderJournalEn(a)}
362329
</li>
@@ -365,19 +332,19 @@ export default async function Publications() {
365332
</ol>
366333
<h3>Paper at international conference w/ review</h3>
367334
<ol>
368-
{bibtex.toJSON(papersInternationalWithReview).map((a, i) => {
335+
{papersInternationalWithReview.map((a, i) => {
369336
return <li key={i}>{renderPublicationEn(a)}</li>;
370337
})}
371338
</ol>
372339
<h3>Poster and demo at international conference w/ review</h3>
373340
<ol>
374-
{bibtex.toJSON(postersAndDemosInternationalWithReview).map((a, i) => {
341+
{postersAndDemosInternationalWithReview.map((a, i) => {
375342
return <li key={i}>{renderPublicationEn(a)}</li>;
376343
})}
377344
</ol>
378345
<h3>Paper at domestic conference w/ review</h3>
379346
<ol>
380-
{bibtex.toJSON(papersDomesticWithReview).map((a, i) => {
347+
{papersDomesticWithReview.map((a, i) => {
381348
return <li key={i}>{renderPublicationJa(a)}</li>;
382349
})}
383350
</ol>
@@ -386,7 +353,7 @@ export default async function Publications() {
386353
<h3>Oral presentation at domestic conference</h3>
387354
</summary>
388355
<ol>
389-
{bibtex.toJSON(oralsDomestic).map((a, i) => {
356+
{oralsDomestic.map((a, i) => {
390357
return <li key={i}>{renderPublicationJa(a)}</li>;
391358
})}
392359
</ol>
@@ -396,7 +363,7 @@ export default async function Publications() {
396363
<h3>Poster and demo at domestic conference</h3>
397364
</summary>
398365
<ol>
399-
{bibtex.toJSON(postersAndDemosDomestic).map((a, i) => {
366+
{postersAndDemosDomestic.map((a, i) => {
400367
return <li key={i}>{renderPublicationJa(a)}</li>;
401368
})}
402369
</ol>
@@ -406,7 +373,7 @@ export default async function Publications() {
406373
<h3>arxiv.org</h3>
407374
</summary>
408375
<ol>
409-
{bibtex.toJSON(arxiv).map((a, i) => {
376+
{arxivs.map((a, i) => {
410377
return <li key={i}>{renderPublicationArxiv(a)}</li>;
411378
})}
412379
</ol>

src/shared/bibs/arxiv.bib

-19
This file was deleted.

0 commit comments

Comments
 (0)