Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions sphinx_design/tabs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import os
import random
import time
from typing import List
from uuid import uuid4
import uuid

from docutils import nodes
from docutils.parsers.rst import directives
Expand All @@ -12,6 +15,9 @@

LOGGER = getLogger(__name__)

rnd = random.Random()
rnd.seed(os.environ.get("SOURCE_DATE_EPOCH", time.time()))


def setup_tabs(app: Sphinx) -> None:
app.add_directive("tab-set", TabSetDirective)
Expand Down Expand Up @@ -209,7 +215,7 @@ class TabSetHtmlTransform(SphinxPostTransform):
formats = ("html",)

def get_unique_key(self):
return str(uuid4())
return uuid.UUID(int=rnd.getrandbits(128), version=4).hex

def run(self) -> None:
"""Run the transform."""
Expand Down