Proposal for the improvement of the reference documentation

Been waiting for a change. My ideal doc interface would be to have a search box with suggestions, and then another more traditional link or list view. E.g. when we press the / key in GIMP. It would search not only the name but also the description. Right now we are given #@cli comments only. Maybe a new tag for description or keywords would help because I sometimes included other details that won’t be relevant for search.

I know I try to be funny most of the time but I am not sure Funny One-Liners is a good category in name and purpose.

I agree. I really want a way to have more influence over the documentation. I mean play with it to see what works and doesn’t. It will be a way to move this forward because I have lots of ideas. Giving us some mobility would help us think through this problem together and improve the docs even more in the future.

Sorry, but this is not something I know how to do. Apart from generating static HTML pages, everything else is beyond my knowledge in web programming.

When everything will be ‘ready’, I can write a short tutorial about how you can generate a web page for your command.

To be perfectly clear: I believe the whole website of G’MIC should be revamped :slight_smile:
Maybe it should be done before starting to generate new pages.

@patdavid and co could help. :wink: We have lots of talent here. :+1:

I agree. Have fun!?

1 Like

A search field that helps filter out possibilities, searches and highlights in both function name and function content… and tolerates typographic mistakes thanks to levenshtein distance. Results would be command name + command description first letters.

This is showcased here: https://www.youtube.com/watch?v=iyj-Nyde-G4&feature=youtu.be

Sphinx (the doc generator for gmic-py) does some JS-based indexing and searching without any database instance up and I have seen in the past JS-levenshtein matchers already… For Ctrl+F is OK but it does not search in descriptions and does not tolerate mistakes…

Old blog post on top JS fuzzy search libraries: 10 Awesome Javascript Fuzzy Search Libraries – Bashooka
I could find one for you if you miss time

I like these grids. Alongside the old reference it’s pretty nice to have them broken down into categories, and I can find a few things I haven’t seen before…

Here is a small tutorial on how to generate the new (WIP) reference pages, for testing.
This requires several steps. The instructions below should work for any Linux distribution, as well as MSYS2 for Windows users.
The CLI tool gmic of G’MIC is used to generate the pages, so make sure it is already installed and available from your executable PATH.

  1. Clone the git repo of the G’MIC project and activate the develop branch.
$ https://github.com/dtschump/gmic.git
$ cd gmic
$ git checkout develop
  1. Go to the html folder, and create an empty test directory where all the generated files will be put.
$ cd gmic/html
$ mkdir test_ref
$ cd test_ref
  1. Generate all the images for the reference documentation (beware, this takes some time!).
$ mkdir img
$ cd img  # Go to 'gmic/html/test_ref/img/'
$ gmic up parse_cli images
  1. Generate the HTML files of the documentation (one file per command).
$ cd ..   # Go back to 'gmic/html/test_ref/'
$ gmic parse_cli html
  1. Open your web browser, and go to URL : file://PATH_TO_GMIC/gmic/html/test_ref/categories.html.

You should be able then to browse the doc.
Note that this is still work in progress. Any feedback welcome. I’ve recently learnt how CSS works, and I’ve not used it a lot in the doc. This is gonna be improved in the future.

1 Like

Works quite well, thank you.

Just a minor remark: for long custom function names word wrap and two liner boxes would be good for the overview.

I’ve made good progress on the doc generation today. I uploaded an updated version.

https://gmic.eu/reference2

Nice progress, with word-wrap etc.

Still there is in my build of the links one ‘html’ to much:

file:///Users/karo/sw/gmic/html/test_ref/animate3d.html.html#top

You’ll have to update the stdlib in one hour or so to fix this :slight_smile:

To make it fun, let the user choose from a set of input images or integrate a simpler version of G’MIC online.

My priorities right now:

  • Finalize the structure of the HTML reference documentation, and put it on the website to replace the older one.
  • Do the same for the .pdf version (which means I have to write a parse_cli_latex command, quite a pain).
  • At this point, I’ll be able to remove the document_gmic command that won’t be used anymore.
  • Write a post about the difference between stylize and fx_stylize for @lesolorzanov.
  • Then I’ll be able to start writing more detailed stuffs about the commands in the reference documentation.

Note that these are priorities concerning G’MIC, but I have of course other things that are inserted into this list, about my research work, the management of my research team, things to do for home and kids (xmas presents…). Sometimes I feel G’MIC is eating too much of my time.

1 Like

Sometimes? :joy_cat:
I can be lost in the moment as well.

Just had a look into the new documentation: really good, much better for me to find things!

Just one minor correction

Instead of “var$i” I would write “vari” or “var{i}”. One could read “var$i” is named “var[parameter i string]”.

About the doc: I’ve been working on it intensively the last days, and I think the improvements are really great. G’MIC has now its own light Markdown syntax that is used in the reference documentation and command description. It’s not as complete as the reference markdown, but at least it is entirely managed by G’MIC itself, so I don’t need external dependencies to generate the G’MIC documentation.
Hopefully, I’ll share more news when it’s ready.

1 Like

Some news:

The new reference documentation of G’MIC is now ready and online : G'MIC - GREYC's Magic for Image Computing: A Full-Featured Open-Source Framework for Image Processing - Table of Contents
The .pdf version is missing, but I’ll try to generate it directly from the HTML pages in the future (rather than generating first a LaTeX output as I did before. I’ll see…).

At this point, if you want to contribute to improve the content of the documentation, you are welcome to do so :slight_smile:
I’ve set up a markdown-like syntax in the G’MIC documentation generator, which can be used to decorate the description of the commands. This G’MIC markdown (a.k.a gmd) recognize the following patterns :

  • __words in italic__ \rightarrow words in italic
  • **words in bold** \rightarrow words in bold
  • `words in bold monospace` \rightarrow words in bold monospace (should be used for highlighting values or choices for arguments).
  • single_word_in_monospace' \rightarrow single_word_in_monospace (should be used for highlighting variable and command names).
  • ''reference to page or command'' \rightarrow auto-link to URL describing the page or command (useful for the See also: subsections).
  • ~~~code block~~~ \rightarrow
code block
  • ^^ Image URL ^^ \rightarrow display image in a centered block.
  • { list of values } \rightarrow highlight the list of values.
  • http[s]://address.url \rightarrow highlight and make a clickable link.
  • # Section name \rightarrow Start a new section.
  • ## Subsection name \rightarrow Start a new subsection.
  • ### Subsubsection name \rightarrow Start a new sub-subsection.
  • * Item of a list \rightarrow Display item as a list item.
  • - Item of a sub-list \rightarrow DIsplay item as a sub-list item.
  • . Item of a sub-sub-list \rightarrow Display item as a sub-sub-list item.

For now, there are not other syntax recognized, but I think this is already enough to make the reference documentation better looking than before. Maybe I’ll add other gmd-rules in the future, if there are needs for new stuffs.

I’m now planning to implement a gmd->ascii converter, to allow G’MIC displaying the gmd-formatted text on the console (when using the CLI tool gmic). The gmd->html command is already used for generating the HTML doc.

That’s all for now. As always, Feedback appreciated!

1 Like

If you need help generating PDF from HTML, ping me, we are doing exactly that for the new darktable docs.

1 Like

congratulations!!!