I have a set of educational youtube videos that I want to reference in a document, with links to a particular time in the video. In Python, the code I want would do something like this:
links = {
"first": "https://www.youtube.com/watch?v=3anNG7TfHSQ",
"second": "https://www.youtube.com/watch?v=cfudXO_vzWk"
}
def youTubeRef(text:str, ref:str h:int, min:int, sec:int):
link = f"{links[ref]}&t=h{h}m{min}s{sec}"
return '<a href="{link}">{text}</a>' # though in latex it would just be a href
Then, in a latex document, I would like to use this like so:
Here is \youTubeRef{my text}{first}{0}{12}{13}
And the final rendered document would show:
Here is my text
#
or%
or&
or$
or_
or^
?_
(e.g. in the URL named "second" in the OP code). See for example: webapps.stackexchange.com/questions/54443/….