Convert Word Documents to Markdown for LLM / AI consumptions

I’ve finally had the time to convert preprint academic articles of JCRINN to markdowns!

Microsoft Word documents are common in research, teaching, and administration. When preparing these documents for a large language model (LLM), converting them to Markdown gives you a readable text file that you can inspect, edit, and supply to an AI application.

Pandoc is a command-line document converter available on Linux. It supports Microsoft DOCX input and several Markdown formats, making it useful for preparing manuscripts, reports, lecture notes, and technical documentation. Its focus is document structure, rather than reproducing the original page layout. Pandoc documentation

For academic writing, sections such as Introduction, Methods, Results, and Discussion provide useful boundaries. A retrieval system can divide a document at these boundaries and retrieve relevant passages when answering a question. Microsoft’s Azure AI Search documentation provides a concrete example of indexing Markdown by heading and retaining section information. This supports using Markdown as a practical format for structured retrieval. Microsoft documentation

The practical benefits include:

  • Visible input: You can review the actual text supplied to the AI application.
  • Reusable content: The same file can support summarisation, question answering, search, and a document knowledge base.
  • Source tracking: Keeping the title, authors, DOI, and source URL helps connect extracted claims to their original document.
  • Controlled selection: You can provide relevant sections instead of repeatedly submitting the complete document.

Markdown does not make an LLM automatically understand a document better or prevent invented answers. It also does not necessarily reduce token usage compared with a good DOCX text extractor. File size on disk is not a reliable measure of model input tokens. The benefit is greater control over the text and structure entering your workflow.

How to convert DOCX documents to Markdown in Ubuntu / Linux

Step 1: Install Pandoc

sudo apt install pandoc

Ubuntu’s repository version may be older than the latest upstream release. If you need a newer feature or conversion fix, consult the official Pandoc installation instructions. A LaTeX installation is unnecessary for DOCX-to-Markdown conversion.

Step 2 : Convert DOCX to Markdown (single file)

pandoc "report.docx" --from=docx --to=gfm --wrap=none -o "report.md"

For an academic manuscript with footnotes and equations, Pandoc’s own Markdown format is another useful choice:

To extract embedded images and update their references:

pandoc "report.docx" --from=docx --to=markdown --wrap=none \
  --extract-media="report-assets" -o "report.md

These formats and options are documented in the Pandoc User’s Guide. Running another example with the same output filename replaces the previous Markdown file.

An image reference does not give a text-only model access to the image’s contents. Supply figures separately to a vision-capable system, or add verified descriptions and relevant values as text.

Step 3: Review the converted document

Compare it with the Word original. Check section headings, numerical results, units, table labels, equations, references, and figure captions. Complex tables and formatting may not survive conversion accurately. Pandoc conversion limitations

For research documents, retain the qualifications attached to findings. A reported accuracy value without its dataset, evaluation method, or limitations can produce a misleading summary.

Step 4: Use the Markdown with an LLM

Upload the file to an application that accepts Markdown, or paste a relevant section into the conversation. For a larger collection, configure your retrieval workflow to preserve document identity and section headings with each passage.

A useful starting prompt is:

Using only the supplied document, identify the research objective, method, dataset, main results, and limitations. Cite the relevant section for each item. Preserve numerical values and units exactly. If information is absent, state “not reported”.

BONUS: Batch convert all DOCX files with bash

For a folder containing several documents, save the following script as batch-docx-to-markdown.sh

The script can be downloaded here in this gist: https://gist.github.com/mypapit/df6615f8611f03678bc93ee0485001be#file-batch-docx-to-markdown-sh

How to Generate Audio Spectrum Videos from MP3 songs with FFmpeg

Sometimes I need a simple way to convert an MP3 file into a video suitable for YouTube. Instead of using a static image.

I created a small Bash script that generates an animated frequency spectrum using FFmpeg.

The script uses FFmpeg’s showfreqs filter to generate an animated frequency spectrum from the audio.

How to use the script?

Step 1 : Download the script from gist

wget -c https://gist.githubusercontent.com/mypapit/37817eab6988fe05b87c64025409a894/raw/c04a917e12e9b89e6784783d19061dc771dbed99/spectrum.sh


Step 2: make it executable chmod +x spectrum.sh

Step 3: Use the script – ./spectrum.sh song.mp3

Alternatively you can also convert/export multiple mp3 files : ./spectrum.sh *.mp3

Why Use This Script?

The main advantage is simplicity. There is no video editor, GUI application, or complicated workflow involved. FFmpeg handles the audio analysis, visualization, video encoding, and audio encoding in a single operation.

It is also easy to modify the showfreqs parameters if you want different spectrum sizes, positions, frame rates, scaling methods, or visual styles.

For batch processing MP3 files into simple spectrum videos, this small Bash script provides a practical solution.

Sample Videos

Test Solar PV Monitoring Dashboards Using an Open-Source Renogy BT-1 Simulator

Renogy BT-1 telemetry provides useful information for monitoring the condition and performance of a solar photovoltaic system. It can report key values such as PV voltage, current, power generation, battery status, controller temperature, charging activity, and load consumption. These data are important for building dashboards, alerts, databases, and automation systems.

However, developing and testing such a monitoring system normally requires access to real Renogy hardware, including a compatible charge controller and BT-1 Bluetooth module. This can make early development difficult, especially when developers need to reproduce specific conditions such as low battery voltage, peak sunlight, nighttime discharge, or controller inactivity.

My latest open-source project, Renogy BT-1 Telemetry Simulator, removes this hardware requirement.

Application Screenshot

The Renogy BT-1 Telemetry Simulator addresses this problem by generating realistic sample telemetry and sending it as JSON to an HTTP or HTTPS endpoint without requiring physical solar equipment.

The simulator imitates telemetry commonly produced by a Renogy BT-1 module connected to a Renogy Rover MPPT charge controller.

You can manually configure values such as:

  • Solar PV voltage, current, power, and generated energy
  • Battery percentage, voltage, current, temperature, and battery type
  • Controller temperature and charging status
  • Load voltage, current, power, and energy consumption
  • Controller model, device ID, and BT-1 identifier

The application can also calculate PV and load power automatically.

Renogy BT-1 Telemetry Simulator Use Cases

The simulator is useful for testing the Solar PV under various situations:

  • Peak Sunshine
  • Nighttime operations
  • Low battery conditions
  • Heavy loads / light loads

Application Features

  • One-off HTTP Post transmission
  • Periodic transmission at a configurable interval
  • A default two-minute sending interval
  • Live JSON payload preview
  • Transmission logs with HTTP status, response, errors, and request duration

This is useful for testing local development servers, webhooks, staging systems, database storage, monitoring dashboards, and automated alerts before installing physical solar hardware.

Requirements

The application uses WPF and .NET 8, so it runs on Windows 10 or Windows 11. Developers can build it using Visual Studio 2022 or the standard dotnet command-line tools.

The current HTTP client accepts self-signed HTTPS certificates for local testing. This behaviour should not be treated as secure certificate validation for production systems.

Download the Source Code

Renogy BT-1 Telemetry Simulator is available on GitHub:

github.com/mypapit/renogybt1simulator

The project is released under the GNU General Public License version 3, allowing users to study, modify, and redistribute the source code according to the GPL terms.

This project is an independent simulator and is not an official Renogy product.

PolicyMaker: A Lightweight PHP Tool to Create Privacy Policy Pages for Android Apps

PolicyMaker is a lightweight web application for creating, managing, publishing, and displaying privacy policies for Android mobile applications. It is built using PHP and SQLite, so it does not need a heavy database server or complex deployment setup. The project is available on GitHub – https://github.com/mypapit/policymaker

PolicyMaker Dashboard

PolicyMaker Wizard

The main idea behind PolicyMaker is simple. Many Android developers need a public privacy policy page, especially when publishing applications to app stores. Instead of manually writing and formatting the same policy structure again and again, PolicyMaker provides an administrator-only wizard that helps generate structured privacy policy text from simple inputs.

The wizard supports yes/no choices, radio buttons, checkboxes, and text fields. It can collect details such as application name, package name, website, effective date, personal data collection, analytics, advertising, permissions, service providers, data retention, security, user rights, and children’s privacy.

PolicyMaker is useful for small developers, indie Android publishers, educators, and small organizations that manage several simple mobile apps. It is not meant to be a large enterprise compliance platform. Its strength is that it is small, direct, and easy to host. It only requires PHP 8.3 or newer with SQLite/PDO SQLite support. The installer creates the SQLite database and generates the first administrator password.

The public policy pages also include Schema.org JSON-LD metadata, which helps make the policy page more structured for search engines

PolicyMaker is licensed under the BSD 2-Clause license. This makes it practical for developers who want a small self-hosted privacy policy system that can be modified and deployed with minimal restriction.

Neuropentracker: A Simple BitTorrent Tracker for Small Setups

I have published Neuropentracker, a simple BitTorrent tracker on GitHub:
https://github.com/mypapit/neuropentracker

Dashboard Screenshot

What it is

Neuropentracker is written in PHP and is designed for small setups. It is suitable for small organizations, small communities, labs, schools, or internal file-sharing environments.

The main idea behind Neuropentracker is simplicity. It does not try to be a complete torrent portal or a large public tracker. It only provides the basic tracker functions needed by BitTorrent clients, such as announce and scrape support

It is designed for small organization to reduce server load when sharing large files. Instead of every user downloading from one central server,

What it is not

It is not intended for large public torrent sites. It does not include advanced features such as user accounts, ratio tracking, moderation system, or full torrent management portal. Administrators still need to secure the server, database, and tracker configuration properly.

Parting words

Overall, Neuropentracker is a lightweight and practical BitTorrent tracker for small and controlled environments. It is best used when the requirement is simple peer tracking, not a full torrent community platform.