New feautres
Here I am another week! This week I have improving a lot of aspects of Perl6::Documentable:
Now it has a very useful
update
option to only regenerate the HTML documents coming from pod6 files that have been actually modified. This is a characteristic in the documentation's wishlist. Before this feature, if you wanted to see a change in the HTML you had to regenerate everything, what takes 2:30' approximately, plus processing the pod collection again. Now, with the cache and update option, it only takes around 10 seconds to see a change (and half of that time is spent is reprocessing the collection).I have also made some little refactoring to distribute the responsibilities in a better way. In addition, you will find a new
setup
option. The aim of this feature is to initialize the directory where the documentation will be generated. What needs to be setup? Nothing, really, but if you want your freshly generated documentation to have an style sheet, search capabilities, etc., you need to download the necessary files or provide ones yourself.Some minor bug fixes like: leading whitespaces files or the correct detection of subkinds.
CI testing! This is an important change because I made a terrible mistake! I did not test if the module actually could be installed, and it could not! Thanks to @ugexe for noticing this and tell me. I do not know if you remember Perl6::LinkHealth and the mini-doc repository, but they have also been integrated in this CI testing so now almost everything is covered :D.
And that's all the work I have made this week, if you want me to introduce whatever new feature you find interesting or useful, just tell me!
Next steps
Mmm, what should I do next? Perl6::Documentable is in a good state right now, so I will continue fixing bugs and make general improvements.
Nonetheless, I also want to start the work with Pod::To::HTML and Pod::To::BigPage. What needs to be done? Well, currently indexing is made in three different ways so it would be nice if we unify them into one. Moreover, the last two modules use different ways to convert a pod file into html, so it does not make a lot of sense to have duplicated logic. I may even create only one module joining both functionalities. I still do not know, I still have to discuss this with my mentors!
Perl6 curiosity
I have been thinking these weeks that write an article telling what I have done in a specific week is not that funny, so I will tell you about some characteristic of Perl6 that I have found useful and interesting.
Today: CLI! This week, I have had to add different options to the CLI version of Perl6::Documentable, and I thought this would be a little tedious, but I could not be more mistaken! As always, Perl6 makes your life easier and provides you with a very simple way of doing it.
Suppose you want to create your own CLI program, for instance, one that reproduces the zef
command. First you should create a new file containing that functionality, let's call it Perl6::Zef
. Now you need to create a new file where you will read the arguments the user has specified, Perl6::Zef::CLI
.
This new file would be something like this:
Oh, what a weird code!. It really is not that weird, we only define "the skeleton" of the MAIN
function (this function is called every time a file is executed) because it will have several different definitions.
After that, we simply specify two definitions of MAIN
, but wait, you have written install
and update
as arguments, is that correct? YEP, in Perl6 this compiles and works. This is an amazing feature because it gives you the possibility to deal with the cases you need in an easy way.
I have also written #|
and #=
. These two are called declarator blocks. What does this kind of comment? The comment you write after that is attached to the source code below it. Why this is useful? Because, for instance, with those comments, you do not need to specify a --help
option or something alike, because if you try to use this module with incorrect arguments, perl6
will tell you this:
$ > perl6 zef.pm6
Usage:
zef.pm6 [--name=<install>] -- Install a new package
zef.pm6 [--name=<update>] -- Updates a package
--name=<install> Name of the package to install
--name=<update> Name of the package to update
~~~
![simply perl6](https://i.pinimg.com/originals/7b/4f/6a/7b4f6a993a37feba36efd20910d03920.jpg)
I know, quite handy, isn't it? :D.
Summing up, I hope you try give a change to Perl6 because it has a lot of incredible characteristics!
See you next Monday :DDD.
Top comments (4)
Hey, well done on planning and documenting your work like this week by week - do you publish it on your own blog too so you know you'll have it forever?
For that matter, if you're interested in Python, computer games and graphics, programming in general and much more besides, maybe come over to irc one day and talk to me directly in #ossasepia as you might find some projects to get involved in and learn as you go.
Hi! Unfortunately I still do not have my own blog. Nonetheless, I plan to make one on GitHub Pages. I will publish there my posts about #gsoc and #perl6 and some conferences and talk I have made.
As for Python, I have tried it and I really like it! I do not know a lot about graphics though, but I am willing to learn :D. I am kind of busy at this moment, but I will give a try it in the future.
Thanks for stopping by :D.
Hey, you may consider linking your articles together into a series. Just include this line in the frontmatter of each article (below
tags:
)Thanks for the tip! :D