PAGE HTML
PAGE HTML
  **module** lang=html
    notations locales
      *collect macros_, javascript
        notation pour fonctions js de html
          ADD_RES ::=
            try
              {a1} = document.getElementById("{a1}").value
              catch
                {a1} = ''
            res = res + "<br>" + '"{a1}" : "'+ {a1} + '",'
            res_2 = res_2 + '"{a1}" : "'+ {a1}+ '",'
            {L}
    MACROS
      *standard texte html
        NUMBERING ON
        *exec
          grand titre pour les onglets
            TITLE_ALL_PAGES = "APPLICATIONS IN PROLOG"
        *base64 ON
      *import notation for files
      notation pour html locales
        INFO_TA ::=
          {a1}
            <textarea name="{a1}" id="{a1}" rows={a3} cols={a4}>{a2}</textarea>
              {L}
        INFO_T ::=
          {a1}
            INPUT {a1}, text, {a2}
              {L}
        INPUT ::=
          <input type="{a2}" name="{a1}" id="{a1}" value= {a3}>
            {L}
      MON_TEXTE
        TITLE
          ETUDE DES APPLICATIONS PROLOG
        HEADER
          page de garde
            BR 3
              BR 2
              BR
                CENTER
                  XXLARGE
                    BOLD
                      2022 PROLOG APPLICATIONS CENSUS
                  SMALL
                    MAJ_DATE_EN
                    Laurent Gouzènes, sponsored by KM2 Conseil
              etc
                *exec
                  r = 'C:\\ANACONDA\\Library'
                    if r not in sys.path and os.path.exists (r) :
                      sys.path.append (r)
                  r = 'C:\\ANACONDA\\sip'
                    if r not in sys.path and os.path.exists (r) :
                      sys.path.append (r)
                  print ('----------------------------------------- importing librairies and date')
                *exec
                  try
                    import datetime
                      from datetime import date
                      N_DATE = datetime.datetime.now().strftime("updated %d - %B - %Y at %H:%M")
                    except
                      N_DATE = "10 June 2022"
        STYLE
          STYLES_2
        NAV
          COLUMNS_2
            NAV_SOMMAIRE
        TEXT
          GOSUB
    ATTENTION
      il y a toujours un temps de retard
        il faut faire tourner le programme python de restructuration
        puis
          générer le html
  TEXTE
    auxiliaires python
      GOSUB
        fichier
    trucs init
      chargement de la BD en mémoire
        *exec
          notation
            ' F= ' ::= {a_1} = DIR_BASE F/ "{a1_}"
          DIR_BASE = "D:/LG SAVOIRS/PROLOG/DOCS/APPLICATIONS/NEW_APPLICATIONS"
          data_f2 F= data_d2.json
            dict_base = all_projects = file_to_dict ( data_f2)
          domain_f F= domains.json
            domains = file_to_dict ( domain_f)
          echo all_projects.keys()
    HTM_FILE census_form
      *import PAGE HTML // HTM_FILE census_form
      NB : plutot recopier la census form des old applications !
    TOP of page / SOMMAIRE
      <p id="SOMMAIRE"> </p>
        DETAILS Summary open
          SMALL
            3COLUMNS
              SOMMAIRE_
    menus et options
      DESCRIPTION
        Introduction
          COTECOTE
              This page contains a structured presentation of a survey or Prolog applications started in May 2022.
              The collected data is presented below.
              Number of projects as today :
                BOLD
                  BLUE
                    EXEC
                      number_of_projects = len (all_projects)
                    {}{len (all_projects)}.
              BOLD
                BLUE
                  Many thanks to all the participants for the survey.
              This is an ongoing work, please contribute if you know more applications.
            CELL1
              This page is part of a larger work developped for and by the prolog community :
                BOUTON_GO TOP PAGE OF PROLOG, https://www.km2-conseil.fr//PROLOG/PROLOG.htm
                  BOUTON_GO SURVEY OF APPLICATIONS 1995, https://www.km2-conseil.fr//PROLOG/DOCS/APPLICATIONS/VIEILLES_APPLICATIONS/PROCESSING%20OLD%20APPLICATIONS%20IN%20PROLOG.htm
                BR 2
                  BOUTON_GO PROLOG YEAR SYMPOSIUM 10 nov 2022, https://prologyear.logicprogramming.org/PrologDay.html
        Methodology
          COTECOTE
            CELL1
              CENTER
                BOLD
                  The 2022 Survey
                BR
                  CONTRIBUTE !!
                BOLD
                  new form
                      census_form.htm
            CELL0
              processing of the survey :
                results are stored in .json format for each application separately
                results are analysed and completed to find out domains, proper years, etc
                this html file is then generated from the all the collected data.
              BOLD
                Contributions must be sent as a "name_of_application.json" valid file, according to the model presented here (one json file per application).
              RED
                warning :
                  not sure that all the http links included in the references are handled correctly by the processor.
              PPT presentation fo this survey
                BOUTON_GO PPT PRESENTATION FOR SYMPOSIUM 10 nov 2022, Survey of applications.pptx
          BLUE
            BOLD
              Short powerpoint presentation of the methodology and analysis of results.
                (HERE).
      Here we need some buttons and filters to access more easily data
          BOUTON HIDE ALL
            BOUTON SHOW ALL
        BY DOMAIN
          BOUTON FINANCE
            BOUTON SPEECH
              etc
    presentation par nom
      NAMES OF PROJECTS
        BOLD
          Projects are sorted by name.
          3COLUMNS
            *loop project in sorted (dict_base.keys(), key = lambda x : x.upper())
              *exec
                project_low = project.lower()
              {*}
                <a href="#{project_low}">{project}</a>,
            ... etc
    presentation par domaines
      DOMAINS
        BOLD
          Projects are grouped by keywords which are present in the various fields of the database.
            A project can appear in several domains.
          *exec
            init des listes
              dict_project_fields = {}
                for project in dict_base
                  dict_project_fields [project] = []
        Projects by field
          *loop domain in sorted (domains.keys ())
            *exec
              domain_info = domains.get (domain, {})
              filters = domain_info.get ('results', False)
                kw = ', '.join (domain_info.get ('kw', []))
            *if filters or (isinstance (filters, list) and filters != [] )
              ----------------------
                RED
                    {domain}
                      {*}
                        ( {len (filters)} projects / {int(100*len (filters)/number_of_projects)}% in the domain)
                          , keywords : {kw}
                          ----------------------
              DETAILS
                COLUMNS_3
                  *loop info in filters
                    *exec
                      project, program, key, ref = info
                      dict_project_fields [project] .append (domain)
                      project_low = project.lower()
                    {*}
                      BLUE
                        <a href="#{project_low}">{project}</a>
                          ({key},{ref})
                      {program}
          vérification de la classification
            *exec
              unclassified = False
                for project in dict_project_fields
                  if dict_project_fields[project] == []
                    unclassified = True
                      break
            *if unclassified
              BOLD
                RED
                  Unclassified :
                  *for project in dict_project_fields
                    *if dict_project_fields[project] == []
                      *exec
                        project_low = project.lower()
                      {*}
                        <a href="#{project_low}">{project}</a>
                  ... need to look carefully at keys or text, add domains, fields, change documentation ... ?
              *else
                GREEN
                  BOLD
                    No unclassified project
            DETAILS details of projects --> fields
              {*}
                dict_project_fields = {dict_project_fields}
            DETAILS details of projects --> fields
              *for project in sorted (dict_project_fields.keys())
                {*}
                  BOLD
                    <a href="#{project.lower()}">{project}</a> :
                  {', '.join (dict_project_fields[project])}.
        Statistics by domain
          BOLD
            TOTAL :
              {*}
                {len (all_projects)}
                  projects.
          TABLE
            *exec
              for domain in domains.keys ()
                domain_info = domains.get (domain, {})
                  domain_info ['prc'] = prc
                    WHERE
                      filters = domain_info.get ('results', [])
                        prc = int (100*len (filters) / number_of_projects)
            BOLD
              TR
                TD
                  CENTER
                    Domain
                TD
                TD
                  %
                TD
                  # Projects
                TD
                  CENTER
                    Keywords
            *loop domain in sorted (domains.keys (), key=lambda x : domains[x]['prc'], reverse = True)
              *exec
                prc = domain_info ['prc']
                  WHERE
                    domain_info = domains.get (domain, {})
                      filters = domain_info.get ('results', [])
                        kw = ', '.join (domain_info.get ('kw', []))
              TR
                {*}
                  TD
                    {domain}
                  TD
                    <progress id="{domain}_" value="{prc}" max="100"></progress>
                  TD
                    CENTER
                      {prc}%
                  TD
                    CENTER
                      {len (filters)}
                  TD
                    {kw}
    presentation par ages
      APPLICATIONS BY YEAR
        BOLD1 Warning
          some errors may occur because of automation.
        BR
        first sort by date and buckets
          *exec
            dict_years = {}
              for p , p_dict in dict_base.iteritems ()
                year = p_dict.get ('year_deployed', 1900)
                L = dict_years.get (year, False)
                  if not L
                    dict_years[year] = L = []
                L.append (p)
            ALT_COLOR = 'BLUE'
          DETAILS open
            TABLE 1
              BOLD
                TR1
                  TD1
                    CENTER
                      &nbsp;Year&nbsp;
                  TD1
                    Center
                      Projects
              *loop year in sorted (dict_years. keys ())
                TR1
                  TD1
                    BLUE
                      BOLD
                        {*}
                          {year if year != 1900 else 'year unknown'}
                        BR
                          *if len (dict_years[year]) > 1
                            {*}
                              : {len (dict_years[year]) } projects.
                            *else
                              1 project.
                          CENTER
                            {*}
                              ({len (dict_years[year]) } )
                  TD1
                    COLUMNS_3
                      print ('--- dict_base', dict_base)
                      *for project in sorted (dict_years[year])
                        *exec
                          print ('project =', project)
                          d_proj = dict_base [project]
                            purpose =d_proj.get ('purpose', '')
                          project_low = project.lower ()
                          ALT_COLOR = 'BLUE' if ALT_COLOR == 'GREEN' else 'GREEN'
                        {*}
                          BLUE
                            <a href="#{project_low}">{project}</a>
                          {ALT_COLOR}
                            {purpose}
    ALL PROJECTS
      BR
        PROJECTS
          suite
            notation
              SHOW_D ::=
                *vars
                  {show_d_p}
                    show_d_p = True
                      if infos.get (a1, '') = ''
                        show_d_p = False
                  {show_text}
                    show_text = infos.get (a1, '')
                    if a1 in [ 'references', 'purpose', 'description']
                      echo 'references', show_text
                      show_text = split_links_chain (show_text)
                  {show_units}
                    if a2 in ['', False]
                      show_units = ''
                      else
                        show_units = '(' + a2 + ')'
                nothing {show_d_p} {a2}
                *if show_d_p == True
                  BOLD
                    {a1} {show_units}:
                    {show_text}
                  {L}
              SHOW_I ::=
                *vars
                  {show_d_p}
                    show_d_p = True
                      if infos.get (a1, '') = ''
                        show_d_p = False
                  {show_text}
                    show_text = infos.get (a1, '')
                    if a1 in [ 'references', 'purpose', 'description']
                      echo 'references', show_text
                      show_text = split_links_chain (show_text)
                  {show_units}
                    if a2 in ['', False]
                      show_units = ''
                      else
                        show_units = '(' + a2 + ')'
                nothing {show_d_p} {a2}
                  {a1}
                    {show_units}:
                *if show_d_p == True
                    {show_text}
                  {L}
            BOLD
              BLUE
                You can click on the ∑ symbol to go back to the summary
                Applications are sorted by alphabetical order.
                BR
              CENTER
                BOLD
                  Detailed list of all projects
              DETAILS
                  *loop project in sorted (dict_base.keys(), key = lambda x : x.upper())
                    *exec
                      infos = dict_base [project]
                        project_low = project.lower()
                      echo project
                    BOLD
                      BLUE
                          <a href="#SOMMAIRE">∑</a>
                            {*}
                              <span id="{project_low}"></span>
                                project : {project}
                      Project
                        {project}
                          SHOW_D year
                            Dates
                          SHOW_D date deployed
                            Dates
                          SHOW_D year_deployed
                            Dates
                          SHOW_D range_deployed
                            Dates
                          SHOW_D range_development
                            Dates
                          SHOW_D dated
                            Dates
                          SHOW_D domain
                            Description
                          SHOW_D purpose
                            Description
                          SHOW_D description
                            Description
                          SHOW_D developers
                            People
                          SHOW_D developed by
                            People
                          SHOW_D organization
                            People
                          SHOW_D country
                            People
                          SHOW_D contact
                            People
                          SHOW_D address
                            People
                          SHOW_D telephone
                            People
                          SHOW_D email
                            People
                          SHOW_D prolog
                            Resources
                          SHOW_D platform
                            Resources
                          SHOW_D other_languages
                            Resources
                          SHOW_D lines, lines
                            Resources
                          SHOW_D predicates, QTY
                            Resources
                          SHOW_D development_effort, MY
                            Resources
                          SHOW_D maintenance_effort, MY
                            Resources
                          SHOW_D use
                            Dates
                          SHOW_D current status
                            Dates
                          SHOW_D users
                            Dates
                          SHOW_D type of use
                            Description
                          SHOW_D No. of Users
                            Description
                          SHOW_D references
                            References
    Resources by project
      RESOURCES BY PROJECT
        BOLD1 Warning
          some errors may occur because of automation.
        BR
        Lines and efforts
          BR
            DETAILS Lines and efforts open
              TABLE 1
                BOLD
                  TR1
                    TD1
                      CENTER
                        Project
                    TD1
                      CENTER
                        Lines
                    TD1
                      CENTER
                        Predicates
                    TD1
                      CENTER
                        Developpement effort
                    TD1
                      CENTER
                        Maintenance effort
                *loop project in list_projects_output
                  *exec
                    infos = dict_base [project]
                      project_low = project.lower()
                    echo project
                  TR1
                    TD1
                      {*}
                        <a href="#{project_low}">{project}</a>,
                    TD1
                      SHOW_I lines, lines
                    TD1
                      SHOW_I predicates, QTY
                    TD1
                      SHOW_I development_effort, MY
                    TD1
                      SHOW_I maintenance_effort, MY
        Language used
          *exec
            tools for stats
              print ('======================== LANGUAGES ==================')
              possible languages/tools
                global lang_names
                  lang_names = [
                    'ciao'
                      'swi'
                        'sicstus'
                          'xsb'
              number of projects for each language
                global stats_lang
                  stats_lang = { x: 0 for x in lang_names}
                    stats_lang ['unknown'] = 0
              list of projects by language name
                global lang_list
                  lang_list = { x: [] for x in lang_names}
                    lang_list ['unknown'] = []
              def add_stats_lang (lang, project)
                global stats_lang
                  global lang_list
                    global lang_names
                found = False
                  if lang est un unicode
                    lang = lang.lower ()
                    for s in lang_names
                      if s in lang
                        stats_lang [s] += 1
                          lang_list [s].append (project)
                            found = True
                if not found
                  stats_lang ['unknown'] += 1
                    lang_list ['unknown'].append (project)
                True
              for project in dict_base. keys ()
                infos = dict_base [project]
                  project_low = project.lower()
                add_stats_lang (S, project)
                  WHERE
                    S = infos.get ('prolog', False)
              echo lang_names, lang_list, stats_lang
          BR
            CELL1
              BOLD
                Language statistics :
                  {*}
                    {lang_list}
                    {stats_lang}
                  BR
                    TABLE 1
                      BOLD
                        TR1
                          TD1
                            CENTER
                              Language/tool
                          TD1
                            CENTER
                              Quantity
                          TD1
                            CENTER
                              Projects
                      *for lang in sorted (stats_lang.keys ())
                        {*}
                          TR1
                            TD1
                              {lang}
                            TD1
                              {stats_lang['{lang}']}
                            TD1
                              {', '.join (['<a href="#' + x.lower () + '">' + x + '</a>' for x in sorted (lang_list['{lang}'] ) ] )}
          BR
            DETAILS Languages and tools open
              TABLE 1
                BOLD
                  TR1
                    TD1
                      CENTER
                        Name
                    TD1
                      CENTER
                        Language/tool
                    TD1
                      CENTER
                        Platform
                    TD1
                      CENTER
                        Other languages
                *loop project in list_projects_output
                  *exec
                    infos = dict_base [project]
                      project_low = project.lower()
                  TR1
                    TD1
                      {*}
                        <a href="#{project_low}">{project}</a>
                    TD1
                      SHOW_I prolog
                    TD1
                      SHOW_I platform
                    TD1
                      SHOW_I other_languages
        Platform used
          *exec
            tools for stats
              print ('======================== PLATFORMS ==================')
              possible languages/tools
                global platform_names
                  platform_names = [
                    'any'
                      'all'
                        'multiplatform'
                    'web'
                      'on line'
                        'browser'
                    'apple'
                      'mac'
                    'windows'
                    'linux'
                  echo platform_names
              number of projects for each language
                global stats_platform
              list of projects by language name
                global platform_list
              def add_stats (elt, project, names, stats, liste)
                echo elt, project, names
                found = False
                  if elt est un unicode
                    elt = elt.lower ()
                      for s in names
                        if s in elt
                          stats [s] += 1
                            liste [s].append (project)
                              found = True
                  if not found
                    stats ['unknown'] += 1
                      liste ['unknown'].append (project)
                True
              def make_stats (field, names)
                global dict_base
                names = names[:]
                  names.append ('unknown')
                    stats = { x: 0 for x in names}
                      liste = { x: [] for x in names}
                for project in dict_base. keys ()
                  infos = dict_base [project]
                    echo field, project
                  add_stats (S, project, names, stats, liste)
                    WHERE
                      S = infos.get (field, False)
                echo names, stats, liste
                names, stats, liste
              platform_names, stats_platform, platform_list = make_stats ('platform', platform_names)
              mix of platforms
                notation
                  melange stats ::=
                    mélange {a1}, {a2}
                      platform_list ['{a1}'] .extend ( [x for x in platform_list ['{a2}'] if x not in platform_list ['{a1}'] ])
                      stats_platform ['{a1}'] = len (platform_list ['{a1}'] )
                mélange macos, apple
                  platform_list ['macos'] .extend ( [x for x in platform_list ['apple'] if x not in platform_list ['macos'] ])
                  stats_platform ['macos'] = len (platform_list ['macos'])
                melange stats apple, mac
                melange stats any, all
                melange stats any, multiplatform
                melange stats web, browser
                melange stats web, on line
                new_names = [
                  'linux'
                    'windows'
                      'apple'
                        'web'
                          'any'
                            'unknown'
              echo stats_platform, platform_list
              echo lang_names, lang_list, stats_lang
          BR
            stats done ok
          BR
            CELL1
              BOLD
                Platform statistics :
                  {*}
                    {lang_list}
                    {stats_lang}
                  BR
                    TABLE 1
                      BOLD
                        TR1
                          TD1
                            CENTER
                              Platform
                          TD1
                            CENTER
                              Quantity
                          TD1
                            CENTER
                              Projects
                      *for element in sorted (new_names)
                        {*}
                          TR1
                            TD1
                              {element}
                            TD1
                              {stats_platform ['{element}']}
                            TD1
                              {', '.join (['<a href="#' + x.lower () + '">' + x + '</a>' for x in sorted (platform_list['{element}'] ) ] )}
  auxiliaires python
    *exec
      start ...
        import os
          import os.path
            import json
          import codecs
        *standard python
        notation
          x_show ::=
            print (u"++++++++++++++++ {a0}")
              {L}
          some_error ::=
            # some error : {a0}
              print ( {a1_} )
            pass
            {L}
        les fonctions de base
          # fonctions simples
            def dict_from_file (file)
              DESCRIPTION
                lit un fichier json
                ENTREES
                  file :
                    nom d'un fichier .json
                SORTIES
                  d :
                    dictionnaire ou liste
                ATTENTION
                  il faut vérifier de lire .json, .JSON, .Json
              # tests unitaire
                manuel
              echo 'dict_from_file', file
              if file existe
                try
                  with codecs.open (file, 'r', encoding = 'utf-8') as fs
                    d = json.load (fs)
                      echo 'lecture ok'
                        d
                  except
                    some_error 'erreur de lecture de ', file
                    {}
                else
                  some_error 'fichier n existe pas', file
                  pre = file [:-4]
                    for suf in ['json', 'JSON', 'Json']
                      nfile = pre + suf
                        if nfile existe
                          try
                            echo nfile
                            with open (nfile, 'r', encoding ='utf-8') as fs
                              d = json.load (fs)
                                d
                            except
                              continue
                  {}
            def file_to_dict (fname)
              dict_from_file (fname)
            def dict_to_file (d, file)
              DESCRIPTION
                écrit un dictionnaire dans un fichier au format json
                  et pretty
                ENTREES
                  file : nom d'un fichier .json
                  d :
                    dictionnaire ou liste
                SORTIES
              # tests unitaire
                manuel
              echo file
              if isinstance (d, str) and isinstance (file, dict)
                d, file = file, d
              try
                with codecs.open (file, 'w', encoding = 'utf-8') as fs
                  json.dump(d, fs, indent = 4)
                    d
                except
                  some_error 'fichier n existe pas', file
                  False
            def file_dict_update (file, nom, val)
              DESCRIPTION
                file contient un dictionnaire
                met à jour le chap nom avec la valeur val
              try
                dico = dict_from_file (file)
                dico [nom] = val
                dict_to_file (dico, file)
                True
                except
                  False
            def file_dict_value (file, nom)
              DESCRIPTION
                file contient un dictionnaire
                récupère la valeur du champ associé
              try
                dico = dict_from_file (file)
                val = dico.get (nom, False)
                val
                except
                  False
            def dict_file_value (file, nom)
              DESCRIPTION
                file contient un dictionnaire
                récupère la valeur du champ associé
              file_dict_value (file, nom)
            def file_dict_delete (file, nom)
              DESCRIPTION
                file contient un dictionnaire
                suppprime le champ nom
              try
                dico = dict_from_file (file)
                if nom in dico
                  del dico [nom]
                dict_to_file (dico, file)
                True
                except
                  False
            P_8 : remplacement caractères spéciaux
              global liste_chars_escape
                liste_chars_escape = [ ('é', '&eacute;'), ('è', '&egrave;'), ('à','&agrave;'), ('ù','&ugrave;'), ('ê','&ecirc;'), ('â', '&acirc;'), ('û','&ucirc;'), ('î','&icirc;'), ('ô','&ocirc;'), ('ë', '&euml;'), ('ï', '&iuml;'), ('ö','&ouml;'), ('ü','&uuml;'), ('ç','&ccedil;') ]
                liste_chars_escape = [ (u'é', '&eacute;'), (u'è', '&egrave;'), (u'à','&agrave;'), (u'ù','&ugrave;'), (u'ê','&ecirc;'), (u'â', '&acirc;'), (u'û','&ucirc;'), (u'î','&icirc;'), (u'ô','&ocirc;'), (u'ë', '&euml;'), (u'ï', '&iuml;'), (u'ö','&ouml;'), (u'ü','&uuml;'), (u'ç','&ccedil;') ]
              def P_8 (u)
                # DESCRIPTION
                  pour passer d'une chaine str en une chaine escaped
                global liste_chars_escape
                if isinstance (u, str) or isinstance (u,unicode)
                  for a, b in liste_chars_escape
                    if a in u
                      u = u.replace (a, b)
                u
              def P_8_rev (u)
                # DESCRIPTION
                  permet de passer d'une chaine escaped en unicode
                global liste_chars_escape
                if isinstance (u, str) or isinstance (u,unicode)
                  if '&' in u
                    for a, b in liste_chars_escape
                      if b in u
                        u = u.replace (b, a)
                u
          def split_links_chain (chaine)
            DESCRIPTION
              1
                coupe une chaine de la forme
                  xxxxxxxxxxxxx https://yyyyy Zvvvv
                  xxxxxxxxxxxxx www.yyyyy Zvvvv
                remplace
                  les links par des href
              2
                structure les références avec des <br> sauts de ligne
            cas simple
              if 'http' in chaine
                echo chaine
                l_parts = []
                  start = 0
                    while True
                      m1 = chaine.find ('http', start)
                        m2 = chaine.find ('www.', start)
                          m = max (m1,m2)
                      if m < 0
                        c1 = chaine [start:]
                          l_parts.append (c1)
                            break
                      if m1 < 0
                        m = m2
                        else
                          if m2 < 0
                            m = m1
                            else
                              m = min (m1, m2)
                      c1 = chaine [start :m]
                        l_parts.append (c1)
                      traitement du lien
                        found = False
                          recherche la fin du lien
                            for k in range (m, len (chaine))
                              c = chaine[k]
                                if c in ' ,"()[]{}'
                                  found = True
                                    lien = chaine [m:k]
                                      break
                        at_end = False
                          if not found
                            lien = chaine [m:]
                              at_end = True
                        if lien commence par 'www'
                          lien = 'https://' + lien
                        while lien [-1] in ' .,'
                          lien = lien [:-1]
                            k = k-1
                        href = '<a href="' + lien + '">' + lien + '</a>,'
                          l_parts.append (href)
                        start = k
                          if at_end
                            break
                n_chaine = ' '.join (l_parts)
                  echo n_chaine
                  print ('--------------------------------')
                else
                  n_chaine = chaine
            remplacement des ' 2.' par des '<br>2.'
              listes de filtres
                L = [
                  ' 2.'
                    ' 3.'
                      ' 4.'
                        ' 5.'
                  ' 6.'
                    ' 7.'
                      ' 8.'
                        ' 9.'
                          ' 10.'
                  ' 11.'
                    ' 12.'
                      ' 13.'
                        ' 14.'
                          ' 15.'
                L1 = [ ' 2.', ' 3.', ' 4.', ' 5.', ' 6.', ' 7.', ' 8.', ' 9.', ' 10.', ' 11.', ' 12.', ' 13.', ' 14.', ' 15.']
                L2 = ['[1]', '[2]', '[3]', '[4]', '[5]', '[6]', '[7]', '[8]', '[9]', '[10]', '[11]', '[12]', '[13]', '[14]', '[15]']
                L3 = [' 1-', ' 2-', ' 3-', ' 4-', ' 5-', ' 6-', ' 7-', ' 8-', ' 9-', ' 10-', ' 11-', ' 12-', ' 13-', ' 14-', ' 15-']
              en gras, etc
                b1 = '<span style="font-weight:bold">'
                  b2 = "</span>"
                br = '<br>'
              for l in [L1, L2, L3]
                found = False
                for x in l
                  if x in n_chaine
                    n_chaine = n_chaine.replace (x, b1 + br + x + b2)
                      found = True
                        echo x, n_chaine
                        if 'Bruynooghe' in n_chaine
                          print ('n_chaine = ', x, n_chaine)
              L4 = [ ('%20', ' ')]
                for x,y in L4
                  if x in n_chaine
                    n_chaine = n_chaine.replace (x, y)
                      if 'Bruynooghe' in n_chaine
                        print ('n_chaine = ', n_chaine)
              if found
                echo n_chaine
                break
                  un seul type de modifications possible
                pass
            n_chaine
        notation
          ' F= ' ::= {a_1} = DIR_BASE J+ "{a1_}"
      global DIR_BASE
        DIR_BASE = "D:\\LG SAVOIRS\\PROLOG\\DOCS\\APPLICATIONS\\NEW_APPLICATIONS"
      global dict_base
        print ('=========================== préparation du fichier html====================')
        dict_base = dict ()
      global domains
        domains = {}
      récupération des projets
        data_f2 = os.path.join (DIR_BASE, 'data_d2.json')
          data_f2 = os.path.join (DIR_BASE, 'data_base_low.json')
          echo dict_base
          echo data_f2
    *exec
      charge le fichier des applications
        if not os.path.exists (data_f2)
          print (' pas de data_f2')
          else
            print ('lecture ...')
              data_f2 = data_f2.replace ('\\', '/')
                echo data_f2
            essai de lecture ligne à ligne
              with codecs.open (data_f2, 'r', encoding = 'utf-8') as f_in
                print ('open ok')
                for line in f_in.readline ()
                  if not line
                    break
                  print ('line = ', line)
                print ('ok <<')
            dict_base = dict_from_file ( data_f2)
        liste pour sortir par ordre alphabetique
          global list_projects_output
            list_projects_output = [ (x, x.lower ()) for x in dict_base.keys () ]
              list_projects_output = sorted (list_projects_output, key = lambda x : x[1])
                list_projects_output = [x[0] for x in list_projects_output]
          echo list_projects_output
      récupération des domaines
        domain_f F= domains.json
          domains = dict_from_file (domain_f)
            echo domains
    *exec
      controle du chargement
        try
          pass
            echo dict_base
            echo 'dict_base loaded'
              echo len (dict_base)
          except
            print ('******************* error in dict_base')
  ici
  ici