Commit 0f336466 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Use table for a more compact HTML annotations export

parent 7002a1d1
......@@ -222,21 +222,46 @@ export class AnnotationsExporter {
return (
<article key={annotation.id}>
<h2>Annotation {index + 1}:</h2>
<p>
Created at:
<table>
<tbody>
<tr>
<td>Created at:</td>
<td>
<time dateTime={annotation.created}>
{formatDateTime(new Date(annotation.created))}
</time>
</p>
<p>Author: {extractUsername(annotation)}</p>
{page && <p>Page: {page}</p>}
<p>
Quote: <blockquote>{quote(annotation)}</blockquote>
</p>
<p>Comment: {annotation.text}</p>
</td>
</tr>
<tr>
<td>Author:</td>
<td>{extractUsername(annotation)}</td>
</tr>
{page && (
<tr>
<td>Page:</td>
<td>{page}</td>
</tr>
)}
<tr>
<td>Quote:</td>
<td>
<blockquote style={{ margin: 0 }}>
{quote(annotation)}
</blockquote>
</td>
</tr>
<tr>
<td>Comment:</td>
<td>{annotation.text}</td>
</tr>
{annotation.tags.length > 0 && (
<p>Tags: {annotation.tags.join(', ')}</p>
<tr>
<td>Tags:</td>
<td>{annotation.tags.join(', ')}</td>
</tr>
)}
</tbody>
</table>
</article>
);
})}
......
......@@ -355,46 +355,100 @@ ${formattedNow},John Doe,,http://example.com,My group,Annotation,,Annotation tex
<h1>Annotations</h1>
<article>
<h2>Annotation 1:</h2>
<p>
Created at:
<table>
<tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time>
</p>
<p>Author: jane</p>
<p>
Quote:
<blockquote></blockquote>
</p>
<p>Comment: Annotation text</p>
<p>Tags: foo, bar</p>
</td>
</tr>
<tr>
<td>Author:</td>
<td>jane</td>
</tr>
<tr>
<td>Quote:</td>
<td>
<blockquote style="margin:0px;"></blockquote>
</td>
</tr>
<tr>
<td>Comment:</td>
<td>Annotation text</td>
</tr>
<tr>
<td>Tags:</td>
<td>foo, bar</td>
</tr>
</tbody>
</table>
</article>
<article>
<h2>Annotation 2:</h2>
<p>
Created at:
<table>
<tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time>
</p>
<p>Author: bill</p>
<p>Page: 23</p>
<p>
Quote:
<blockquote>includes &lt;p>HTML&lt;/p> tags</blockquote>
</p>
<p>Comment: Annotation text</p>
<p>Tags: tag_1, tag_2</p>
</td>
</tr>
<tr>
<td>Author:</td>
<td>bill</td>
</tr>
<tr>
<td>Page:</td>
<td>23</td>
</tr>
<tr>
<td>Quote:</td>
<td>
<blockquote style="margin:0px;">includes &lt;p>HTML&lt;/p> tags</blockquote>
</td>
</tr>
<tr>
<td>Comment:</td>
<td>Annotation text</td>
</tr>
<tr>
<td>Tags:</td>
<td>tag_1, tag_2</td>
</tr>
</tbody>
</table>
</article>
<article>
<h2>Annotation 3:</h2>
<p>
Created at:
<table>
<tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time>
</p>
<p>Author: bill</p>
<p>Page: iii</p>
<p>
Quote:
<blockquote></blockquote>
</p>
<p>Comment: Annotation text</p>
</td>
</tr>
<tr>
<td>Author:</td>
<td>bill</td>
</tr>
<tr>
<td>Page:</td>
<td>iii</td>
</tr>
<tr>
<td>Quote:</td>
<td>
<blockquote style="margin:0px;"></blockquote>
</td>
</tr>
<tr>
<td>Comment:</td>
<td>Annotation text</td>
</tr>
</tbody>
</table>
</article>
</section>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment