Comments (2)
Note: getting tables right is tricky this way. See below HTML, which is what I got after exporting from MS Word following some cleaning up by Tidy:
<table class="MsoNormalTable c7" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="229" valign="top" class='c1'>
<p class="Tablecellheading"><span lang="EN-GB" xml:lang="EN-GB">Test
name</span></p>
</td>
<td width="310" valign="top" class='c2'>
<p class="Tablecellheading"><span lang="EN-GB" xml:lang="EN-GB">True
if</span></p>
</td>
</tr>
<tr>
<td width="229" valign="top" class='c3'>
<p class="Tablecell"><span lang="EN-GB" xml:lang=
"EN-GB">boxLengthIsValid</span></p>
</td>
<td width="310" valign="top" class='c4'>
<p class="Tablecell"><span lang="EN-GB" xml:lang="EN-GB">Size of box contents
equals 4 bytes</span></p>
</td>
</tr>
<tr>
<td width="229" valign="top" class='c5'>
<p class="Tablecell"><span lang="EN-GB" xml:lang=
"EN-GB">signatureIsValid</span></p>
</td>
<td width="310" valign="top" class='c6'>
<p class="Tablecell"><span lang="EN-GB" xml:lang="EN-GB">Signature equals
0x0d0a870a</span></p>
</td>
</tr>
</table>
Pandoc does not convert it to a nicely formatted Markdown table. After some experimentation I could make the above example work after the following steps:
- strip all p and span subelements from each td element
- Wrap first row in thead element
- Change td elements in first row to th
- wrap remainder of table in tbody element
This produces something like this:
<table class="MsoNormalTable c7" border="1" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th width="229" valign="top" class='c1'>Test name</th>
<th width="310" valign="top" class='c2'>True if</th>
</tr>
</thead>
<tbody>
<tr>
<td width="229" valign="top" class='c3'>boxLengthIsValid</td>
<td width="310" valign="top" class='c4'>Size of box contents equals 4 bytes</td>
</tr>
<tr>
<td width="229" valign="top" class='c5'>signatureIsValid</td>
<td width="310" valign="top" class='c6'>Signature equals 0x0d0a870a</td>
</tr>
</tbody>
</table>
Throwing this at Pandoc produces:
|Test name|True if|
|:--------|:------|
|boxLengthIsValid|Size of box contents equals 4 bytes|
|signatureIsValid|Signature equals 0x0d0a870a|
Which will render as:
Test name | True if |
---|---|
boxLengthIsValid | Size of box contents equals 4 bytes |
signatureIsValid | Signature equals 0x0d0a870a |
So the trick here will be to automate the above changes throughout the document.
from jpylyzer.
All done, see:
https://github.com/openplanets/jpylyzer/tree/master/doc
This is now used to produce an online version of the documentation:
http://openplanets.github.io/jpylyzer/userManual.html
Export to delivery formats other than HTML needs more work ...
from jpylyzer.
Related Issues (20)
- Replace iteration loop by bitmask HOT 1
- Add missing exception type HOT 1
- Check Pep8 compliance and fix HOT 1
- Report compression ratio for raw codestreams HOT 1
- maxOneCqccPerComponent and maxOneCcocPerComponent are overly restrictive HOT 1
- Check for COC and QCC markers that are not in first tile-part of a tile HOT 2
- Command line options not set correctly in 2-2-dev HOT 1
- Add file-level warnings to output file HOT 1
- Debian package build process fails HOT 4
- Debian package name of RC releases modified by Github
- Remove test CPFnumConsistentWithRsiz (and possibly also CPFnumConsistentWithPRFnum) HOT 1
- Running Debian build script results in deprecation warning
- Dockerfile issue with --install-option=\"--prefix=/install\" HOT 1
- Calculation of numberOfTilesX and numberOfTilesY subtracts xOsiz/yOsiz instead of xTOsiz/yTOsiz HOT 5
- Add more HTJ2K test files
- Docker PyPI script broken / outdated HOT 1
- Jpylyzer fails with "unknown error" HOT 1
- Adobe Photoshop images with erroneous tile-part information no longer result in validation error HOT 2
- Unit tests broken? HOT 3
- Question about new PLM marker support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpylyzer.