Linkified all images
This commit is contained in:
parent
282aea97a0
commit
d800e05179
@ -27,6 +27,19 @@ Future<void> wrapTables() async {
|
||||
}
|
||||
}
|
||||
|
||||
// All images that are not nested inside a link will be linkified to themselves.
|
||||
void linkifyImg() {
|
||||
querySelectorAll('img').forEach((img) {
|
||||
print(img.attributes['src']);
|
||||
print(img.parent.tagName);
|
||||
if (img.parent.tagName == 'P') {
|
||||
final link = Element.a()..attributes['href'] = img.attributes['src'];
|
||||
img.insertAdjacentElement('beforeBegin', link);
|
||||
link.append(img);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> reorganizeHtml() async {
|
||||
final content = querySelector('#content');
|
||||
|
||||
@ -47,6 +60,8 @@ Future<void> reorganizeHtml() async {
|
||||
// wrap tables in container for better SCSS display
|
||||
await wrapTables();
|
||||
|
||||
linkifyImg();
|
||||
|
||||
// Add correct class to TOC
|
||||
querySelector('#toc-drop')
|
||||
.append(querySelector('#table-of-contents')..classes.add('dropdown'));
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Binary file not shown.
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 88 KiB |
Binary file not shown.
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 56 KiB |
@ -440,7 +440,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:vowels
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Ñyqy :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Ñyqy :class gentree
|
||||
#+ATTR_LATEX: :float sideways
|
||||
#+CAPTION: Arbre des caractéristiques des voyelles du Ñyqy
|
||||
#+RESULTS[e1f2ca12b3da614823629b888c369ed0ddf3e4a5]:
|
||||
@ -483,7 +483,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:cons
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Ñyqy :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Ñyqy :class gentree
|
||||
#+ATTR_LATEX: :float sideways
|
||||
#+CAPTION: Arbre des caractéristiques des consonnes du Ñyqy
|
||||
#+RESULTS[ea6462370981c1a011d17d703545ec6e6f38f4de]:
|
||||
|
@ -550,7 +550,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:vowels
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Ñyqy :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Ñyqy :class gentree
|
||||
#+CAPTION: Arbre des caractéristiques des voyelles du Ñyqy
|
||||
#+RESULTS:
|
||||
[[file:img/nyqy/vowel-feature-tree.png]]
|
||||
@ -651,7 +651,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:cons
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Ñyqy :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Ñyqy :class gentree
|
||||
#+ATTR_LATEX: :float sideways
|
||||
#+CAPTION: Arbre des caractéristiques des consonnes du Ñyqy
|
||||
#+RESULTS:
|
||||
@ -1106,7 +1106,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: nom-clause-syntax-tree
|
||||
#+ATTR_HTML: :alt Arbre syntaxique des clauses nominales du Ñyqy :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre syntaxique des clauses nominales du Ñyqy :class gentree
|
||||
#+ATTR_LATEX: :height 12cm
|
||||
#+CAPTION: Arbre syntaxique des clauses nominales du Ñyqy
|
||||
#+RESULTS[901e0acb85c38044b47c5a3bacee9aaf7df72251]:
|
||||
|
@ -251,7 +251,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:vow
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Tãso :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des voyelles du Tãso :class gentree
|
||||
#+ATTR_LATEX: :float sideways
|
||||
#+CAPTION: Arbre des caractéristiques des voyelles du Tãso
|
||||
#+RESULTS[eff961e714f2313ac2e974637800b18d5c11c928]:
|
||||
@ -357,7 +357,7 @@
|
||||
$input
|
||||
#+END_SRC
|
||||
#+NAME: arbre:cons
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Tãso :align center :class gentree
|
||||
#+ATTR_HTML: :alt Arbre des consonnes du Tãso :class gentree
|
||||
#+ATTR_LATEX: :float sideways
|
||||
#+CAPTION: Arbre des caractéristiques des consonnes du Tãso
|
||||
#+RESULTS[9bf7d97ca85780e74e9fbb5fc69cbc9800439890]:
|
||||
|
Reference in New Issue
Block a user