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

Make documentation for old versions available #178

Open
hiredgunhouse opened this issue Oct 28, 2018 · 7 comments
Open

Make documentation for old versions available #178

hiredgunhouse opened this issue Oct 28, 2018 · 7 comments

Comments

@hiredgunhouse
Copy link

For a library like Chai I think it is very important to have the docs for old versions available online.
Having docs for the latest version only is problematic for people who are on projects using some older version because new APIs are not available to us and we can only learn that by trial and error.

@keithamus
Copy link
Member

Hey @hiredgunhouse thanks for the issue.

I agree with this. It would indeed be great. Right now the docs are generated from the source code, you can see in the https://github.com/chaijs/chaijs.github.io/ repo there is a Makefile which has an api-docs task which does this: https://github.com/chaijs/chaijs.github.io/blob/master/Makefile#L16.

It would take some work but I think it is do-able to have the Makefile generate multiple datasets from different versions, then re-architect the site docs to point to a specific version.

If you have the time to make a PR I'd love to see what you come up with, and I'm also happy to help where I can.

@yuki-93
Copy link

yuki-93 commented Oct 30, 2018

Maybe it would be nice to show for each api assertion, from which minimum version it is available in chai. Just my two cents, if this might be easier to implement.

@keithamus
Copy link
Member

Supporting a "version introduced at" piece of meta is also possible - but we could add this as an annotation to the doc blocks in the code comments. It'd be less difficult to implement overall but would probably be more work going through every method in the codebase and figuring out when it was available.

There's one subtle problem with just documenting when a method was introduced: often methods are removed, or change - this is more complex than just availability. For example some assertions only used to accept numbers but now accept dates as well - how can this be articulated?

@hiredgunhouse
Copy link
Author

Hey @keithamus, sounds good, I'll give this a shot and try to make a PR.
I'll start with generating docs for multiple versions and then think about the tracking of when specific API has been introduced, which, as you pointed out, is a bit more complex subject.
BTW. Please have some patience as for the next 2 weeks I'll be busy with some other work.

@keithamus
Copy link
Member

@hiredgunhouse thanks for picking this up! Let me know if you need any assistance with this. I'll try my best to offer advice where I can 😄

@keithamus keithamus transferred this issue from chaijs/chai Nov 1, 2018
@hiredgunhouse
Copy link
Author

@keithamus a quick update: I'm slowly working through this, please be patient.

@harrytruong
Copy link

Thanks @hiredgunhouse for looking into this!


Workaround (for future people trying to find older API docs):

The API docs are being generated from comments in the source code. It's not pretty, but if you search through this file, you might find what you were looking for:

https://github.com/chaijs/chai/blob/3.5.0/lib/chai/core/assertions.js

Select your release version through the github "tags"

screen shot 2019-02-19 at 5 38 44 pm

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

4 participants