docx-rs
docx-rs copied to clipboard
consider documenting contributor expectations, project goals
Thank you for putting in the time to create this library @PoiScript!
I am considering using it in another project but am not sure about your goals for this project. I propose creating a simple contributors guide and perhaps describing your goals for the project. GithHub's guide has some best practice recommendations that could help here. Again, thank you!
Thanks for your suggestion! I created docx-rs as a side project for resolving some problems I encountered at work. So it actually don't have any particular goal at first but making my own scripts works. :(
After some thought, to keep the docx-rs projecting evolving, I think the goal may be like providing a strong-typed interface for generating, parsing and modifying docx files.
To achieve this goal, a rewrite is necessary. I do have some cool ideas about that, like storing all xml element into indextree arena to make sure everything laid out in a single Vec (I will probably create a new crate to do so) and keeping a buffer locally to reduce String allocations. However I don't have time to implement that at this present time... So I will keep the issue open for a while (maybe 3-4 months) until I come back to rewrite this.
Certainly @PoiScript! The joy of side projects! Thank you for the update.
providing a strong-typed interface for generating, parsing and modifying docx files
This is an excellent goal. I think it would provide benefit to to users in the Rust community who want to work with docx. One use case I have is to generate docx files from a dotx. From what I have read in the specification, this should be straightforward to implement.
I do have some cool ideas about that, like storing all xml element into indextree arena to make sure everything laid out in a single Vec
Sounds neat. Not sure if it is relevant but I have been using roxmltree to parse document.xml and it has an excellent API.
I'll keep an eye on the project 😄
Sounds neat. Not sure if it is relevant but I have been using roxmltree to parse document.xml and it has an excellent API.
Thank you for the recommendation. I had never heard of roxmltree or xmlparser before. I definitely take a look at.
One use case I have is to generate
docxfiles from adotx. From what I have read in the specification, this should be straightforward to implement.
Could you provide a link to the specification? It would be best if you can also upload a example dotx file. Thanks in advance!
Certainly! There are 2 main specifications for OOXML documents.
- https://standards.iso.org/ittf/PubliclyAvailableStandards/index.html
- Search for ISO/IEC 29500 on the page. 5,000 or so pages of light reading for each format. Quite useful to obtain definitive information on specific tags and the basic structure. I was reading the
C071691e.pdffrom a download.
- Search for ISO/IEC 29500 on the page. 5,000 or so pages of light reading for each format. Quite useful to obtain definitive information on specific tags and the basic structure. I was reading the
- https://www.ecma-international.org/publications/standards/Ecma-376.htm
- Both documents are quite similar. FWIW the ISO PDF formatting is somewhat more readable. I think both documents are describing the same thing
The specification uses the term "Document Template" to describe template formats. Section 11.4 has the main link to it but you can search on the above term.
I am working an a template internal to my company but Microsoft has a number of free ones for Word. I noticed a number of them are just docx but the following flyer one is a dotx: https://omextemplates.content.office.net/support/templates/en-us/tf16412131.dotx