Skip to content

Deprecate w3m for viewing readme and add mdview.py instead#599

Open
EnigmaCurry wants to merge 3 commits into
masterfrom
mdview
Open

Deprecate w3m for viewing readme and add mdview.py instead#599
EnigmaCurry wants to merge 3 commits into
masterfrom
mdview

Conversation

@EnigmaCurry

@EnigmaCurry EnigmaCurry commented Feb 4, 2026

Copy link
Copy Markdown
Owner

Fixes #598

If the browser is not resolved to a system browser like firefox, then this script will fallback to using mdview.py which requires that the user has installed the uv dependency, which was previously added to the docs as a required dependency.

@EnigmaCurry EnigmaCurry marked this pull request as ready for review February 4, 2026 19:26
@EnigmaCurry EnigmaCurry requested a review from mcmikemn February 4, 2026 19:26

@mcmikemn mcmikemn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me for root: ...enigmacurry/d.rymcg.tech/ $ make readme
But it doesn't work for service readmes: $ d make whoami readme or ...enigmacurry/d.rymcg.tech/whoami $ make readme

@mcmikemn

mcmikemn commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

Also, certainly not a requirement, but a pager option would be nice.

@EnigmaCurry

Copy link
Copy Markdown
Owner Author

Yes I forgot about those other calls.

It is supposed to have a pager, if you're not seeing it, its a bug.

@EnigmaCurry

Copy link
Copy Markdown
Owner Author

oh on nix, for whatever reason, I had set PAGER=cat which disabled the pager. after unsetting it I saw the pager.

@EnigmaCurry

Copy link
Copy Markdown
Owner Author

a regression of mdview.py from using w3m: none of the links are hyperlinks.

@mcmikemn

Copy link
Copy Markdown
Collaborator

This works for me for main and project READMEs, but it only works in VTERM in Emacs. When I try it in an ssh session, I see the ANSI escape codes:

ESC[1;4mOllamaESC[0m

ESC[4;34mOllamaESC[0m is a local LLM runtime/engine that lets you run and interact with language models via simple API endpoints.

ESC[4;35mConfigESC[0m

ESC[48;5;235m                                                                                                                                                                                         
ESC[0mESC[48;5;235m ESC[0mESC[38;5;231;48;5;235mmake configESC[0mESC[48;5;235m                                                                                                                                                                                         ESC[0mESC[48;5;235m ESC[0m
ESC[48;5;235m                                                                                                                                                                                         
ESC[0m
This will ask you to enter the domain name to use. It automatically saves your responses into the configuration file ESC[1;36;40m.env_{DOCKER_CONTEXT}_{INSTANCE}ESC[0m.

Edit the ESC[1;36;40mOLLAMA_CONTEXT_LENGTHESC[0m variable to set the default context length for models you load. (The default is ESC[1;36;40m4096ESC[0m which is set conservatively low.)

ESC[1;35mAuthentication and AuthorizationESC[0m

You may add an API token to secure your service by setting ESC[1;36;40mOLLAMA_API_TOKENESC[0m in the ESC[1;36;40m.env_{CONTEXT}_{INSTANCE}ESC[0m file.

See ESC[4;34mAUTH.mdESC[0m for information on adding external authentication on top of your app.

ESC[4;35mInstallESC[0m

ESC[48;5;235m                                                                                                                                                                                         
ESC[0mESC[48;5;235m ESC[0mESC[38;5;231;48;5;235mmake installESC[0mESC[48;5;235m                                                                                                                                                                                        ESC[0mESC[48;5;235m ESC[0m
ESC[48;5;235m                                                                                                                                                                                         
ESC[0m
ESC[4;35mUsing OllamaESC[0m

There is no web frontend to Ollama. You use it via its REST API. You can ESC[1;36;40mmake shellESC[0m to enter a shell in the Ollama container and use it via its CLI (ESC[4;34mhere is a CLIESC[0mESC[4;34m ESC[0mESC[4;34mreferenceESC[0m), or you can use it via API calls (ESC[4;34mhere is the APIESC[0mESC[4;34m ESC[0mESC[4;34mdocumentationESC[0m).

ESC[4;35mDestroyESC[0m

ESC[48;5;235m                                                                                                                                                                                         
ESC[0mESC[48;5;235m ESC[0mESC[38;5;231;48;5;235mmake destroyESC[0mESC[48;5;235m                                                                                                                                                                                        ESC[0mESC[48;5;235m ESC[0m
ESC[48;5;235m                                                                                                                                                                                         
ESC[0m
This completely removes the container and deletes all its volumes.

In the same ssh session I can use a different tool (glow) to view the same README and it displays the formatting fine.

@EnigmaCurry

Copy link
Copy Markdown
Owner Author

Does glow let you follow links?

@mcmikemn

Copy link
Copy Markdown
Collaborator

Possible replacement for mdview.py? elinks

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable the use of w3m for viewing READMEs

2 participants