Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation hosting #31

Open
MarcAntoine-Arnaud opened this issue Sep 18, 2020 · 7 comments
Open

Documentation hosting #31

MarcAntoine-Arnaud opened this issue Sep 18, 2020 · 7 comments

Comments

@MarcAntoine-Arnaud
Copy link

Hello again,

It's more a question, but can be a great feature ...
Do you think meuse can generate and host the Rust documentation of projects ?

Marc-Antoine

@mcorbin
Copy link
Owner

mcorbin commented Sep 18, 2020

Hello,

When you say documentation you mean the doc generated by tools like rustdoc ?

@MarcAntoine-Arnaud
Copy link
Author

Yes ☺️

@mcorbin
Copy link
Owner

mcorbin commented Sep 20, 2020

It's not easy to do because if I'm not wrong Meuse would have to:

  • Clone the project repository (and so be allowed to do it)
  • Run "cargo doc" (so the cargo binary should be available)
  • Upload the doc

@synek317
Copy link

Hello, @mcorbin are you sure this is the case?

I think that Meuse already has the required access in its crate storage - the file stored there is just a tar.gz archive that can be extracted. Cargo dependency is a bit less fortunate but still, it could be optional.

To be honest, I don't think meuse should serve documentation, but still this way it could extract and render README.md if present. What do you think?

@mcorbin
Copy link
Owner

mcorbin commented Jan 16, 2021

To be honest, I don't think meuse should serve documentation, but still this way it could extract and render README.md if present. What do you think?

The README content is actually available in the metadata passed alongside the crate when it is published, I just do nothing with it today.
I could extract it, save it in the Meuse DB, and them serve it in the frontend/the api.

@synek317
Copy link

Do you think it could be a nice issue for a new contributor, like me for example?

@mcorbin
Copy link
Owner

mcorbin commented Jan 18, 2021

Do you think it could be a nice issue for a new contributor, like me for example?

I think so.

I reread the code, and the README is actually already stored in the DB.
I forgot about that, but I already save all the metadata provided by "cargo publish" in the database, in a jsonb field (https://github.com/mcorbin/meuse/blob/master/resources/migrations/002-crate-metadata.up.sql).

These metadata are already retrieved and available to be used in the frontend. It's how we show the crates dependencies in the frontend today: https://github.com/mcorbin/meuse/blob/master/src/meuse/front/pages/crate.clj#L120

adding an html block containing the readme if defined (which is stored into the metadata in the :readme key) should be easy, we just have to find the right js lib to render the markdown to html (it could also be nice to have access to the raw markdown if needed).

Btw, I'm not a frontend developer so at some point I would like to find some dev specialized in frontend work to rewrite the Meuse frontend from scratch ;)

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

No branches or pull requests

3 participants