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

ascii doc generation #26304

Closed
wants to merge 1 commit into from
Closed

Conversation

GuillaumeGomez
Copy link
Member

This is part of #25033. The goal is here to generate full ascii (with console colors).

It's just a start so source code is very ugly (a lot of commented code and stuff...). I'll try to make a better looking code (colors have been radomly set for now) and add the usage of the libterm instead of static strings.

I'll comment when this PR will be ready.

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

Wow, this is quite the PR! I feel like this isn't quite the route we want to take, however, as there is a huge amount of duplication between the HTML generation and the ascii generation. If we want to go this route I think we'll want some layer of abstraction to have the same core layer generating documentation and then the backend can be HTML or ascii.

That being said, could you elaborate on the rationale for this change? I'm not sure what the use case is here and I was unaware that we wanted to add additional backends to rustdoc at this time.

@GuillaumeGomez
Copy link
Member Author

My goal for now is to provide a terminal highlighter which can be used in rustc --explain (I opened a PR for it which will be updated when this one will be merged). But why not also highlighting source code displayed by the compiler when it hits an error. I think that might be a very big improvement (I really like highlighting).

This PR is very incomplete for the moment. I wanna provide a common trait for both Html and Ascii to avoid code duplication when possible. I also need to make highlighting consistent and homogenous (and use libterm for it).

@alexcrichton
Copy link
Member

Hm ok, it looks like there's some significant work to do here, so in the interest of keeping the queue clean would you be ok closing this until it's more fleshed out? I'm not 100% sure that we want a terminal backend to rustdoc right now (there's a lot of UI questions I might have), but I think it'd be worth fleshing it out a bit more before going to a PR.

@GuillaumeGomez
Copy link
Member Author

I opened it to have opinions and allow people to keep an eye on it. So if you prefer to close it, please do !

@alexcrichton
Copy link
Member

Ok, in that case I'll close this for now.

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.

4 participants