fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add vimeo
[librarian.git]
/
librarian
/
formats
/
pdf
/
__init__.py
diff --git
a/librarian/formats/pdf/__init__.py
b/librarian/formats/pdf/__init__.py
index
8bb68b0
..
de45fb8
100644
(file)
--- a/
librarian/formats/pdf/__init__.py
+++ b/
librarian/formats/pdf/__init__.py
@@
-11,7
+11,7
@@
from lxml import etree
from urllib import urlretrieve
from StringIO import StringIO
from Texml.processor import process
from urllib import urlretrieve
from StringIO import StringIO
from Texml.processor import process
-from librarian import DCNS, XMLNamespace, BuildError
+from librarian import DCNS, XMLNamespace, BuildError
, VIDEO_PROVIDERS
from librarian.formats import Format
from librarian.output import OutputFile
from librarian.renderers import Register, TreeRenderer
from librarian.formats import Format
from librarian.output import OutputFile
from librarian.renderers import Register, TreeRenderer
@@
-316,7
+316,7
@@
PdfFormat.renderers.register(core.Div, 'img', ImgRenderer('insertimage'))
class VideoRenderer(CmdRenderer):
def render(self, element, ctx):
root = super(VideoRenderer, self).render(element, ctx)
class VideoRenderer(CmdRenderer):
def render(self, element, ctx):
root = super(VideoRenderer, self).render(element, ctx)
- url =
'https://www.youtube.com/watch?v=%s' % element.attrib.get('videoid
')
+ url =
VIDEO_PROVIDERS[element.attrib.get('provider')]['url'] % element.attrib.get('videoid', '
')
link = texml_cmd('href', url, url)
root[0][0].text = None
root[0][0].append(link)
link = texml_cmd('href', url, url)
root[0][0].text = None
root[0][0].append(link)