Introducting the todoSummarizer's help viewer

Today's commit was about a help viewer for todoSummarizer. All this code resides in the lib/MainWindow.rb

Since this project uses GTK, I decided to use an external help viewer : yelp.

The project already have a texinfo manual, so it's all about generating HTML from info and pass the corrcet URI to yelp.

Generating HTML manual

To generate HTML from an info file you only need to run the following command :
makeinfo --html todoSummarizer.texinfo
It will create a new directory containing some HTML files.

Calling yelp from ruby

I also have some issues with Dir.pwd() so I didn't use it. Instead I used the __dir__ ruby function.

Appart for the error checking code, calling yelp from ruby is only three lines away :
yelp = find_executable("yelp")
uri = "file://#{dir.to_path}/../doc/todoSummarizer/index.html" { 
  cmd = system("#{yelp} #{uri}") 


You now have a great manual/help viewer for your GTK-based GUI application :
The todoSummarizer's help viewer


Popular posts from this blog

How to make a map of variant in C++