Yamlify page objects

This commit is contained in:
2022-04-23 19:03:43 -04:00
parent 7ac30458d1
commit 088932a742
13 changed files with 235 additions and 249 deletions

View File

@@ -1,6 +1,7 @@
import React, { ReactElement } from 'react';
import Layout from '../components/layout';
import style from '../styles/lists.module.css';
import rec from '../public/recommended.yaml';
type listItem = {
children?: listItem[] | string[];
@@ -9,151 +10,11 @@ type listItem = {
description?: string
};
const list: listItem[] = [
{
title: 'Books',
children: [
{
title: 'Technology',
children: [
{
title: 'C programming',
children: [
{
title: 'The C Programming Language [K&R]',
url: 'https://en.wikipedia.org/wiki/The_C_Programming_Language'
},
{
title: 'Expert C Programming by Peter van der Linden'
},
{
title: 'Practical C Programming by Steve Oualline (outdated like all the books in this section but still good)'
},
{
title: 'Mastering Algorithms with C by Kyle Loudon'
}
]
},
{
title: 'Other Programming',
children: [
'Programming Perl by Larry Wall [Camel Book] (one of the first programming books I used. It probably is outdated but it is written well)',
'Programming Rust: Fast, Safe Systems Development',
'The Rust Programming Language',
'Programming in Lua, Fourth Edition by Roberto Ierusalimschy'
]
},
{
title: 'Operating Systems',
children: [
'Advanced Programming in the Unix Environment by W. Richard Stevens',
'Operating Systems: Design and Implementation by Andrew S. Tanenbaum (I have not had a chance to read his other books on OS. I am not a fan of his networking book though.)'
]
},
// {
// title: 'Networking'
// },
// {
// title: 'Electronics'
// },
{
title: 'Computer Engineering',
children: [
'Making Embedded Systems: Design Patterns for Great Software by Elecia White',
'Computer Organization and Design: the Hardware/Software Interface [Patterson Hennessy]',
'Computer Architecture: A Quantitative Approach [Hennessy Patterson]'
]
},
{
title: 'Compilers',
children: [
{
title: 'Compilers: Principles, Techniques, and Tools [Dragon Book] (discusses theory in detail so it is kind of hard to read)'
}
]
},
{
title: 'Other',
children: [
{
title: 'Definitive Guide to sed: Tutorial and Reference'
}
]
}
]
},
{
title: 'Classics',
description: 'Only the English ones for now.',
children: [
'Christmas Carol',
'A Tale of Two Cities',
'The Mayor of Casterbridge',
'The Citadel',
'Oliver Twist',
'Macbeth',
'Othello',
'Adventures of Huckleberry Finn',
'Murder on the Orient Express'
]
},
{
title: 'Language Learning',
children: ['Lingua Latina per se Illustrata (Both parts)']
}
]
},
{
title: 'Movies',
children: [
'Pulp Fiction',
'Blade Runner 2049',
'The Grand Budapest Hotel',
'The Hateful Eight',
'Goodfellas',
'Inception',
'Memento',
'Dune (2021)',
'Hot Fuzz',
'Snatch'
]
},
{
title: 'Music',
children: [
'American Pie by Don McLean',
'L\'Ultima Diligenza by Ennio Morricone'
]
},
{
title: 'Classical Music',
children: [
'Große Fuge Op. 133',
'KV 387',
'KV 448',
'KV 626',
'Piano Sonata No. 2 Mvmt. 3 (Chopin)',
'BWV 1048',
'Prelude in G Minor (Op. 23 No. 5)',
'String Quartet, Op. 20 No. 2 (Haydn)',
'Arabesque No. 1 (Debussy)'
]
},
{
title: 'Video Games',
children: [
'The Legend of Zelda: Breath of the Wild',
'Portal 2',
'Factorio',
'The Witcher 3: The Wild Hunt GOTY Edition (Especially the DLCs)',
'Baba is You',
'Red Dead Redemption'
]
}
];
const list: listItem[] = rec // todo: validate this
function mapChild(obj: listItem | string, level: number) {
if (typeof obj === 'string') {
console.log(list)
if (typeof obj === 'string') {
if (obj === '')
return <></>
return <span className={style.listItem}>{obj}</span>