Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yt-project
GitHub Repository: yt-project/yt
Path: blob/main/doc/helper_scripts/table.py
928 views
1
contents = [
2
(
3
"Getting Started",
4
[
5
("welcome/index.html", "Welcome to yt!", "What's yt all about?"),
6
(
7
"orientation/index.html",
8
"yt Orientation",
9
"Quickly get up and running with yt: zero to sixty.",
10
),
11
(
12
"help/index.html",
13
"How to Ask for Help",
14
"Some guidelines on how and where to ask for help with yt",
15
),
16
(
17
"workshop.html",
18
"Workshop Tutorials",
19
"Videos, slides and scripts from the 2012 workshop covering many "
20
+ "aspects of yt, from beginning to advanced.",
21
),
22
],
23
),
24
(
25
"Everyday yt",
26
[
27
(
28
"analyzing/index.html",
29
"Analyzing Data",
30
"An overview of different ways to handle and process data: loading "
31
+ "data, using and manipulating objects and fields, examining and "
32
+ "manipulating particles, derived fields, generating processed data, "
33
+ "time series analysis.",
34
),
35
(
36
"visualizing/index.html",
37
"Visualizing Data",
38
"An overview of different ways to visualize data: making projections, "
39
+ "slices, phase plots, streamlines, and volume rendering; modifying "
40
+ "plots; the fixed resolution buffer.",
41
),
42
(
43
"interacting/index.html",
44
"Interacting with yt",
45
"Different ways -- scripting, GUIs, prompts, explorers -- to explore "
46
+ "your data.",
47
),
48
],
49
),
50
(
51
"Advanced Usage",
52
[
53
(
54
"advanced/index.html",
55
"Advanced yt usage",
56
"Advanced topics: parallelism, debugging, ways to drive yt, "
57
+ "developing",
58
),
59
(
60
"getting_involved/index.html",
61
"Getting Involved",
62
"How to participate in the community, contribute code and share "
63
+ "scripts",
64
),
65
],
66
),
67
(
68
"Reference Materials",
69
[
70
(
71
"cookbook/index.html",
72
"The Cookbook",
73
"A bunch of illustrated examples of how to do things",
74
),
75
(
76
"reference/index.html",
77
"Reference Materials",
78
"A list of all bundled fields, API documentation, the Change Log...",
79
),
80
("faq/index.html", "FAQ", "Frequently Asked Questions: answered for you!"),
81
],
82
),
83
]
84
85
heading_template = r"""
86
<h2>%s</h2>
87
<table class="contentstable" align="center">
88
%s
89
</table>
90
"""
91
92
subheading_template = r"""
93
<tr valign="top">
94
<td width="25%%">
95
<p>
96
<a href="%s">%s</a>
97
</p>
98
</td>
99
<td width="75%%">
100
<p class="linkdescr">%s</p>
101
</td>
102
</tr>
103
"""
104
105
t = ""
106
for heading, items in contents:
107
s = ""
108
for subheading in items:
109
s += subheading_template % subheading
110
t += heading_template % (heading, s)
111
print(t)
112
113