Refactor keyword parsing/rendering & add support for ATTR_HTML
This commit is contained in:
parent
a859264420
commit
81f74f4ad9
9 changed files with 169 additions and 76 deletions
8
org/testdata/blocks.html
vendored
8
org/testdata/blocks.html
vendored
|
@ -1,4 +1,4 @@
|
|||
<div class="captioned">
|
||||
<figure>
|
||||
<div class="highlight">
|
||||
<pre>
|
||||
echo "a bash source block"
|
||||
|
@ -10,10 +10,10 @@ function hello {
|
|||
hello
|
||||
</pre>
|
||||
</div>
|
||||
<p class="caption">
|
||||
<figcaption>
|
||||
block caption
|
||||
</p>
|
||||
</div>
|
||||
</figcaption>
|
||||
</figure>
|
||||
<div class="highlight">
|
||||
<pre>
|
||||
a source block without a language
|
||||
|
|
31
org/testdata/captions.html
vendored
31
org/testdata/captions.html
vendored
|
@ -1,27 +1,30 @@
|
|||
<p>
|
||||
Anything can be captioned. Also captions are not real, correct captions but just a paragraph below the element (bothe wrapped into a div)
|
||||
</p>
|
||||
<div class="captioned">
|
||||
<figure>
|
||||
<div class="highlight">
|
||||
<pre>
|
||||
echo "i have a caption!"
|
||||
</pre>
|
||||
</div>
|
||||
<p class="caption">
|
||||
<figcaption>
|
||||
captioned soure block
|
||||
</p>
|
||||
</div>
|
||||
<div class="captioned">
|
||||
</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<img src="http://placekitten.com/200/200#.png" alt="http://placekitten.com/200/200#.png" title="http://placekitten.com/200/200#.png" /><figcaption>
|
||||
captioned link (image in this case)
|
||||
</figcaption>
|
||||
</figure>
|
||||
<p>
|
||||
<video src="my-video.mp4" title="my-video.mp4">my-video.mp4</video>
|
||||
note that the whole paragraph is captioned, so a linebreak is needed for images to caption correctly
|
||||
</p>
|
||||
<p class="caption">
|
||||
captioned link (video in this case)
|
||||
</p>
|
||||
</div>
|
||||
<figure>
|
||||
<p>
|
||||
note that only that one line is captioned, not the whole paragraph
|
||||
</p>
|
||||
<p>
|
||||
also, normal text lines can't be captioned
|
||||
<img src="http://placekitten.com/200/200#.png" alt="http://placekitten.com/200/200#.png" title="http://placekitten.com/200/200#.png" />
|
||||
see?
|
||||
</p>
|
||||
<figcaption>
|
||||
captioned link (image in this case)
|
||||
</figcaption>
|
||||
</figure>
|
||||
|
|
13
org/testdata/captions.org
vendored
13
org/testdata/captions.org
vendored
|
@ -5,9 +5,12 @@ Anything can be captioned. Also captions are not real, correct captions but just
|
|||
echo "i have a caption!"
|
||||
#+END_SRC
|
||||
|
||||
#+CAPTION: captioned link (video in this case)
|
||||
[[my-video.mp4]]
|
||||
note that only that one line is captioned, not the whole paragraph
|
||||
#+CAPTION: captioned link (image in this case)
|
||||
[[http://placekitten.com/200/200#.png]]
|
||||
|
||||
note that the whole paragraph is captioned, so a linebreak is needed for images to caption correctly
|
||||
|
||||
#+CAPTION: captioned link (image in this case)
|
||||
[[http://placekitten.com/200/200#.png]]
|
||||
see?
|
||||
|
||||
#+CAPTION: not happening!
|
||||
also, normal text lines can't be captioned
|
||||
|
|
18
org/testdata/keywords.html
vendored
Normal file
18
org/testdata/keywords.html
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<figure>
|
||||
<div class="highlight" class="a b c" id="it">
|
||||
<pre>echo "a bash source block with custom html attributes"
|
||||
</pre>
|
||||
</div>
|
||||
<figcaption>
|
||||
and <span style="text-decoration: underline;">multiple</span> lines of <strong>captions</strong>!
|
||||
</figcaption>
|
||||
</figure>
|
||||
<p>
|
||||
and an image with custom html attributes and a caption
|
||||
</p>
|
||||
<figure>
|
||||
<img src="http://placekitten.com/200/200#.png" alt="http://placekitten.com/200/200#.png" title="http://placekitten.com/200/200#.png" style="border: 10px solid black"/>
|
||||
<figcaption>
|
||||
kittens!
|
||||
</figcaption>
|
||||
</figure>
|
13
org/testdata/keywords.org
vendored
Normal file
13
org/testdata/keywords.org
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
#+CAPTION: and _multiple_
|
||||
#+CAPTION: lines of *captions*!
|
||||
#+ATTR_HTML: :class "a b c"
|
||||
#+ATTR_HTML: :id it
|
||||
#+BEGIN_SRC sh
|
||||
echo "a bash source block with custom html attributes"
|
||||
#+END_SRC
|
||||
|
||||
and an image with custom html attributes and a caption
|
||||
#+CAPTION: kittens!
|
||||
#+ATTR_HTML: :style "border: 10px solid black"
|
||||
[[http://placekitten.com/200/200#.png]]
|
Loading…
Add table
Add a link
Reference in a new issue