]> git.ipfire.org Git - thirdparty/fastapi/sqlmodel.git/commitdiff
📝 Add Jina's QA Bot to the docs to help people that want to ask quick questions ...
authorSebastián Ramírez <tiangolo@gmail.com>
Sat, 16 Apr 2022 09:24:53 +0000 (11:24 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Apr 2022 09:24:53 +0000 (11:24 +0200)
Co-authored-by: yanlong.wang <yanlong.wang@naiver.org>
Co-authored-by: Han Xiao <han.xiao@jina.ai>
docs/overrides/main.html [new file with mode: 0644]
mkdocs.yml

diff --git a/docs/overrides/main.html b/docs/overrides/main.html
new file mode 100644 (file)
index 0000000..fc5bce8
--- /dev/null
@@ -0,0 +1,31 @@
+{% extends "base.html" %}
+{%- block scripts %}
+{{ super() }}
+<script src="https://cdn.jsdelivr.net/npm/qabot@0.4"></script>
+<script>
+    // This prevents the global search from interfering with qa-bot's internal text input.
+    document.addEventListener('DOMContentLoaded', () => {
+      document.querySelectorAll('qa-bot').forEach((x) => {
+        x.addEventListener('keydown', (event) => {
+          event.stopPropagation();
+        });
+      });
+    });
+</script>
+<qa-bot 
+    server="https://tiangolo-sqlmodel.docsqa.jina.ai" 
+    theme="infer" 
+    title="SQLModel Bot"
+    description="SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness."
+    style="font-size: 0.8rem"
+>
+    <template>
+        <dl>
+            <dt>You can ask questions about SQLModel. Try:</dt>
+            <dd>Which Python version is supported?</dd>
+            <dd>How SQLModel interacts with the database?</dd>
+            <dd>How can I link tables?</dd>
+        </dl>
+    </template>
+</qa-bot>
+{%- endblock %}
\ No newline at end of file
index 41a7258a75e49675b789c15d429c0b611e52c198..a27bbde8a128189785d6ccc9f7bb8dd9ca789296 100644 (file)
@@ -3,6 +3,7 @@ site_description: SQLModel, SQL databases in Python, designed for simplicity, co
 site_url: https://sqlmodel.tiangolo.com/
 theme:
   name: material
+  custom_dir: docs/overrides
   palette:
   - scheme: default
     primary: deep purple