git @ Cat's Eye Technologies Chrysoberyl / 69c0f10
We don't need an articles.json; we can extract it from the README. Chris Pressey 6 years ago
2 changed file(s) with 6 addition(s) and 124 deletion(s). Raw diff Collapse all Expand all
+0
-122
articles.json less more
0 {
1 "Archived": {
2 "image_url": null,
3 "schema": "Tool",
4 "title": "Archived"
5 },
6 "Automata": {
7 "image_url": "http://static.catseye.tc/images/illustrations/Perpetual_Motion_Machine.jpg",
8 "schema": "Language",
9 "title": "Automata"
10 },
11 "Distribution Organization": {
12 "image_url": null,
13 "schema": null,
14 "title": "Distribution Organization"
15 },
16 "Electronics Projects": {
17 "image_url": "http://catseye.tc/modules/electronics-projects/mildred/doc/mildred_photo.jpg",
18 "schema": "Electronics Project",
19 "title": "Electronics Projects"
20 },
21 "Events": {
22 "image_url": null,
23 "schema": "Event",
24 "title": "Events"
25 },
26 "Formats": {
27 "image_url": null,
28 "schema": "Format",
29 "title": "Formats"
30 },
31 "Game Implementations": {
32 "image_url": null,
33 "schema": "Game Implementation",
34 "title": "Game Implementations"
35 },
36 "Games": {
37 "image_url": "http://catseye.tc/modules/dungeons-of-ekileugor/images/dungeons-of-ekileugor.png",
38 "schema": "Game",
39 "title": "Games"
40 },
41 "General Information": {
42 "image_url": null,
43 "schema": null,
44 "title": "General Information"
45 },
46 "Gewgaws": {
47 "image_url": "http://static.catseye.tc/images/screenshots/Canvas_Feedback.jpg",
48 "schema": "Gewgaw",
49 "title": "Gewgaws"
50 },
51 "HTML5 Installations": {
52 "image_url": "http://static.catseye.tc/images/illustrations/Perpetual_Motion_Machine.jpg",
53 "schema": "HTML5 Installation",
54 "title": "HTML5 Installations"
55 },
56 "Language Implementations": {
57 "image_url": "http://static.catseye.tc/images/illustrations/Perpetual_Motion_Machine.jpg",
58 "schema": "Language Implementation",
59 "title": "Language Implementations"
60 },
61 "Languages": {
62 "image_url": "http://static.catseye.tc/images/illustrations/Abacus_(PSF).jpg",
63 "schema": "Language",
64 "title": "Languages"
65 },
66 "List of Unfinished Interesting Esolangs": {
67 "image_url": "http://static.catseye.tc/images/illustrations/Perpetual_Motion_Machine.jpg",
68 "schema": "Unfinished Esolang",
69 "title": "List of Unfinished Interesting Esolangs"
70 },
71 "Movies": {
72 "image_url": null,
73 "schema": "Movie",
74 "title": "Movies"
75 },
76 "Musical Compositions": {
77 "image_url": "http://static.catseye.tc/images/illustrations/Accordion_(PSF).jpg",
78 "schema": "Musical Composition",
79 "title": "Musical Compositions"
80 },
81 "News": {
82 "image_url": "http://static.catseye.tc/images/illustrations/Hatched.jpg",
83 "schema": null,
84 "title": "News"
85 },
86 "Pictures": {
87 "image_url": "http://static.catseye.tc/images/pictures/Ink%20salad%20No.%207.png",
88 "schema": "Picture",
89 "title": "Pictures"
90 },
91 "Platforms": {
92 "image_url": null,
93 "schema": "Platform",
94 "title": "Platforms"
95 },
96 "Project Dependencies": {
97 "image_url": null,
98 "schema": "Project Dependency",
99 "title": "Project Dependencies"
100 },
101 "Retrocomputing": {
102 "image_url": "http://catseye.tc/modules/dungeons-of-ekileugor/images/dungeons-of-ekileugor.png",
103 "schema": null,
104 "title": "Retrocomputing"
105 },
106 "Texts": {
107 "image_url": "http://static.catseye.tc/images/illustrations/Reader_St_Jamess_Park.jpg",
108 "schema": "Text",
109 "title": "Texts"
110 },
111 "Tools": {
112 "image_url": "http://static.catseye.tc/images/illustrations/Allen_wrench_and_screw_(PSF).jpg",
113 "schema": "Tool",
114 "title": "Tools"
115 },
116 "Forks": {
117 "image_url": "http://static.catseye.tc/images/illustrations/Allen_wrench_and_screw_(PSF).jpg",
118 "schema": "Fork",
119 "title": "Forks"
120 }
121 }
6161
6262
6363 if __name__ == '__main__':
64 with open('articles.json', 'r') as f:
65 articles_map = json.loads(f.read())
64 articles_doc = read_document_from('article/README.md')
65 articles_map = dict([(section.title, {
66 "title": section.title,
67 "image_url": section.properties.get("image_url"),
68 "schema": section.properties.get("schema"),
69 }) for section in articles_doc.sections])
6670 articles = []
6771 for title, properties in articles_map.items():
6872 articles.append((title, properties['schema']))