doc-reader
A keyboard-driven HTML reader for Markdown documents, with jumps into the Neovim instances you are editing them in. Markdown stays the only source: the server renders it on every request, and the page follows edits live.
- Nested, foldable sections (
zMto an outline,lto drill in), Vim keys. - Math (KaTeX), Mermaid diagrams, SVG/PNG figures, tables.
nmoves every running Neovim that has the file to the section you are reading;nvimdopens it when none has.qcopies a question prompt for a coding agent;ycopies a link.<leader>hin Neovim prints the reader URL of the section under the cursor.
Install
pip install nvim-doc-reader
docread serve
Requires Python 3.9+ and, for the editor features, Neovim 0.9+.
Configure
$XDG_CONFIG_HOME/doc-reader/config.toml (or $DOCREADER_CONFIG):
# Optional, with their defaults.
bind = "0.0.0.0"
port = 8765
public_url = "http://desknikos:8765" # what `docread url` prints; default http://localhost:<port>
nvim = "nvim"
# nvim_socket_glob: default is where Neovim puts its own socket
# ($XDG_RUNTIME_DIR/nvim.*.0, else $TMPDIR/nvim.<user>/*/nvim.*.0)
state_file = "$XDG_STATE_HOME/doc-reader/last"
poll_interval_s = 0.5
# Which directories are served, by name. The name is part of the URL:
# /efs/nikos/notes/a.md -> /v/nikos/notes/a.md
# Default: the home directory, as "home".
[roots]
nikos = "/efs/nikos"
Every scalar key can be overridden with DOCREADER_<KEY>, and the roots with
DOCREADER_ROOTS=name=/dir:name=/dir. Nested roots are fine: a file belongs to
the most specific one, and any other URL for it redirects there.
Only files under a root are served. Raw files are served with
Content-Security-Policy: sandbox, and raw HTML in Markdown is shown as text.
There is no authentication: run it on a trusted network.
Keys
| key | action |
|---|---|
j / k |
next / previous heading |
h / l |
collapse or go to parent / expand or go to first child |
za zo zc zO zC |
toggle / open / close / open all inside / close all inside |
zM / zR |
close all / open all |
gg / G, Ctrl-d / Ctrl-u |
top / bottom, half page |
Tab, Enter |
focus and follow links |
n |
open in Neovim |
q |
copy a question prompt |
y |
copy the section's link |
o |
show / hide the outline |
? |
help |
Neovim
n needs nothing in the editor: every Neovim listens on its own socket, and
the server finds them by nvim_socket_glob. Windows showing the file move to
the section; a buffer that is loaded but hidden moves when you next switch to
it. nvimd with no arguments opens the last target; with arguments it is
plain nvim.
For <leader>h:
vim.opt.rtp:append(vim.fn.trim(vim.fn.system({ "docread", "nvim-path" })))
require("doc_reader").setup({ cmd = { "docread" }, keymap = "<leader>h" })
Section IDs
A heading's ID is its explicit {#id} if it has one, otherwise GitHub's slug
of its text, with -1, -2 for repeats. Give a section an explicit ID when
links to it must survive a rename.
Agents
Documents written by coding agents read best when they follow a few rules:
stable {#id}s, short overviews with depth in nested subsections, figures
kept with their source, no fabricated data, and questions answered without
editing. The rules ship as a Claude Code skill:
docread install-skill # -> ~/.claude/skills/doc-authoring/
docread install-skill --dir .claude/skills # or per project
Then tell agents to use it, in your global ~/.claude/CLAUDE.md (or a
project's CLAUDE.md):
## Writing Documents
Markdown documents you write for the user (research notes, reports, plans,
explainers) follow the `doc-authoring` skill — load it before creating or
editing one.
Other agents: if they read SKILL.md skills, point --dir at their skills
directory; otherwise paste the skill's body into AGENTS.md / GEMINI.md.
Metadata
Release files for nvim-doc-reader 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nvim_doc_reader-0.1.1.tar.gz | 36.5 kB | Without provenance | Details for nvim_doc_reader-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nvim_doc_reader-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nvim_doc_reader-0.1.1-py3-none-any.whl |
Total release size: 67.6 kB
Release files / nvim_doc_reader-0.1.1.tar.gz
| Download URL | nvim_doc_reader-0.1.1.tar.gz |
|---|---|
| Size | 36.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7694aa34fedc007235b6dcb8fa2b0de48b701c4cdcf80c006fcb7b4c74608960
|
|
BLAKE2b-256 checksum How to use checksums |
29bdf6aaee73f8abc90c6fc93986d49a2aafc2163b947d6f559dc08c4dbf9b3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.8
|
Release files / nvim_doc_reader-0.1.1-py3-none-any.whl
| Download URL | nvim_doc_reader-0.1.1-py3-none-any.whl |
|---|---|
| Size | 31.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
406a7b6bcc4791b0796e754852a4b90697519c93cec69169c4abcd81a6c09443
|
|
BLAKE2b-256 checksum How to use checksums |
ed7ed24b13ff8c903bccfe0cc01f9d06eabd065e5c85434f77307bd5b6d257be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.8
|
Security for nvim-doc-reader 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.