Skip to content

Instantly share code, notes, and snippets.

@Fartomy
Created January 31, 2026 11:57
Show Gist options
  • Select an option

  • Save Fartomy/1939ea1d1822ed50805a949881d910c5 to your computer and use it in GitHub Desktop.

Select an option

Save Fartomy/1939ea1d1822ed50805a949881d910c5 to your computer and use it in GitHub Desktop.
Converting the .md File Into a Single Document

🧩 Converting the .md File Into a Single Document

The Pandoc software tool can be used to create a new document that combines all the images, videos, and other content within an .md file into a single unified document. In this way, Pandoc can find images in directories such as <img src="mats/imgs/welder.gif" align="right" height="400"> or ![image](mats/imgs/welder.gif), which are relative paths within the .md file, embed them into the document, and create a new document within a single document.

Warning

For example, in order for Pandoc to embed images or other components into the newly created document, the directory location, name, and organization must be the same as specified in the relative paths in the README.md file.

Example

  1. Install Pandoc into your Linux system
sudo apt install pandoc
  1. Install your Github repo and go to in it
  2. Ensure your README.md file here with its materials (images, gifs, videos etc.) in the directory
  3. Use pandoc command like that;
pandoc README.md -o output.html \
                    --from gfm \
                    --self-contained \
                    --standalone \
                    --metadata title="My New Document"
  1. Like this, you convert your README.md file to output.html

Note

The --from gfm parameter indicates that the file to be converted is in GitHub Markdown format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment