Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers. Note that due to large amounts of spam attempts, your first three posts will be manually moderated, so please be patient.
We have moved to a new forum at http://jevois.usc.edu, please check it out. The forum at jevois.org/qa will not allow new user registrations but is maintained alive for its useful past questions and answers.
Welcome to JeVois Tech Zone, where you can ask questions and receive answers from other members of the community.

How do you create the content that goes into the "Info" tab in JeVois Intentor?

+1 vote
When we use a custom built code module, we want to have a lot of information about it available on the "Info" tab in JeVois Inventor. I can see that the info for this tab resides in a "modinfo.html" file in the same folder as the script, but even if I copy the file from another module into our custom script's folder, nothing shows up on the Info tab. So, are there any documents available on the proper creation of this modinfo.html file?
asked Jul 11, 2018 in Programmer Questions by Billbo911 (1,110 points)

1 Answer

0 votes

Yes, unfortunately this is quite a mess right now. The modinfo.html files are created from source code using jevois/scripts/jevois-modinfo (a very nasty perl script). Then the inventor looks for specific html separators in that modinfo to parse out the different sections. We will post the inventor's source as soon as we can to github, in the meantime, here is the logic used:

the variable 'mi' contains the loaded modinfo.html file, one list entry per line in the file

extractstring(str, beg, end) extracts from str what is between beg and end, or returns an empty string if either separator was not found.

void JeVoisInventor::modInfoUpdate(QStringList const & mi)
{
  QStringList sl;
  int state = 0;
  
  for (QString const & s : mi)
    switch (state)
    {
    case 0: // Looking for module display name
    {
      QString const str = extractString(s, "<td class=modinfoname>", "</td>");
      if (str.isEmpty() == false) { m_toppanel.m_modname.setText(str); ++state; }
      DEBU("Received modinfo for " << str);
      break;
    }
    
    case 1: // Looking for short synopsis
    {
      QString const str = extractString(s, "<td class=modinfosynopsis>", "</td>");
      if (str.isEmpty() == false) { m_toppanel.m_moddesc.setText(str); ++state; }
      break;
    }
    
    case 2: // Looking for author info
    {
      QString const str = extractString(s, "<table class=modinfoauth width=100%>", "</table>");
      if (str.isEmpty() == false) { m_toppanel.m_modauth.setText("<table width=100%>"+str+"</table>"); ++state; }
      break;
    }
    
    case 3: // Looking for language info
    {
      QString const str = extractString(s, "<table class=moduledata>", "</table>");
      if (str.isEmpty() == false) { m_toppanel.m_modlang.setText("<b><table width=100%>"+str+"</table></b>"); ++state; }
      break;
    }
    
    case 4: // Looking for main doc start
    {
      QString const str = extractString(s, "<td class=modinfodesc>", "");
      if (str.isEmpty() == false) { sl.push_back(str); ++state; }
      break;
    }
    
    case 5: // Extracting main doc until its end marker is encountered
    {
      if (s == "</div></td></tr>") { sl.push_back("</div>"); ++state; }
      else sl.push_back(s);
    }
    
    default:
      break;
  }

but it might be easier to create a C++ or Python module with documentation in there that follows the format of existing modules in jevoisbase, and then process it through jevois-modinfo to get the correct modinfo.html file. All the doc pages on the web are also created by jevois-modinfo from comments in the modules' source code. See

http://jevois.org/doc/UserDemos.html

answered Jul 20, 2018 by JeVois (46,580 points)
Plans for making "Info" tab content easy to create?
...