Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Consider using an already established HTML text renderer #72

Open
horta opened this issue Jan 24, 2024 · 3 comments
Open

Consider using an already established HTML text renderer #72

horta opened this issue Jan 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@horta
Copy link

horta commented Jan 24, 2024

The project https://github.com/toiletbril/dedoc uses rust library https://crates.io/crates/html2text which renders html very nicely in my terminal

Dedoc

vs

nvim-devdocs

Thank you for the plugin, btw!

@horta
Copy link
Author

horta commented Jan 25, 2024

I have used fzf with html2text to create a prototype for terminal only:

image

Command to replicate it:

# html files for C language
cd ~/.dedoc/docsets/c
find * -type f | fzf --preview '~/bin/html2text --colour --width $FZF_PREVIEW_COLUMNS {}'

where html2text binary was compiled from https://github.com/jugglerchris/rust-html2text/blob/main/examples/html2text.rs

@luckasRanarison luckasRanarison added the enhancement New feature or request label Jan 25, 2024
@luckasRanarison
Copy link
Owner

luckasRanarison commented Jan 25, 2024

Interesting, I think adding an option to save docs as HTML should be possible and the command system should work out of the box. There's one really tricky problem though, devdocs documentations are split into sections, one HTML file can contain multiple sections. The worst possible case is the Lua doc which is only one big HTML file. We'd still need to traverse all files using treesitter and split them when downloading, but that sounds interesting...
I'll try to add this soon :)

@luckasRanarison luckasRanarison pinned this issue Jan 25, 2024
@pedrohgmacedo
Copy link

pedrohgmacedo commented Mar 10, 2024

Another interesting alternative is pandoc. The vim plugin devdocs.vim has a lua pandoc writer that outputs vim help syntax.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants