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/citations/index.html | 52 ++++++++++++++++++++ site/public/test/csv/index.html | 53 ++++++++++++++++++++ site/public/test/datasets/index.html | 52 ++++++++++++++++++++ site/public/test/face_search/index.html | 52 ++++++++++++++++++++ site/public/test/gallery/index.html | 53 ++++++++++++++++++++ site/public/test/index.html | 63 ++++++++++++++++++++++++ site/public/test/map/index.html | 52 ++++++++++++++++++++ site/public/test/name_search/index.html | 52 ++++++++++++++++++++ site/public/test/search_face/index.html | 51 ++++++++++++++++++++ site/public/test/search_name/index.html | 51 ++++++++++++++++++++ site/public/test/style/index.html | 85 +++++++++++++++++++++++++++++++++ 11 files changed, 616 insertions(+) create mode 100644 site/public/test/citations/index.html create mode 100644 site/public/test/csv/index.html create mode 100644 site/public/test/datasets/index.html create mode 100644 site/public/test/face_search/index.html create mode 100644 site/public/test/gallery/index.html create mode 100644 site/public/test/index.html create mode 100644 site/public/test/map/index.html create mode 100644 site/public/test/name_search/index.html create mode 100644 site/public/test/search_face/index.html create mode 100644 site/public/test/search_name/index.html create mode 100644 site/public/test/style/index.html (limited to 'site/public/test') diff --git a/site/public/test/citations/index.html b/site/public/test/citations/index.html new file mode 100644 index 00000000..2013db4e --- /dev/null +++ b/site/public/test/citations/index.html @@ -0,0 +1,52 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
citations lfw
+
+
+ +
+ + + + + \ No newline at end of file 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 diff --git a/site/public/test/datasets/index.html b/site/public/test/datasets/index.html new file mode 100644 index 00000000..6c56cd3a --- /dev/null +++ b/site/public/test/datasets/index.html @@ -0,0 +1,52 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
load file: https://megapixels.nyc3.digitaloceanspaces.com/v1/datasets/datasets.csv
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/face_search/index.html b/site/public/test/face_search/index.html new file mode 100644 index 00000000..7ad32258 --- /dev/null +++ b/site/public/test/face_search/index.html @@ -0,0 +1,52 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
face_search lfw
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/gallery/index.html b/site/public/test/gallery/index.html new file mode 100644 index 00000000..d2ccd071 --- /dev/null +++ b/site/public/test/gallery/index.html @@ -0,0 +1,53 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +

Test of modal images

+
Modal image 1
Modal image 1
+
Modal image 2
Modal image 2
+
Modal image 3
Modal image 3
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/index.html b/site/public/test/index.html new file mode 100644 index 00000000..66f2e619 --- /dev/null +++ b/site/public/test/index.html @@ -0,0 +1,63 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +

Megapixels UI Tests

+ +
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/map/index.html b/site/public/test/map/index.html new file mode 100644 index 00000000..b29f19e7 --- /dev/null +++ b/site/public/test/map/index.html @@ -0,0 +1,52 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
map lfw
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/name_search/index.html b/site/public/test/name_search/index.html new file mode 100644 index 00000000..d2cda3eb --- /dev/null +++ b/site/public/test/name_search/index.html @@ -0,0 +1,52 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +
name_search lfw
+
+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/search_face/index.html b/site/public/test/search_face/index.html new file mode 100644 index 00000000..86123c1c --- /dev/null +++ b/site/public/test/search_face/index.html @@ -0,0 +1,51 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +

+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/search_name/index.html b/site/public/test/search_name/index.html new file mode 100644 index 00000000..b8f836cf --- /dev/null +++ b/site/public/test/search_name/index.html @@ -0,0 +1,51 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +

+
+ +
+ + + + + \ No newline at end of file diff --git a/site/public/test/style/index.html b/site/public/test/style/index.html new file mode 100644 index 00000000..5e3ac6ea --- /dev/null +++ b/site/public/test/style/index.html @@ -0,0 +1,85 @@ + + + + MegaPixels + + + + + + + + + + + +
+ + +
MegaPixels
+ The Darkside of Datasets +
+ +
+
+ +

Style Examples

+
Style Guide Test
Style Guide Test
Date
17-Jan-2019
Numbers
17
Identities
12,139
But also
This is a test of the stylesheet

Header 1

+

Header 2

+

Header 3

+

Header 4

+
Header 5
+
Header 6
+

Bold text, italic text, bold italic text

+

At vero eos et et iusto qui blanditiis praesentium voluptatum deleniti atque corrupti[^1], quos dolores et quas molestias excepturi sint, obcaecati cupiditate non-provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio[^2]. Nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus[^3].

+
    +
  • Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium
  • +
  • Totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo
  • +
  • Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut
  • +
  • Odit aut fugit, sed quia consequuntur magni dolores eos
  • +
  • Qui ratione voluptatem sequi nesciunt, neque porro quisquam
  • +
+

single image test

+
This person is alone
This person is alone

double image test

+
This person is on the left
This person is on the left
+
This person is on the right
This person is on the right

triple image test

+
Person 1
Person 1
+
Person 2
Person 2
+
Person 3. Let me tell you about Person 3.  This person has a very long description with text which wraps like crazy
Person 3. Let me tell you about Person 3. This person has a very long description with text which wraps like crazy

est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non-numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliquam quaerat voluptatem.

+
+
This image is extremely wide and the text beneath it will wrap but thats fine because it can also contain <a href="https://example.com/">hyperlinks</a>! Yes, you read that right—hyperlinks! Lorem ipsum dolor sit amet ad volotesque sic hoc ad nauseam
This image is extremely wide and the text beneath it will wrap but that's fine because it can also contain hyperlinks! Yes, you read that right—hyperlinks! Lorem ipsum dolor sit amet ad volotesque sic hoc ad nauseam

Inline code has back-ticks around it.

+
s = "Python syntax highlighting"
+print(s)
+
+

Horizontal rule

+
+

Citations below here

+
+
+
    +
    +
    + +
    + + + + + \ 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') 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

    +