Browse Source

fix link to docker image example in search index

Rodja Trappe 1 year ago
parent
commit
6a39167e07
2 changed files with 3 additions and 2 deletions
  1. 2 1
      website/build_search_index.py
  2. 1 1
      website/static/search_index.json

+ 2 - 1
website/build_search_index.py

@@ -132,7 +132,8 @@ class MainVisitor(ast.NodeVisitor):
         if function_name == 'example_link':
             title = ast_string_node_to_string(node.args[0])
             name = name = title.lower().replace(' ', '_')
-            file = 'main.py' if not 'ros' in name else ''  # TODO: generalize hack to use folder if main.py is not available
+            # TODO: generalize hack to use folder if main.py is not available
+            file = 'main.py' if not any(x in name for x in ['ros', 'docker']) else ''
             documents.append({
                 'title': 'Example: ' + title,
                 'content': ast_string_node_to_string(node.args[1]),

+ 1 - 1
website/static/search_index.json

@@ -147,7 +147,7 @@
   {
     "title": "Example: Docker Image",
     "content": "Demonstrate using the official[zauberzeug/nicegui](https://hub.docker.com/r/zauberzeug/nicegui) docker image",
-    "url": "https://github.com/zauberzeug/nicegui/tree/main/examples/docker_image/main.py"
+    "url": "https://github.com/zauberzeug/nicegui/tree/main/examples/docker_image/"
   },
   {
     "title": "Example: Download Text as File",