<commit_before><?php
    $formatDifferences = [
        __('No html support, typographer & autolinker'),
        __('An additional syntax to reference MISP Elements'),
    ];
    $shortcutsTableHeader = [__('Command'), __('Action')];
    $shortcuts = [
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'space']) . '</kbd>', __('Triggers autocomplete if applicable')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'b']) . '</kbd>', __('Makes text bold')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'i']) . '</kbd>', __('Makes text italic')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'm']) . '</kbd>', __('Insert a MISP Element')],
    ];
    $syntaxHelp = [
        sprintf('<b>%s</b>: %s','scope', __('Is the scope you want to reference. Can be either %s or %s', sprintf('<code>%s</code>', 'attribute'), sprintf('<code>%s</code>', 'object'))),
        sprintf('<b>%s</b>: %s','id', __('Is the ID of the element')),
    ];
    $syntaxHelp2 = [
       '<code>@[attribute](42)</code>',
       '<code>@[object](12)</code>',
    ];
    $syntaxHelp3 = [
        '<code>@![attribute](52)</code>'
    ];
    $syntaxHelp4 = [
        '<code>@[eventgraph](12)</code>'
    ];
    $syntaxHelp5 = [
        '<code>@[attackmatrix](46)</code>'
    ];

    $helpHTML = '';
    $helpHTML .= '<ul class="nav nav-tabs" id="tab-markdown-help">';
    $helpHTML .=    '<li class="active"><a href="#tab-markdown">Markdown format</a></li>';
    $helpHTML .=    '<li class=""><a href="#tab-editor">Editor shortcuts</a></li>';
    $helpHTML .= '</ul class="nav nav-tabs">';

    $helpHTML .= '<div class="tab-content">';
    $helpHTML .= '<div class="tab-pane active" id="tab-markdown">';
    $helpHTML .= sprintf('<h2>%s</h2>', __('Markdown format'));
    $helpHTML .= sprintf('<p>%s</p>', __('The suported markdown format is similar to %s with some differences:', sprintf('<a href="%s">GFM</a>', 'https://github.github.com/gfm/')));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $formatDifferences) . '</li>'
    );

    $helpHTML .= sprintf('<h2>%s</h2>', __('Markdown extended format'));
    $helpHTML .= sprintf('<h4>%s</h4>', __('1. MISP Element references'));
    $helpHTML .= sprintf('<p>%s</p>', __('In order to have a visually pleasant document but more importantly, avoid hard coding, MISP elements such as attributes and objects can be referenced with the following special syntax'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[scope](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('2. MISP Picture attachment'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@![attribute](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[0]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp3) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('3. MISP Event Graph Picture'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[eventgraph](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[0]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp3) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('4. Att&ck Matrix'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[attackmatrix](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[0]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp3) . '</li>'
    );
    $helpHTML .= '</div>';

    $helpHTML .= '<div class="tab-pane" id="tab-editor">';
    $helpBodyHTML = '';
    foreach ($shortcuts as $sc) {
        $helpBodyHTML .= sprintf('<tr><td><kbd>%s</kbd></td><td>%s</td></tr>', $sc[0], $sc[1]);
    }
    $helpHTML .= sprintf('<h2>%s</h2>', __('Editor shortcuts'));
    $helpHTML .= sprintf('<table class="table table-bordered table-condensed"><thead><tr>%s</tr></thead><tbody>%s</tbody></table>',<commit_msg>chg: [markdownViewer] Improved help<commit_after><?php
    $formatDifferences = [
        __('No html support, typographer & autolinker'),
        __('An additional syntax to reference MISP Elements'),
    ];
    $shortcutsTableHeader = [__('Command'), __('Action')];
    $shortcuts = [
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'space']) . '</kbd>', __('Triggers autocomplete if applicable')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'b']) . '</kbd>', __('Makes text bold')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'i']) . '</kbd>', __('Makes text italic')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'm']) . '</kbd>', __('Insert a MISP Element')],
        ['<kbd>' . implode('</kbd><kbd>', ['ctrl', ' + ', 'h']) . '</kbd>', __('Makes text as header')],
    ];
    $syntaxHelp = [
        sprintf('<b>%s</b>: %s','scope', __('Is the scope you want to reference. Can be either %s or %s', sprintf('<code>%s</code>', 'attribute'), sprintf('<code>%s</code>', 'object'))),
        sprintf('<b>%s</b>: %s','id', __('Is the ID of the element')),
    ];
    $syntaxHelp2 = [
       '<code>@[attribute](42)</code>',
       '<code>@[object](12)</code>',
    ];
    $syntaxHelp3 = [
        '<code>@![attribute](52)</code>'
    ];
    $syntaxHelp4 = [
        '<code>@[eventgraph](12)</code>'
    ];
    $syntaxHelp5 = [
        '<code>@[attackmatrix](46)</code>'
    ];

    $helpHTML = '';
    $helpHTML .= '<ul class="nav nav-tabs" id="tab-markdown-help">';
    $helpHTML .=    '<li class="active"><a href="#tab-markdown">Markdown format</a></li>';
    $helpHTML .=    '<li class=""><a href="#tab-editor">Editor shortcuts</a></li>';
    $helpHTML .= '</ul class="nav nav-tabs">';

    $helpHTML .= '<div class="tab-content">';
    $helpHTML .= '<div class="tab-pane active" id="tab-markdown">';
    $helpHTML .= sprintf('<h2>%s</h2>', __('Markdown format'));
    $helpHTML .= sprintf('<p>%s</p>', __('The suported markdown format is similar to %s with some differences:', sprintf('<a href="%s">GFM</a>', 'https://github.github.com/gfm/')));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $formatDifferences) . '</li>'
    );

    $helpHTML .= sprintf('<h2>%s</h2>', __('Markdown extended format'));
    $helpHTML .= sprintf('<h4>%s</h4>', __('1. MISP Element references'));
    $helpHTML .= sprintf('<p>%s</p>', __('In order to have a visually pleasant document but more importantly, avoid hard coding, MISP elements such as attributes and objects can be referenced with the following special syntax'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[scope](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('2. MISP Picture attachment'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@![attribute](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[0]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp3) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('3. MISP Event Graph Picture'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[eventgraph](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[1]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp4) . '</li>'
    );

    $helpHTML .= sprintf('<h4>%s</h4>', __('4. Att&ck Matrix'));
    $helpHTML .= sprintf('<p>%s</p>', __('Picture attachment'));
    $helpHTML .= sprintf('<h4 style="text-align: center;">%s</h4>', '<code style="font-size: 14px;">@[attackmatrix](id)</code>');
    $helpHTML .= sprintf('<span>%s</span>', __('Where:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', [$syntaxHelp[1]]) . '</li>'
    );
    $helpHTML .= sprintf('<span>%s</span>', __('Examples:'));
    $helpHTML .= sprintf('<ul>%s</ul>',
        '<li>' . implode('</li><li>', $syntaxHelp5) . '</li>'
    );
    $helpHTML .= '</div>';

    $helpHTML .= '<div class="tab-pane" id="tab-editor">';
    $helpBodyHTML = '';
    foreach ($shortcuts as $sc) {
        $helpBodyHTML .= sprintf('<tr><td><kbd>%s</kbd></td><td>%s</td></tr>', $sc[0], $sc[1]);
    }
    $helpHTML .= sprintf('<h2>%s</h2>', __('Editor shortcuts'));
    $helpHTML .= sprintf('<table class="table table-bordered table-condensed"><thead><tr>%s</tr></thead><tbody>%s</tbody></table>',
{'fraction_non_alphanumeric': 0.288195466588166, 'fraction_numerical': 0.010990089294475518, 'mean_word_length': 3.6623970722781336, 'pattern_counts': {'":': 0, '<': 345, '<?xml version=': 0, '>': 343, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6644604', 'n_tokens_mistral': 3554, 'n_tokens_neox': 3706, 'n_words': 671}