Following a recent discussion on the Inline mailing list about accessing Perl variables directly from a C function, I've put together some sample code that I think would be appropriate to add into the Inline::C Cookbook. I've attached a file in plain text format that contains the full recipe.
Would it be possible to add this new recipe into the Cookbook, perhaps under the "Meat & Potatoes" chapter?
Hi Ron, this will probably be easier for the maintainers to process if you actually make a pull request with this?
Good job on the new cookbook entry! 👍
I agree with @mohawk2, you should make a pull request.
I've noticed that the Cookbook is in (.swim) format in the master branch. Sorry for asking these simple questions, but what is the (.swim) format and how do I convert it to (.pod) to ensure the formatting looks correct?
I'm assuming that I would have to add my new recipe into Cookbook.swim in order to create a pull request.
That's a great question! As I recall, you have to install Zilla::Dist and do (I think) zild dist to make a .pm file you could inspect.
If that proves troublesome, then just a best guess at the formatting (since the markup is very easy to cargo-cult from other sections) and a PR is still much easier to deal with.
Thanks for the suggestion @mohawk2
Another option is to install the Swim module. This module comes with a utility program called "swim" which can convert (.swim) format to (.pod) format as well as other formats. So, in my case, I use the following command:
swim --to=pod Cookbook.swim > Cookbook.pod
As part of your documentation update, can you please include the above info (at least) about the Swim module?
Hi @wbraswell ,
OK, that's fine. Do you think Swim together with the above command should be mentioned in an Appendix in the Cookbook?
There is not currently a CONTRIBUTING doc, but per @daoswald 's recommendation, you should go ahead and create one to contain your swim info.
I have now finished my updates to Cookbook.swim. Also, I'm happy to write up a CONTRIBUTING file as suggested by @daoswald . I'll use Inline's version of this file as a guide.
Thanks for all your suggestions.
I've now completed the CONTRIBUTING file. As I'm a little unsure with what I've written for this file, I've attached it to this post. If you could have a look at it that would be great. Let me know if it needs any further amendments or additions. Thank you.
Please add info about the IRC chat room to your CONTRIBUTING.txt file
Thank you @wbraswell for your suggestion.
I've added a section titled "IRC Chat Room" to the CONTRIBUTING file. I've also created a pull request now for updating the C-Cookbook.
i think this can be closed since the PR was applied
@perlpunk , yes, it's fine to close this issue. Regarding having a CONTRIBUTING file in the repo, do you want me to create a new issue for this? Since I wrote this file back in Jan, I'm happy to do that.
@rongrw yeah, that's probably a good idea.
Since Dist::Zilla is already generating a generic CONTRIBUTING file for CPAN, it shouldn't be a problem to put that file into the repo, along with distribution specific advice.
I'll try to talk to @ingydotnet later
OK @perlpunk that's fine. We can use the generated CONTRIBUTING file - I'll then add a section on Swim since it's not obvious how to edit the Inline::C Cookbook file.