langage de balisage leger mentor en

Mentor light markup language

back to the home page

version available in : it ru zh es ja de nl pt fr

date of creation : 20220620- date of update : 20220620- generation date : 20240612_171241

1.Lbl mentor

This document is the specification of the Mentor system's lightweight markup language - known as LBL Mentor.
The design of this language is to François_Xavier_Pincemin designer and developer of the Mentor system.

2.Presentation of the Mentor Lightweight Markup Language

  • the mentor lightweight markup language is a minimal markup language for managing hypertext via the mentor system's utags module in a gvim/vim environment - cf vim_org.
  • the mt_to_htm module of the mentor system allows to generate an HTML document from the mentor source text.
  • so if you are reading this text in an HTML page you might as well read the source text in a simple editor.
  • but obviously it is only the gvim/vim editor that will let you benefit from the utags functions, for several reasons :
  • The overall form of the text is an encapsulation of . bloc de texte  or . bloc structurel .
  • The . bloc structurel  defines the tags and references of the hypertext.

    2.1.Presentation of the form of hypertext

    2.1.1.Text block

    The text block is the structure under which a text is stored.

    - It is composed of four types of elements delimited by pairs of delimiters < >, ( ), { } and [ ]

  • a hypertext label or tag put between the delimiters "<" et ">", said . etiquette mentor  which can only contain alphanumeric characters with the underscore "_" as separator - a possible . résumé de bloc  or . commentaire mentor  put in brackets "( )",
  • the text itself, enclosed in braces "{ the text }" which is the text block itself.
  • hypertext references (to mentor labels) of the form [une_reference_en] which are used in the text contained in the text blocks

    2.1.1.1.Bloc structurel

    So we have a general form:

    <etiquette_de_bloc_en>(title) [une_reference_en]
    {
    ...
    ... [une_reference_en] ...
    ...
    <etiquette_de_sous_bloc_en>(sub block label)
    {
    ...
    ... [une_reference_en] ...
    ...
    ... <etiquette_dans_texte_en> ... ... ... <une_reference_en>(it is the label of the example of a reference in fact)
    ...
    ... [une_reference_en] ...
    ...
    etc...
    }
    }

    which can therefore be nested: A text block can contain other text blocks.
    A particular block is the block of the whole file whose label line contains:

  • the file name label - the file title in the block comment - a reference to the file summary.
    The form of the file label is therefore <>(une reference)[] .

    
    - for example for a file named filename.ext on a :  


    <nomfichier_extension_en>(file title)[nomfichier_extension_en_som]
    the macro to generate this line is fnt_en for a text file.
    There are other macros: fnc for a C source, fns for a unix shell, etc...

  • one . commentaire de bloc  where the opening parenthesis is followed by a colon ":" will indicate that we concatenate the mentor tag and its comment in the HTML tag.


    example : <nomfichier_extension_en>(: file title) which gives in the html:

    2.1.1.2.. nomfichier extension : file title Otherwise it is the comment alone that is edited in the HTML:

    example : <nomfichier_extension_en>(file title) which gives in the html:

    2.1.1.3.File title Mentor develops the concept of infix which is generally a 3 letters code which if present in a label will be interpreted during html generation as a text to replace if the infix is present in the infix file named infix.
    lst and present under the working directory of the program utags.
    The infix is the generalization of the concepts of prefix and suffix.

    For example : <nom_spe_en>(special name) which gives :

    2.1.1.4.Special name

    The replacement is done in such a way that the replaced text is placed at the beginning of the title for the French version and at the end for the English version.

    specialization of text blocks

    The character following the opening parenthesis of a text block, if it exists, specifies the type of block.
    This type will be used by different modules that complete the hypertext management module.

    2.1.2.Tables of block specifiers

    charactername  meaning of text block (accolades)  comment (brackets)  
    :  colon  main block : the next block specifies the META tags  concatenation of the label and the comment in the HTML title
    =  equal sign  preservation of the form of the source text, if dubbed == source code lbl    
    !  exclamation markthe text displayed in the HTML is the source of the lbl in fixed font    
    -  tiret  chips    
    `  backcote  numbered bullets    
    |  pipe  HTML comment, if doubled absent from the HTML page    
    %  percent  text generated in bicolumn table for orthoptic exercise    
    #  hash  translation specification by the Deepl API    
    ~  tilde  assisted reading in a foreign language (tooltip translated word)    
     semicolon  CSV block    
    .  point  comments out the block specification that will not be displayed in the HTML  
    nbr        
    character      
    10.000000      

    Block types used by the HTML page generator module.


    - The blocks generating bullets will be defined by the dash character : {- ... }.
    The chip level is automatically defined by the block level.
    The numbered chips are defined by blocks whose code is backcote {` ... }.
    examples:

    
    {- niv1 lib1
     - niv1 lib2
       {- level 2 lib1
      - niv2 lib2
        {- niv3 lib1
        - niv3 lib2
        }
      - niv2 lib3
       }
     - niv1 lib3
    }
     et
    {` niv1 lib1
     - niv1 lib2
       {` level 2 lib1
      - niv2 lib2
      - niv2 lib3
      - niv2 lib4
       }
     - niv1 lib3
     - niv1 lib4
    }
    
    This gives in the HTML :

    et

    1. niv1 lib1
    2. niv1 lib2

      1. level 2 lib1
      2. niv2 lib2
      3. niv2 lib3
      4. niv2 lib4
    3. niv1 lib3
    4. niv1 lib4



    - A block with a code equal to "=" will generate a text with preservation of the block shape (HTML tag PRE). The font remains the default font which is proportional.

    - A block with a code equal to "==" will also generate a text with preservation of the block shape (HTML tag PRE) and also with no interpretation of the other LBL tags,
    the text of the block will be copied without any lexical analysis. This is the case of the present block. In order to be able to present in an HTML page the very structure of the language.

    - A block of type {! } will generate a text with preservation of the form of the text of the block. ( PRE beacon ) with the additional use of a fixed font (mail)
    this to preserve the alignment of the text in the case of screen copy for example. Case of the higher levels and the lower planets table.

    - Un bloc de type underscore {| |} will be interpreted as an HTML comment. See the HTML source at this point in the text.


    - Un bloc de type double underscore {|| ||} will be removed from the HTML generation


    - A CSV block will be defined by {; ... } This block contains a data table where the column separator is the semicolon.
    An HTML table will be generated and the header defined by the "CSV_COL specification:" at the beginning of the first line containing the column names
    will be displayed in the HTML in a particular color (blue steel by default).

    example :

    
    <planète_tab_en>(planet tab)
    {;
    CSV_REG:0      ;1           ;               2;          3;4         ;
    CSV_COL:Planets;revolution  ;Sun_Distance Mkm;Diameter km;Rotation  ;
    CSV_TYP:sN     ;s           ;              n0;         n0;s         ;
    Sun            ;            ;               0;    1392684;26 hours  ;
    Mercury        ;88 j        ;              58;       4878;59 days   ;
    Venus          ;225 j       ;             108;      12104;243 days  ;
    Moon           ;28 j        ;             149;       3474;          ;
    Earth          ;365.25 j    ;             149;      12756;24 hours  ;
    Mars           ;687 j       ;             228;       6794;24 h 1/2  ;
    Jupiter        ;12 years old;             778;     142800;10 hours  ;
    Saturn         ;29 years old;            1427;     120000;10 h 1/4  ;
    Uranus         ;84 ans      ;            2870;      52400;15 h 1/2  ;
    Neptune        ;164.86 ans  ;            4497;      48000;16 hours  ;
    Pluton         ;247.74 ans  ;            5913;       2400;6 days 1/3;
    }
    
    This gives in the HTML page :

    2.2.Planet tab

    Planetsrevolution  Sun_Distance MkmDiameter kmRotation  
    Sun     0 139268426 hours  
    Mercury  88 j   58 487859 days  
    Venus  225 j   108 12104243 days  
    Moon  28 j   149 3474  
    Earth  365.25 j   149 1275624 hours  
    Mars  687 j   228 679424 h 1/2  
    Jupiter  12 years old 778 14280010 hours  
    Saturn  29 years old 1427 12000010 h 1/4  
    Uranus  84 ans   2870 5240015 h 1/2  
    Neptune  164.86 ans   4497 4800016 hours  
    Pluton  247.74 ans   5913 24006 days 1/3

    2.3. CSV block types used by the mentor system's CSV table structured data management module.csv block type


    - The CSV type block seen previously {; ... } is processed by a module ensuring the formatting of the table. When editing the table, the command
    assigned to this module to reshape the table, so we only have to insert the data.

    - the processing of structured data is possible in these CSV table blocks by means of a table calculation module, which is a spreadsheet program.

    In this spreadsheet, the commands are specified by specification lines at the beginning of the table, which starts with a string indicating the nature of the specification.: "CSV_SPE: ; ; ;" or SPE is the specification.

    Import functions (CSV_IMP) and data export (CSV_EDT). All of this allows, for example, to build an ETL.


    This calculation module will be able to generate, according to the calculation specifications of the table, edition blocks {@ } with the CSV_EDT specification
    or newspaper blocks (detail card) { } (journal type column).

  • this module will provide DBMS operations interconnecting different CSV blocks :

  • Finally a language included in CSV blocks "procedural" will allow to create applications. These applications can be executed as batch files outside a gvim editing session or in a gvim editing session where gvim is used as a graphical interface.

  • this module of structured data processing is under development and will be put online as soon as possible.

    3. Application block types. These blocks are associated with applications that emerge naturally from the system design..block type app

    3.1.Orthoptic reading in convergence or divergence


    - A block of type % will generate an HTML page with a bicolumn table with the text displayed in each column to allow its joint reading with an orthoptic exercise of convergence or divergence.

    This page presents the text in duplicate so that at the same time of the reading, one can make an exercise of convergence or occular divergence similar to those which one makes at an orthoptist.

    With the advantage that we can dimension the window and thus the convergence effort, without needing a series of progressive convergence prism.

    If the width of the page is reduced, it is easy to merge the two images, the wider it is, the more effort is required from the eye muscles.

    It is possible to merge the two images in two ways: in convergence and divergence. Convergence contracts the muscles and divergence stretches them (muscles in extension).

    By combining the two ways we obtain a complete orthoptic session : muscle strengthening work (musculation) and their relaxation (stretching).

    The modulation of the width of the window corresponds to the succession of the sessions where we use more and more convergent or divergent prism, it is thus necessary to go there gradually.

    I noticed that the modulation of the width being done in a continuous way, it allows greater performances of the occular system particularly in the divergence (relaxation des muscles).

    See in the generated HTML :

    This page presents the text in duplicate so that at the same time of the reading, one can make an exercise of convergence or occular divergence similar to those which one makes at an orthoptist.

    With the advantage that we can dimension the window and thus the convergence effort, without needing a series of progressive convergence prism.

    If the width of the page is reduced, it is easy to merge the two images, the wider it is, the more effort is required from the eye muscles.

    It is possible to merge the two images in two ways: in convergence and divergence. Convergence contracts the muscles and divergence stretches them (muscles in extension).

    By combining the two ways we obtain a complete orthoptic session : muscle strengthening work (musculation) and their relaxation (stretching).

    The modulation of the width of the window corresponds to the succession of the sessions where we use more and more convergent or divergent prism, it is thus necessary to go gradually.

    I noticed that the modulation of the width is done in a continuous way, it allows greater performances of the occular system particularly in the divergence (relaxation des muscles).

    Start with the smallest width of the window and gradually widen.

    This page presents the text in duplicate so that at the same time of the reading, one can make an exercise of convergence or occular divergence similar to those which one makes at an orthoptist.

    With the advantage that we can dimension the window and thus the convergence effort, without needing a series of progressive convergence prism.

    If the width of the page is reduced, it is easy to merge the two images, the wider it is, the more effort is required from the eye muscles.

    It is possible to merge the two images in two ways: in convergence and divergence. Convergence contracts the muscles and divergence stretches them (muscles in extension).

    By combining the two ways we obtain a complete orthoptic session : muscle strengthening work (musculation) and their relaxation (stretching).

    The modulation of the width of the window corresponds to the succession of the sessions where we use more and more convergent or divergent prism, it is thus necessary to go gradually.

    I noticed that the modulation of the width is done in a continuous way, it allows greater performances of the occular system particularly in the divergence (relaxation des muscles).

    Start with the smallest width of the window and gradually widen.

    3.2.Text translation with deepl api

    - A hash-type block "#" {.#en:fr: } causes the translation in the source of the text itself.

  • The language codes used are the two-letter codes, the first one is the initial language and the second one is the translation language.
  • The translation is done by a utility that calls theapi_deepl.
  • The translation can be done for a block of text within a file (the original text is replaced by)
  • or for a whole file, in this case a new file is created whose name is the name of the initial file to which the suffix of the language is added.
  • The labels are not translated and the suffix of the translation language is added.
  • If there is no label comment then the label is used to generate a text that will be translated.
  • In this way we keep the link (with the declination of different translation language suffix) enter the file in the initial language and the different files in the translation language.
  • Once the translation is done, the translation specification is commented with the insertion of a dot "." as block modifier.
  • For example, the following line is always in English :

    3.2.1.Assisted reading in a foreign language


    - A tilde type block "~" is used for foreign language reading assistance.

    - The translation specification follows the tilde character example : {~es:fr: hello the world }
    <lecture_aidée_en_langue_étrangère_en>(assisted reading in a foreign language)
    This gives in the html page, words underlined in dotted line which have a tooltip containing the translated word.

    hello the world

    inverse dictionary : {~fr:es: hello world }

    hello world

    A Spanish-French dictionary of approximately 26,000 words is provided as an example. Other dictionaries can be instantiated by the user mentor.
    They can be shared by the user by sending them to the editor for integration in the utags package.
    If there is no dictionary, you can create a dictionary of a text with a mentor command and then translate the list of words in the dictionary by a translator such as deepl

    3.2.2.Example the lyrics of the song la cucaracha

    
    
    

    la cucaracha, la cucaracha que ya no puede caminar porque no tiene porque le falta la marijuana que fumar

    en la misa y en la feria todo el mundo ya lo sabe los que llegan al gobierno porque se puede comprar

    del partido comunista ya no queda casi nada ahora todos van buscando como hacerse millonadas

    fue la junta de naciones pa' poner sus opiniones todos no estaban de acuerdo donde y cuando bombardear se sientan los presidentes en la silla del gobierno luego mandan a la guerra a la gente de su pueblo

    la cucaracha, la cucaracha que ya no puede caminar porque no tiene porque le falta la marijuana que fumar

    huaracha muchacha que vamoa huarachar va una cucaracha que quiere comerciar, toca, loca ábreme la boca, buscame una coca que no quiero trabalear, mica, rica para zapatear,

    pido a victor jara no me vaya a doblegar, Cha-ma Chama Che Guevara una petición, una cucaracha, por culpa y omisión,

    la cucaracha, la cucaracha que ya no puede caminar porque no tiene porque le falta la marijuana que fumar

    todos se pelean la silla que les deja mucha plata en el norte pancho villa y en el sur viva Zapata!

    ya murió la cucaracha ya la llevan a enterrar entre cuatro zopilotes y un ratón de sacristan

    3.3.Special label types


    - A label of type <_file> will generate an HTML reference to a.
    - example :
    <lien_document_local_en_file>(/home/me/Documents/document.pdf)

    - A label of type <_web> will generate an HTML reference to the net.
    - example :
    <alwaysdata_en_nweb>(www.alwaysdata.com)

    - if the infix is "nweb" instead of "web" Click on the link to open a new tab in the browser.

    <alwaysdata_en_nweb>(www.alwaysdata.com)
    which gives in the html : alwaysdata or lien_vers_alwaysdata_dans_un_nouvel_onglet

  • if the infix is "webs" or "nwebs" the link will be in https instead of http.


    - A label of type <_hil> for "html_inline" indicates to take the html code contained in the block and add it
    directly to the html page. This is used for special cases to automatically generate HTML pages more specialized than a simple text
    or to include style sheets.

    3.4.Management of bold characters

    - A text in parenthesis followed by an exclamation mark (! will appear ) and grass.
    - example : (! texte en gras ) :
    texte en gras