1
- import fs from "node:fs/promises" ;
2
- import libpath from "node:path" ;
3
- import bibtex from "bibtex-parse-js" ;
4
1
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" ;
5
12
6
13
const isMe = ( name : string ) => {
7
14
return (
@@ -38,18 +45,16 @@ const renderAuthorEn = (author: string) => {
38
45
} ;
39
46
40
47
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_
53
58
} : Publication ) => {
54
59
const ret = [ ...renderAuthorEn ( author ) ] ;
55
60
@@ -93,23 +98,21 @@ const renderPublicationEn = ({
93
98
} ;
94
99
95
100
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_
113
116
} : Publication ) => {
114
117
const ret = [ ...renderAuthorEn ( author ) ] ;
115
118
@@ -174,20 +177,18 @@ const renderJournalEn = ({
174
177
} ;
175
178
176
179
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_
191
192
} : Publication ) => {
192
193
const ret = [ ] ;
193
194
const authors = author . split ( " and " ) ;
@@ -263,7 +264,13 @@ const renderPublicationJa = ({
263
264
} ;
264
265
265
266
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
267
274
} : Publication ) => {
268
275
const ret = [ ] ;
269
276
const authors = author . split ( " and " ) ;
@@ -289,45 +296,7 @@ const renderPublicationArxiv = ({
289
296
return ret ;
290
297
} ;
291
298
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 ( ) {
331
300
return (
332
301
< div
333
302
css = { {
@@ -351,12 +320,10 @@ export default async function Publications() {
351
320
>
352
321
< h3 > Journal w/ review</ h3 >
353
322
< ol >
354
- { bibtex . toJSON ( journalsWithReview ) . map ( ( a , i ) => {
323
+ { journalsWithReview . map ( ( a , i ) => {
355
324
return (
356
325
< 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 ! )
360
327
? renderPublicationJa ( a )
361
328
: renderJournalEn ( a ) }
362
329
</ li >
@@ -365,19 +332,19 @@ export default async function Publications() {
365
332
</ ol >
366
333
< h3 > Paper at international conference w/ review</ h3 >
367
334
< ol >
368
- { bibtex . toJSON ( papersInternationalWithReview ) . map ( ( a , i ) => {
335
+ { papersInternationalWithReview . map ( ( a , i ) => {
369
336
return < li key = { i } > { renderPublicationEn ( a ) } </ li > ;
370
337
} ) }
371
338
</ ol >
372
339
< h3 > Poster and demo at international conference w/ review</ h3 >
373
340
< ol >
374
- { bibtex . toJSON ( postersAndDemosInternationalWithReview ) . map ( ( a , i ) => {
341
+ { postersAndDemosInternationalWithReview . map ( ( a , i ) => {
375
342
return < li key = { i } > { renderPublicationEn ( a ) } </ li > ;
376
343
} ) }
377
344
</ ol >
378
345
< h3 > Paper at domestic conference w/ review</ h3 >
379
346
< ol >
380
- { bibtex . toJSON ( papersDomesticWithReview ) . map ( ( a , i ) => {
347
+ { papersDomesticWithReview . map ( ( a , i ) => {
381
348
return < li key = { i } > { renderPublicationJa ( a ) } </ li > ;
382
349
} ) }
383
350
</ ol >
@@ -386,7 +353,7 @@ export default async function Publications() {
386
353
< h3 > Oral presentation at domestic conference</ h3 >
387
354
</ summary >
388
355
< ol >
389
- { bibtex . toJSON ( oralsDomestic ) . map ( ( a , i ) => {
356
+ { oralsDomestic . map ( ( a , i ) => {
390
357
return < li key = { i } > { renderPublicationJa ( a ) } </ li > ;
391
358
} ) }
392
359
</ ol >
@@ -396,7 +363,7 @@ export default async function Publications() {
396
363
< h3 > Poster and demo at domestic conference</ h3 >
397
364
</ summary >
398
365
< ol >
399
- { bibtex . toJSON ( postersAndDemosDomestic ) . map ( ( a , i ) => {
366
+ { postersAndDemosDomestic . map ( ( a , i ) => {
400
367
return < li key = { i } > { renderPublicationJa ( a ) } </ li > ;
401
368
} ) }
402
369
</ ol >
@@ -406,7 +373,7 @@ export default async function Publications() {
406
373
< h3 > arxiv.org</ h3 >
407
374
</ summary >
408
375
< ol >
409
- { bibtex . toJSON ( arxiv ) . map ( ( a , i ) => {
376
+ { arxivs . map ( ( a , i ) => {
410
377
return < li key = { i } > { renderPublicationArxiv ( a ) } </ li > ;
411
378
} ) }
412
379
</ ol >
0 commit comments