Skip to content

Commit

Permalink
Use html block extension
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Nov 11, 2024
1 parent 465d24f commit 5c3ec7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ description: All you need to know about adding drift to your project.

---



Drift is a powerful database library for Dart and Flutter applications. To
support its advanced capabilities like type-safe SQL queries, verification of
your database and migrations, it uses a builder and command-line tooling that
Expand Down
11 changes: 7 additions & 4 deletions docs/mkdocs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ def markdown_codeblock(content: str, lang: str = "") -> str:


def html_codeblock(content: str) -> str:
"""
Create the html for this code block.
"""
random_id = "".join(random.choices(string.ascii_lowercase + string.digits, k=8))
result = f"""<div class="highlight"><pre id="{random_id}"><code>{content}</code></pre></div>"""

result = f"""
/// html | div[class="highlight"]
markdown: html
<pre id="{random_id}"><code>{content}</code></pre>
///
"""
return result
1 change: 1 addition & 0 deletions docs/mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ markdown_extensions:
options:
custom_icons:
- overrides/.icons
- pymdownx.blocks.html

nav:
- index.md
Expand Down

0 comments on commit 5c3ec7c

Please sign in to comment.