Let’s face it – writing documentation isn’t always enjoyable and can often feel like a daunting task. It comes in various formats, from a simple README to more comprehensive guides. Personally, I favor markdown and wiki-style documentation because it’s usually closely tied to the code and easy to manage.
One common approach to documentation is maintaining a library of Microsoft Word documents. However, these documents are often disjointed, difficult to search, and may lack consistency in style. Converting from Word to markdown isn’t always straightforward and can be time-consuming. Enter documorph – a dotnet global tool designed to simplify the conversion of Microsoft Word documents to markdown files. It also extracts any media files and links them to the markdown files. With documorph, you can effortlessly convert an entire library of docs and upload them to platforms like Azure DevOps wiki, GitHub wiki, or any other markdown-based documentation repository.
Here is how to get started with documorph:
- Installation: Install the tool using the following command:
|
|
- Conversion: Convert a Word document to markdown using the command:
|
|
In addition to the dotnet global tool, documorph also provides a dotnet 8 library for direct integration into your code.
- Library Installation: Install the library using the following command:
|
|
- Usage: Use the library to convert a Word document to markdown:
|
|
Whether through the CLI or the package, documorph ensures CommonMark compliant output as can be seen in the post cover.
Documorph is open source and available on GitHub at jlucaspains/documorph under the MIT license. It is still in the early stages of development, so feedback is greatly appreciated. If you have any questions or suggestions, feel free to open an issue on GitHub.
Cheers,
Lucas