anycable / uptriever

A CLI to upload documentation chunks to Trieve
MIT License
3 stars 0 forks source link

Support for .mdx files #1

Open pranay01 opened 3 months ago

pranay01 commented 3 months ago

Does uptriever not support .mdx files?

Seeing the following issue when I try to run on our docs:


Unsupported file type: /Users/pranay/code/signoz-web/data/docs/alerts-management/exceptions-based-alerts.mdx
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/document.rb:26:in `to_html'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/document.rb:32:in `to_chunk_json'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/cli.rb:44:in `block in run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/cli.rb:44:in `each'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/cli.rb:44:in `flat_map'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/lib/uptriever/cli.rb:44:in `run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/uptriever-0.1.1/bin/uptriever:7:in `<top (required)>'
/opt/homebrew/lib/ruby/gems/3.3.0/bin/uptriever:25:in `load'
/opt/homebrew/lib/ruby/gems/3.3.0/bin/uptriever:25:in `<main>'
palkan commented 3 months ago

Not yet (though that's sounds like an interesting and challenging task).

It doesn't seem that's converting MDX to HTML is a simple task even from Node (looking at this issue and another one).

I think, for now the quickest solution would be to write a custom JS script to convert .mdx files to .html and then run uptriever (and add **/*.mdx to the ignore list).

If you know how to write a generic mdx2html.js script, we would be happy to embed it into uptriever 🙂