From dbee31a43422b3cebb9332473116318924fb8b5f Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Thu, 30 Jun 2022 11:14:12 +0200 Subject: [PATCH] Remove old explain page --- docs/index.md | 2 +- docs/playground/explain.md | 263 ------------------------------------- mkdocs.yml | 6 +- requirements.txt | 1 + tools/md_extensions.py | 16 --- 5 files changed, 7 insertions(+), 281 deletions(-) delete mode 100644 docs/playground/explain.md diff --git a/docs/index.md b/docs/index.md index 4cc6638c..e037df5c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -63,7 +63,7 @@ If it's animated, it has a special [representation](concepts/#animated-property) ## Interactive Explanation If you have a lottie animation and you want to see an interactive description -of its contents, you can visit the [Explain my Lottie](playground/explain.md) page. +of its contents, you can visit the [JSON Editor](playground/json_editor.md) page. ## Anatomy of a Lottie file diff --git a/docs/playground/explain.md b/docs/playground/explain.md deleted file mode 100644 index 67541c5a..00000000 --- a/docs/playground/explain.md +++ /dev/null @@ -1,263 +0,0 @@ -disable_toc: 1 - -Explain my Lottie -================= - - - - -
-
-

This page allows you to load a lottie animation and, once you do, - it shows an interactive explanation of the animation you loaded.

-

It will render the file as a Formatted JSON, - where you can click on objects and properties to open up a dialog with - A brief explanation of what that object is.

-

On that dialog you can also find links to a more in-depth explanation - and a preview of the object you clicked on.

-

If an object contains something that looks invalid, it will be highlighted accordingly.

-
-
-
-

Drop JSON file here

- -
-
-
-

-

-

-
-
- - -
- -
-
-
Load a Lottie to view its contents
-
-
-
- -
- diff --git a/mkdocs.yml b/mkdocs.yml index 930bc2c6..b975ca43 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,6 +17,11 @@ markdown_extensions: - md_extensions extra_css: - /lottie-docs/style/style.css +plugins: + - redirects: + redirect_maps: + "playground/explain.md": "playground/json_editor.md" + nav: - " Topics": - "Introduction": index.md @@ -37,7 +42,6 @@ nav: - " Playground": - "Builder": playground/builder.md - "JSON Editor": playground/json_editor.md - - playground/explain.md - " Advanced": - rendering.md - schema.md diff --git a/requirements.txt b/requirements.txt index 55cfd1c0..5cbfc62c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ mkdocs mkdocs-cinder +mkdocs-redirects git+https://github.com/bmcorser/fontawesome-markdown.git@master lxml diff --git a/tools/md_extensions.py b/tools/md_extensions.py index a1ae950b..328e262c 100644 --- a/tools/md_extensions.py +++ b/tools/md_extensions.py @@ -103,14 +103,6 @@ def __init__(self, *, parent: etree.Element = None, download_file=None, width=No open_in_editor.append(etree_fontawesome("edit")) open_in_editor.attrib["title"] = "Open in Editor" - explain = etree.SubElement(element, "button") - explain.attrib["onclick"] = inspect.cleandoc(r""" - playground_set_url("{url}"); - window.location.href = "/lottie-docs/playground/explain/"; - """).format(url=absfile) - explain.append(etree_fontawesome("book-open")) - explain.attrib["title"] = "Explain" - self.element = element self.variable_name = "lottie_player_{id}".format(id=self.id) self.target_id = "lottie_target_{id}".format(id=self.id) @@ -478,14 +470,6 @@ def run(self, parent, blocks): open_in_editor.append(etree_fontawesome("edit")) open_in_editor.attrib["title"] = "Open in Editor" - explain = etree.SubElement(element, "button") - explain.attrib["onclick"] = inspect.cleandoc(r""" - playground_set_data(lottie_player_{id}.lottie); - window.location.href = "/lottie-docs/playground/explain/"; - """).format(id=anim_id) - explain.append(etree_fontawesome("book-open")) - explain.attrib["title"] = "Explain" - json_viewer_id = None json_viewer_path = None html_append_until = None