voikya / swordfish Goto Github PK
View Code? Open in Web Editor NEWDocument parser
Document parser
I am really keen on Swordfish, I'd been searching for such an utility for ages!
However, is there any way how to preserve another languages next to English?
When I am parsing a Czech file, the result includes many errors on diacritical marks places...
I am sorry I am writing my question here, don't now how to do that better. It could be a feature request!
Thanks!
If an imported Word document includes multiple text runs with identical formatting, it will be rendered with redundant tags by swordfish.
<w:p w14:paraId="2B8680DD" w14:textId="15414D41" w:rsidR="006A368B" w:rsidRPr="00313672" w:rsidRDefault="000D3167" w:rsidP="006A368B">
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:color w:val="222222"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:color w:val="222222"/>
</w:rPr>
<w:t>ABC</w:t>
</w:r>
<w:r w:rsidR="006A368B">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:b/>
<w:color w:val="222222"/>
</w:rPr>
<w:t xml:space="preserve">
</w:t>
</w:r>
<w:r w:rsidR="006A368B" w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:i/>
<w:iCs/>
<w:color w:val="222222"/>
</w:rPr>
<w:t>123</w:t>
</w:r>
</w:p>
becomes
<p><b>ABC</b><b> </b><i>123</i></p>
I see headers are supported (early stage) but can't reach any result when testing that. I guess it searches and evaluates the paragraph font size in comparison with its surroundings (this does not work for me). In my test file the header is typically marked like:
<w:pPr>
<w:pStyle w:val="Nadpis1" />
The "Nadpis1" value would change according to the users language of Office. Do you count with this or are you convinced it would be more smart and take the values it probably takes now (sizes)? How to make that working, please?
Swordfish is really inspiring, I will fork it again and try to shape it to produce xml files. Our publishing house would use it for much quicker publication (we are non-profit academic house). That means, you helped a lot with the gem ๐
Support needs to be added for Word "track changes" markup, which includes a history of elements that have been inserted, deleted, or moved. Right now any document with changes tracked (that haven't been accepted) will result in incorrect rendered content, such as missing certain text or including text that has been deleted.
Add support for docx "complex fields"โa series of five or more runs that define a control flow rather than regular text. In particular, this is needed for the "HYPERLINK" field, since that corresponds to a distinct non-plaintext HTML element.
<w:r w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:color w:val="222222"/>
</w:rPr>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:color w:val="222222"/>
</w:rPr>
<w:instrText xml:space="preserve"> HYPERLINK "https://docs.google.com/spreadsheet/ccc?key=..." \t "_blank" </w:instrText>
</w:r>
<w:r w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:color w:val="222222"/>
</w:rPr>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:i/>
<w:iCs/>
<w:color w:val="1155CC"/>
<w:u w:val="single"/>
<w:shd w:val="clear" w:color="auto" w:fill="FFFFFF"/>
</w:rPr>
<w:t>here</w:t>
</w:r>
<w:r w:rsidRPr="00A171DF">
<w:rPr>
<w:rFonts w:ascii="Times New Roman" w:hAnsi="Times New Roman" w:cs="Times New Roman"/>
<w:color w:val="222222"/>
</w:rPr>
<w:fldChar w:fldCharType="end"/>
</w:r>
Would it be difficult to add the ability to update an existing document or output a new a word doc built up programmatically in swordfish?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.