From 5e6ab885e94c1d3118bac1ea3a575d12a3d1434c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 16 Dec 2018 12:28:57 +0100 Subject: adding tests --- site/public/test/csv/index.html | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 site/public/test/csv/index.html (limited to 'site/public/test/csv/index.html') diff --git a/site/public/test/csv/index.html b/site/public/test/csv/index.html new file mode 100644 index 00000000..bde4a17c --- /dev/null +++ b/site/public/test/csv/index.html @@ -0,0 +1,53 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
load file: /datasets/lfw/assets/lfw_names_gender_kg_min.csv
+Name, Images, Gender, Description
+
+
+ +
+ + + + + \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 9ec276ec3ddbbaad554657333453317947f98d63 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 16 Dec 2018 12:42:21 +0100 Subject: generate single page with -i --- megapixels/app/site/parser.py | 9 +++++---- site/assets/css/css.css | 16 ++++++++++++++++ site/public/test/citations/index.html | 5 ++--- site/public/test/csv/index.html | 7 +++---- site/public/test/datasets/index.html | 5 ++--- site/public/test/face_search/index.html | 5 ++--- site/public/test/gallery/index.html | 2 +- site/public/test/map/index.html | 4 +--- site/public/test/name_search/index.html | 4 +--- 9 files changed, 33 insertions(+), 24 deletions(-) (limited to 'site/public/test/csv/index.html') diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py index ca6ac77b..44186be6 100644 --- a/megapixels/app/site/parser.py +++ b/megapixels/app/site/parser.py @@ -73,7 +73,8 @@ def format_applet(section, s3_path): if command == 'load file': if opt[0] != '/': applet['opt'] = s3_path + opt - applet['fields'] = payload[1] + if len(payload) > 1: + applet['fields'] = payload[1] return "
".format(json.dumps(applet)) def parse_markdown(sections, s3_path, skip_h1=False): @@ -85,14 +86,14 @@ def parse_markdown(sections, s3_path, skip_h1=False): for section in sections: if skip_h1 and section.startswith('# '): continue - elif section.startswith('```'): + elif section.strip().startswith('```'): groups.append(format_section(current_group, s3_path)) current_group = [] current_group.append(section) - if section.endswith('```'): + if section.strip().endswith('```'): groups.append(format_applet("\n\n".join(current_group), s3_path)) current_group = [] - elif section.endswith('```'): + elif section.strip().endswith('```'): current_group.append(section) groups.append(format_applet("\n\n".join(current_group), s3_path)) current_group = [] diff --git a/site/assets/css/css.css b/site/assets/css/css.css index 83db7f23..b6742cdc 100644 --- a/site/assets/css/css.css +++ b/site/assets/css/css.css @@ -11,6 +11,14 @@ html { background: #191919; } +.content { + opacity: 0; + transition: opacity 0.2s cubic-bezier(0,1,1,1); +} +html.desktop .content, html.mobile .content { + opacity: 1; +} + /* header */ header { @@ -130,6 +138,14 @@ h2, h3 { font-weight: 500; transition: color 0.2s cubic-bezier(0,0,1,1); } +.content h2 a { + color: #888; + text-decoration: none; +} +.desktop .content h2 a:hover { + color: #fff; + text-decoration: underline; +} th, .gray, h2, h3 { font-family: 'Roboto Mono', monospace; diff --git a/site/public/test/citations/index.html b/site/public/test/citations/index.html index 2013db4e..32b9115c 100644 --- a/site/public/test/citations/index.html +++ b/site/public/test/citations/index.html @@ -27,9 +27,8 @@
-
citations lfw
-
-
+

Citations

+