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 { ...@@ -222,21 +222,46 @@ export class AnnotationsExporter {
return ( return (
<article key={annotation.id}> <article key={annotation.id}>
<h2>Annotation {index + 1}:</h2> <h2>Annotation {index + 1}:</h2>
<p> <table>
Created at: <tbody>
<tr>
<td>Created at:</td>
<td>
<time dateTime={annotation.created}> <time dateTime={annotation.created}>
{formatDateTime(new Date(annotation.created))} {formatDateTime(new Date(annotation.created))}
</time> </time>
</p> </td>
<p>Author: {extractUsername(annotation)}</p> </tr>
{page && <p>Page: {page}</p>} <tr>
<p> <td>Author:</td>
Quote: <blockquote>{quote(annotation)}</blockquote> <td>{extractUsername(annotation)}</td>
</p> </tr>
<p>Comment: {annotation.text}</p> {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 && ( {annotation.tags.length > 0 && (
<p>Tags: {annotation.tags.join(', ')}</p> <tr>
<td>Tags:</td>
<td>{annotation.tags.join(', ')}</td>
</tr>
)} )}
</tbody>
</table>
</article> </article>
); );
})} })}
......
...@@ -355,46 +355,100 @@ ${formattedNow},John Doe,,http://example.com,My group,Annotation,,Annotation tex ...@@ -355,46 +355,100 @@ ${formattedNow},John Doe,,http://example.com,My group,Annotation,,Annotation tex
<h1>Annotations</h1> <h1>Annotations</h1>
<article> <article>
<h2>Annotation 1:</h2> <h2>Annotation 1:</h2>
<p> <table>
Created at: <tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time> <time datetime="${isoDate}">${formattedNow}</time>
</p> </td>
<p>Author: jane</p> </tr>
<p> <tr>
Quote: <td>Author:</td>
<blockquote></blockquote> <td>jane</td>
</p> </tr>
<p>Comment: Annotation text</p> <tr>
<p>Tags: foo, bar</p> <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>
<article> <article>
<h2>Annotation 2:</h2> <h2>Annotation 2:</h2>
<p> <table>
Created at: <tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time> <time datetime="${isoDate}">${formattedNow}</time>
</p> </td>
<p>Author: bill</p> </tr>
<p>Page: 23</p> <tr>
<p> <td>Author:</td>
Quote: <td>bill</td>
<blockquote>includes &lt;p>HTML&lt;/p> tags</blockquote> </tr>
</p> <tr>
<p>Comment: Annotation text</p> <td>Page:</td>
<p>Tags: tag_1, tag_2</p> <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>
<article> <article>
<h2>Annotation 3:</h2> <h2>Annotation 3:</h2>
<p> <table>
Created at: <tbody>
<tr>
<td>Created at:</td>
<td>
<time datetime="${isoDate}">${formattedNow}</time> <time datetime="${isoDate}">${formattedNow}</time>
</p> </td>
<p>Author: bill</p> </tr>
<p>Page: iii</p> <tr>
<p> <td>Author:</td>
Quote: <td>bill</td>
<blockquote></blockquote> </tr>
</p> <tr>
<p>Comment: Annotation text</p> <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> </article>
</section> </section>
</body> </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