How to fix the Unbound module Graphics in an ocaml project

Image
From ~/pr/gitl/ocaml-gol In a constant effort to learn new programming languages, I'm currently trying to use ocaml , a free and open-source general-purpose, multi-paradigm programming language maintained at the Inria . It's basically an extension of Caml with object-oriented features. I'm mostly interested by its functionnal and pattern matching features but the module part of the language can be a bit difficult to understand for someone with little to none ML (Meta Language) background.   The error When trying to use the graphics module to create a graphical window and go just a little further than the simplest helloworld program, here is the result : If the project uses dune : (executable (name ocaml_project) (libraries lwt.unix graphics) ) with this code : let () = Printf.printf "Hello, world!\n";; Lwt_io.printf "Hello, world!\n";; Graphics.open_graph " 800x600";; The first times I built this project running the du...

Adding a screenshot in a github's README.md

Today's work is about a ruby project hosted at github.comtodo-summarizer, a tool I use to compute weekly statistics on my development tree, and the task is to enhance project documentation.

The github-flavored markdown-based README is already quite explicit but it tends to show this tool only has a terminal output, but since todo-summarizer also offers a GTK-based GUI, I'd like to add some screenshots of the running application.



I quickly found this stackoverflow's answer and its relative URLs trick. In fact, as announced in this blog post, github supports relative links in markup files. So, if the screenshot is saved in a file called doc/screenshots/screenshot.png, you must add the following code to your README.md file :

![GTK screenShot](doc/screenshots/screenshot.png)

This way, it should work in forks, even if multiple branches contain different screenshots. You can see the final commit here.

Testing

You can easily test the result in HTML with the pandoc package using this command line :

pandoc README.md > test.html

If you need to install this package on arch

sudo pacman -S pandoc

Comments

Popular posts from this blog

How to make a map of variant in C++