How to read and copy code from markdown files on your phone
Code in markdown is written between triple backticks:
```python
def greet(name):
return f"Hello, {name}!"
```
On a phone, code is where plain text apps fail worst. Lines wrap in the middle, indentation gets lost (which breaks Python and YAML), there's no highlighting, and selecting exactly the right text to copy is fiddly.
What you want from a code viewer on a phone
- No wrapping. Long lines scroll sideways, so indentation stays intact.
- Syntax highlighting for the language in the code fence (
python,js,bash…). - A copy button that copies exactly the code block, without extra spaces or the backticks.
- Monospace font so columns line up.
Code blocks in MD Reader
MD Reader shows every fenced code block with syntax highlighting, horizontal scrolling and a Copy button in its header.
- Open a
.mdfile, a README, or paste an AI answer with Paste from clipboard. - Swipe sideways on long lines.
- Tap Copy on a block. You'll see Copied ✓.
Common uses
- Install commands from a README. Copy them into a terminal app such as Termux, or send them to your computer. See reading README.md on Android.
- Code from AI answers. ChatGPT and Claude put code in fenced blocks. Paste the answer into MD Reader to read it properly and copy one block at a time. See reading ChatGPT answers formatted.
- Config snippets (YAML, JSON) where indentation matters.
- Diffs. A
diffblock highlights added and removed lines.
Tips
- If code shows without colors, the code fence may be missing its language name.
```pythonhighlights, a bare```doesn't. - Turn the phone sideways or set Page width → Wide for long lines. See reading settings.
mermaidblocks are drawn as diagrams instead of code. See Mermaid on Android.