doc: add support for images from mallard pages

This commit is contained in:
Frédéric Péters 2019-02-10 23:49:31 +01:00
parent 77b85b1d74
commit e82fb8f632
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,8 @@ for cell in TextCell.objects.filter(slug__startswith='mallard-'):
except TextCell.DoesNotExist:
continue
a.attrs['href'] = target_cell.page.get_online_url()
for img in document.find_all('img'):
img.attrs['src'] = 'https://doc.entrouvert.org/%s/dev/%s' % (module, img.attrs['src'])
new_content = unicode(content).replace(unicode(more_info), '')
cell.text = new_content