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 #272
Comments
I have some time on my hands I could use to start documenting BitcoinJS if it would help. What do you want it documented with? JSDoc? |
I'm not sure how much value using JSDoc would give to this repository. I think examples would be more beneficial at this point, because JSDoc is really only going to provide descriptions and type annotations, which we are often enforcing through Perhaps we can have a few users pipe in here what they feel would be the most beneficial? @williamcotton @thallium205 @juliustayl @weilu thoughts? |
Yeah, you're right, the function names in BitcoinJS are generally self-explanatory. As a developer I've almost always found examples useful for learning a new library. I look forward to seeing some thoughts on this so I can help out a bit! |
We should definitely start collating some more examples here, and ideally get some input on what people would find the most helpful. Right now, our README has the following examples:
I think we could do with some more examples around:
edit: I also see no reason why these examples couldn't all become integration tests in the test/integration folder. |
Should the examples be in an examples/ folder and in the test/integration folder? Or should they be added on to the end of README.md? Or should they only be in the test/integration folder? |
I'll be happy to contribute to the OP_RETURN related tests and examples but I won't have any time until sometime next week. |
As discussed on IRC, I think the most useful thing from you guys would be mini-examples of how to do things. Then put those examples in the integration tests section. Unit tests almost but don't quite cut it because they have full access to internal APIs that external consumers won't do, and you can run into odd issues like a client doing require('ecurve') themselves and finding they can't pass it into bitcoinjs - yes that is by design but it is not obvious. One mini example that is obvious in bitcoinjs-lib 0.13 but not obvious is from Brainwallet var hash_str = pad($scope.hash, 64, '0'); // A padded hex string from input to create a key from |
Started adding these tests in the inttest branch. |
With the addition of example-like integration tests in #302, and links to them from the README. Did we have any priorities on what we wanted to document from here? |
Thoughts on an inline documentation format? |
"inline" as in a folder named "docs" or something like that right? You don't mean "inline" as in line with the code a la JSDocs, right? |
@jprichardson either or. I'd want the documentation to be as deterministic as possible, and not something we have to keep in sync. |
I'm of the school of mind that that's what it takes to produce quality software, however, I don't see any reason why this couldn't be automated to some degree. I really despise inline documentation (inline with the code/ like JSDocs) as it really bloats source files. I wouldn't mind Flow comment annotations as that's at least useful and it would improve the quality of the software. I don't have any problem or issue with documenting tests though. I have some thoughts on a building a tool to automate the process of building documentation. The number one principle of the tool would be that tests serve as the ultimate source of documentation, however expecting users of the library to dig into the test files is unreasonable. The main requirement of this tool would be to have a 'standard' sort of way to layout test files. Would changing the layout/renaming test files be something that you're opposed to? |
Agreed, but it can still be simpler than maintaining external documentation IMHO.
There only a few cases, namely around more complex classes such as
What did you have in mind? This sounds intriguing, but, I'd rather not re-write our entire testing infrastructure for something experimental (both technically and socially). |
@dcousens @jprichardson |
@bhollan did you have any ideas on how we could move forward? |
@dcousens I sent an e-mail to @jprichardson to discuss his idea, but haven't heard back yet. We can discuss here if it would be better. Your response to his idea seemed favorable enough I assumed it was moving forward. I also like the loaclized examples on bootstrap. http://getbootstrap.com/css/ I was thinking like a bitcoinjs.org/docs or /examples or something. I think it should be something that gets built from the test source code with every official release. Just some thoughts. |
How about whoever actually makes a PR gets to decide which doc format we use? ;) I'm happy to live with any inline doc format. Any doc is better than no doc. |
Agreed with @weilu. I'm happy to maintain it, but haven't got the time to spend researching the initial infrastructure at this time. |
Just a stub issue, but we really need to start focusing on this.
The text was updated successfully, but these errors were encountered: