diff options
| -rw-r--r-- | megapixels/app/site/parser.py | 9 | ||||
| -rw-r--r-- | site/assets/css/css.css | 16 | ||||
| -rw-r--r-- | site/public/test/citations/index.html | 5 | ||||
| -rw-r--r-- | site/public/test/csv/index.html | 7 | ||||
| -rw-r--r-- | site/public/test/datasets/index.html | 5 | ||||
| -rw-r--r-- | site/public/test/face_search/index.html | 5 | ||||
| -rw-r--r-- | site/public/test/gallery/index.html | 2 | ||||
| -rw-r--r-- | site/public/test/map/index.html | 4 | ||||
| -rw-r--r-- | site/public/test/name_search/index.html | 4 |
9 files changed, 33 insertions, 24 deletions
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 "<section><div class='applet' data-payload='{}'></div></section>".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 @@ </header> <div class="content"> - <section><pre><code>citations lfw -</code></pre> -</section> + <section><h1>Citations</h1> +</section><section><div class='applet' data-payload='{"command": "citations lfw"}'></div></section> </div> <footer> diff --git a/site/public/test/csv/index.html b/site/public/test/csv/index.html index bde4a17c..a201c94a 100644 --- a/site/public/test/csv/index.html +++ b/site/public/test/csv/index.html @@ -27,10 +27,9 @@ </header> <div class="content"> - <section><pre><code>load file: /datasets/lfw/assets/lfw_names_gender_kg_min.csv -Name, Images, Gender, Description -</code></pre> -</section> + <section><h1>CSV Test</h1> +<h2><a href="/test/">← Back to test index</a></h2> +</section><section><div class='applet' data-payload='{"command": "load file", "opt": "/datasets/lfw/assets/lfw_names_gender_kg_min.csv", "fields": "Name, Images, Gender, Description"}'></div></section> </div> <footer> diff --git a/site/public/test/datasets/index.html b/site/public/test/datasets/index.html index 6c56cd3a..2874ee2d 100644 --- a/site/public/test/datasets/index.html +++ b/site/public/test/datasets/index.html @@ -27,9 +27,8 @@ </header> <div class="content"> - <section><pre><code>load file: https://megapixels.nyc3.digitaloceanspaces.com/v1/datasets/datasets.csv -</code></pre> -</section> + <section><h1>Index of datasets</h1> +</section><section><div class='applet' data-payload='{"command": "load file", "opt": "https://nyc3.digitaloceanspaces.com/megapixels/v1/site/test/https://megapixels.nyc3.digitaloceanspaces.com/v1/datasets/datasets.csv"}'></div></section> </div> <footer> diff --git a/site/public/test/face_search/index.html b/site/public/test/face_search/index.html index 7ad32258..3ae3e3f0 100644 --- a/site/public/test/face_search/index.html +++ b/site/public/test/face_search/index.html @@ -27,9 +27,8 @@ </header> <div class="content"> - <section><pre><code>face_search lfw -</code></pre> -</section> + <section><h1>Face search</h1> +</section><section><div class='applet' data-payload='{"command": "face_search lfw"}'></div></section> </div> <footer> diff --git a/site/public/test/gallery/index.html b/site/public/test/gallery/index.html index d2ccd071..fa7ab0ec 100644 --- a/site/public/test/gallery/index.html +++ b/site/public/test/gallery/index.html @@ -27,7 +27,7 @@ </header> <div class="content"> - <section><h1>Test of modal images</h1> + <section><h1>Gallery test</h1> </section><section class='images'><div class='image'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/test/assets/man.jpg' alt='Modal image 1'><div class='caption'>Modal image 1</div></div> <div class='image'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/test/assets/man.jpg' alt='Modal image 2'><div class='caption'>Modal image 2</div></div> <div class='image'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/test/assets/man.jpg' alt='Modal image 3'><div class='caption'>Modal image 3</div></div></section> diff --git a/site/public/test/map/index.html b/site/public/test/map/index.html index b29f19e7..cb8a216e 100644 --- a/site/public/test/map/index.html +++ b/site/public/test/map/index.html @@ -27,9 +27,7 @@ </header> <div class="content"> - <section><pre><code>map lfw -</code></pre> -</section> + <section><div class='applet' data-payload='{"command": "map lfw"}'></div></section> </div> <footer> diff --git a/site/public/test/name_search/index.html b/site/public/test/name_search/index.html index d2cda3eb..f67b8723 100644 --- a/site/public/test/name_search/index.html +++ b/site/public/test/name_search/index.html @@ -27,9 +27,7 @@ </header> <div class="content"> - <section><pre><code>name_search lfw -</code></pre> -</section> + <section><div class='applet' data-payload='{"command": "name_search lfw"}'></div></section> </div> <footer> |
