Target format for xPubedit Typescript
In order for .docx content to port into the new WYSIWYG editor @christos is building (xpubedit), we'll need to build steps to make the necessary tweaks. Fortunately, the required format is closer to valid HTML than what Wax requires.
-
@christos can you please double check me here?confirmed - @wendell there's nothing to do yet but have a quick look
In the meantime, I am going to try to get xpubedit running with the PubSweet development kit.
Target format
General document format
A self-closing <style />
tag prevents content loading in the editor. This is fixed by HTML5. So we should be serializing to HTML5 as the last step.
Paragraphs
Paragraphs are the same as the HTML:
<p>I'm a paragraph!</p>
Headings
Headings are native HTML:
<h1>
<h2>
<h3>
etc.
Lists
Lists, numbered and unnumbered, don't need any changing:
Numbered list:
<ol>
<li>
<p>first li</p>
</li>
<li>
<p>second li</p>
<p> second paragraph of second li </p>
</li>
<li>
<p>third one </p>
</li>
<li><p>fourth</p>
<ol>
<li><p> Nested 1 </p>
</li>
<li><p> Nested 2</p>
</li>
</ol>
</li>
</ol>
Bulleted list:
<ul>
<li>
<p>first li</p>
</li>
<li>
<p>second li</p>
<p> second paragraph of second li </p>
</li>
<li>
<p>third one </p>
</li>
<li><p>fourth</p>
<ul>
<li><p> Nested 1 </p>
</li>
<li><p> Nested 2</p>
</li>
</ul>
</li>
</ul>
Tables
I believe the currently XSweet table extractor should work fine:
<table>
<tr>
<th colspan=3 data-colwidth="100,0,0">Wide header</td>
</tr>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
<tr>
<td>Four</td>
<td>Five</td>
<td>Six</td>
</tr>
</table>
xPubedit also allows for tbody
elements (and I'm also assuming thead
and tfoot
too), although we don't have any use for them at the moment:
<table>
<tbody>
<tr>
<th colspan=3 data-colwidth="100,0,0">Wide header</td>
</tr>
<tr>
<td>One</td>
<td>Two</td>
<td>Three</td>
</tr>
<tr>
<td>Four</td>
<td>Five</td>
<td>Six</td>
</tr>
</tbody>
</table>
Notes
Notes have yet to be implemented in the editor, but once they are, I will update this with the format.