From cec89e8f37b614ad2b79dddff51921b99443f96c Mon Sep 17 00:00:00 2001 From: Mel <97147377+MelissaAutumn@users.noreply.github.com> Date: Fri, 20 Dec 2024 13:12:36 -0800 Subject: [PATCH] Add a process to generate html from local md files and create a docs route for zoom (#809) --- .../commands/generate_documentation_pages.py | 41 +++++++++ backend/src/appointment/routes/commands.py | 7 +- docs/zoom/en/using-zoom.md | 33 ++++++++ frontend/src/assets/docs/en/using-zoom.html | 29 +++++++ frontend/src/router.ts | 9 ++ frontend/src/views/DocsView.vue | 84 +++++++++++++++++++ 6 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 backend/src/appointment/commands/generate_documentation_pages.py create mode 100644 docs/zoom/en/using-zoom.md create mode 100644 frontend/src/assets/docs/en/using-zoom.html create mode 100644 frontend/src/views/DocsView.vue diff --git a/backend/src/appointment/commands/generate_documentation_pages.py b/backend/src/appointment/commands/generate_documentation_pages.py new file mode 100644 index 000000000..76bde2d66 --- /dev/null +++ b/backend/src/appointment/commands/generate_documentation_pages.py @@ -0,0 +1,41 @@ +import os + +import markupsafe +import requests +import markdown + + +def open_or_get(path: str): + if path.startswith('http'): + return requests.get(path).text + + # Otherwise it's a path + with open(path, 'r') as fh: + return fh.read() + + +def run(): + """Helper function to generate documentation/help pages into plain html + """ + print('Fetching documentation...') + + # Attr_List: In-case remote markdown has attributes + # TOC: For ids on headers + extensions = ['markdown.extensions.attr_list', 'markdown.extensions.toc'] + # Only english for now. There's no german TB privacy policy? + locales = ['en'] + + for locale in locales: + using_zoom_doc = f'../docs/zoom/{locale}/using-zoom.md' + + os.makedirs(f'{os.path.dirname(__file__)}/../tmp/docs/{locale}', exist_ok=True) + + if using_zoom_doc: + print('Using zoom doc found.') + contents = open_or_get(using_zoom_doc) + html = markupsafe.Markup(markdown.markdown(contents, extensions=extensions)) + + with open(f'{os.path.dirname(__file__)}/../tmp/docs/{locale}/using-zoom.html', 'w') as fh: + fh.write(html) + + print('Done! Copy them over to the frontend/src/assets/docs!') diff --git a/backend/src/appointment/routes/commands.py b/backend/src/appointment/routes/commands.py index e7e8e3d0e..fef49ee61 100644 --- a/backend/src/appointment/routes/commands.py +++ b/backend/src/appointment/routes/commands.py @@ -4,7 +4,7 @@ import os import typer -from ..commands import update_db, download_legal, create_invite_codes, setup +from ..commands import update_db, download_legal, create_invite_codes, setup, generate_documentation_pages router = typer.Typer() @@ -36,6 +36,11 @@ def download_legal_docs(): download_legal.run() +@router.command('generate-docs') +def generate_docs(): + generate_documentation_pages.run() + + @router.command('create-invite-codes') def create_app_invite_codes(n: int): create_invite_codes.run(n) diff --git a/docs/zoom/en/using-zoom.md b/docs/zoom/en/using-zoom.md new file mode 100644 index 000000000..79127eef2 --- /dev/null +++ b/docs/zoom/en/using-zoom.md @@ -0,0 +1,33 @@ +[TOC] + +# Using Zoom with Thunderbird Appointment + +You can optionally connect your [Zoom](https://www.zoom.com/) account to Thunderbird Appointment to generate one-time meeting links after a booking has been confirmed. + +## Connecting your Zoom Account + +Connecting your Zoom account is simple! Once you're logged in, navigate to [Settings -> Connected Accounts](https://appointment.day/settings/connectedAccounts). From there simply scroll down until you see the Zoom section. Click the `Connect` button, and you'll be sent over to Zoom's authentication flow and be asked to accept or deny permissions to Thunderbird Appointment. + +If you accept the permissions you'll be sent back to Thunderbird Appointment where your account will be connected. You can confirm that you're good-to-go if you see a red `Disconnect` button instead of a `Connect` button. + +## Disconnecting your Zoom Account + +If at any-time you want to disconnect your Zoom account you may do the following: + +- Click the red `Disconnect` button on [Settings -> Connected Accounts](https://appointment.day/settings/connectedAccounts). +- In Zoom's settings you can remove authorization to Thunderbird Appointment. +- You can delete your Thunderbird Appointment account. + +In any of these cases any references to your Zoom account will be removed from Thunderbird Appointment. + +## Enabling Meeting Link Generation + +Once you've connected your Zoom account you must enable meeting link generation on your schedule. + +Simple navigate to [Dashboard](https://appointment.day/dashboard) and click on the `Meeting Details` tab. Once expanded you should have access to check the `Generate Zoom Meeting` checkbox. Once checked you'll notice the `Video Link` section has been removed as Zoom meeting links will be generated at the time of booking. Finally, click the `Save` button below and you should be good to go! + +## Troubleshooting + +Having an issue with our Zoom integration? Feel free to [contact us](https://appointment.day/contact) with details and we'll get back to you as soon as we can. + + diff --git a/frontend/src/assets/docs/en/using-zoom.html b/frontend/src/assets/docs/en/using-zoom.html new file mode 100644 index 000000000..85c25a20f --- /dev/null +++ b/frontend/src/assets/docs/en/using-zoom.html @@ -0,0 +1,29 @@ +
+ +
+

Using Zoom with Thunderbird Appointment

+

You can optionally connect your Zoom account to Thunderbird Appointment to generate one-time meeting links after a booking has been confirmed.

+

Connecting your Zoom Account

+

Connecting your Zoom account is simple! Once you're logged in, navigate to Settings -> Connected Accounts. From there simply scroll down until you see the Zoom section. Click the Connect button, and you'll be sent over to Zoom's authentication flow and be asked to accept or deny permissions to Thunderbird Appointment.

+

If you accept the permissions you'll be sent back to Thunderbird Appointment where your account will be connected. You can confirm that you're good-to-go if you see a red Disconnect button instead of a Connect button.

+

Disconnecting your Zoom Account

+

If at any-time you want to disconnect your Zoom account you may do the following:

+ +

In any of these cases any references to your Zoom account will be removed from Thunderbird Appointment.

+ +

Once you've connected your Zoom account you must enable meeting link generation on your schedule.

+

Simple navigate to Dashboard and click on the Meeting Details tab. Once expanded you should have access to check the Generate Zoom Meeting checkbox. Once checked you'll notice the Video Link section has been removed as Zoom meeting links will be generated at the time of booking. Finally, click the Save button below and you should be good to go!

+

Troubleshooting

+

Having an issue with our Zoom integration? Feel free to contact us with details and we'll get back to you as soon as we can.

diff --git a/frontend/src/router.ts b/frontend/src/router.ts index 259643a68..2baf727aa 100644 --- a/frontend/src/router.ts +++ b/frontend/src/router.ts @@ -15,6 +15,7 @@ const AppointmentsView = defineAsyncComponent(() => import('@/views/Appointments const SettingsView = defineAsyncComponent(() => import('@/views/SettingsView.vue')); const ProfileView = defineAsyncComponent(() => import('@/views/ProfileView.vue')); const LegalView = defineAsyncComponent(() => import('@/views/LegalView.vue')); +const DocsView = defineAsyncComponent(() => import('@/views/DocsView.vue')); const WaitingListActionView = defineAsyncComponent(() => import('@/views/WaitingListActionView.vue')); const SubscriberPanelView = defineAsyncComponent(() => import('@/views/admin/SubscriberPanelView.vue')); const InviteCodePanelView = defineAsyncComponent(() => import('@/views/admin/InviteCodePanelView.vue')); @@ -154,6 +155,14 @@ const routes: RouteRecordRaw[] = [ isPublic: true, }, }, + { + path: '/docs/using-zoom', + name: 'using-zoom-docs', + component: DocsView, + meta: { + isPublic: true, + }, + }, { path: '/setup', name: 'setup', diff --git a/frontend/src/views/DocsView.vue b/frontend/src/views/DocsView.vue new file mode 100644 index 000000000..2d6a4c084 --- /dev/null +++ b/frontend/src/views/DocsView.vue @@ -0,0 +1,84 @@ + + + + +