<commit_before>%YAML 1.2
---
name: Help
scope: text.hyperhelp.help
first_line_match: '^%hyperhelp'
hidden: true
variables:
  key_binding: '<[^> ]*>[^> ]?>?'
  code_markup: '`[^`]*`'
  block_markup: '^\s*```\s*$'
  hyperlink: '(\|)([^|\* \x{00a0}][^|\* ]*)(\|)'
  anchor: '(\*)([^*\| \x{00a0}][^*\| ]*)(\*)'
  hidden_anchor: '(\*\|)([^\*\|\t \x{00a0}][^*\| ]*)(\|\*)'
  separator: '(?:\+?([=-])\1{3,}(\+|\|)?)|(?:\|\x{00a0})|(?:\x{00a0}\|)'
  author_header: '^(%)(hyperhelp)'
  header_keypair: '\b([a-z]+)(=)(")([^"]*)(")'
  expanded_header: '^{{anchor}}\s+(.*)\s{2,}(.*)'

contexts:
  main:
    - match: '{{author_header}}'
      captures:
        1: punctuation.definition.directive
        2: keyword.other.directive meta.directive
      push: header_keypairs
    - match: '{{expanded_header}}'
      captures:
        1: string.unquoted
        2: string.unquoted meta.anchor
        3: string.unquoted
        4: storage.type.class meta.title
        5: variable.language meta.date
      set: body
    - match: ''
      set: body
  header_keypairs:
    - match: '{{header_keypair}}'
      captures:
        1: storage.type.class meta.key
        2: keyword.operator
        3: string.quoted.double
        4: string.quoted.double meta.value
        5: string.quoted.double
    - match: '\S'
      scope: invalid.illegal.hyperhelp.header
    - match: '$'
      set: main
  body:
    - match: '{{key_binding}}'
      scope: variable.language meta.keybind
    - match: '{{code_markup}}'
      scope: markup.raw meta.code
    - match: '{{block_markup}}'
      push: code_block
    - match: '{{hyperlink}}'
      captures:
        1: storage punctuation.link.begin
        2: storage meta.link
        3: storage punctuation.link.end
    - match: '{{anchor}}'
      captures:
        1: string.unquoted punctuation.anchor.begin
        2: string.unquoted meta.anchor
        3: string.unquoted punctuation.anchor.end
    - match: '{{hidden_anchor}}'
      captures:
        1: string.unquoted punctuation.anchor.begin
        2: string.unquoted meta.anchor.hidden
        3: string.unquoted punctuation.anchor.end
    - match: '{{separator}}'
      scope: storage.what meta.separator
  code_block:
    - meta_scope: markup.raw meta.code
    - match: '{{block_markup}}'
      pop: true<commit_msg>Include some experimental syntax changes<commit_after>%YAML 1.2
---
name: Help
scope: text.hyperhelp.help
first_line_match: '^%hyperhelp'
hidden: true
variables:
  key_binding: '<[^> ]*>[^> ]?>?'
  inline_code_markup: '(`)([^`]*)(`)'
  block_markup: '^\s*(`{3,})(?![^`]*`)'
  block_markup_end: '^\s*(\1)\s*$'
  hyperlink: '(\|)([^|\* \x{00a0}][^|\* ]*)(\|)'
  anchor: '(\*)([^*\| \x{00a0}][^*\| ]*)(\*)'
  hidden_anchor: '(\*\|)([^\*\|\t \x{00a0}][^*\| ]*)(\|\*)'
  separator: '(?:\+?([=-])\1{3,}(\+|\|)?)|(?:\|\x{00a0})|(?:\x{00a0}\|)'
  author_header: '^(%)(hyperhelp)'
  header_keypair: <KEY>
  expanded_header: '^{{anchor}}\s+(.*)\s{2,}(.*)'

contexts:
  main:
    - match: '{{author_header}}'
      captures:
        1: punctuation.definition.directive
        2: keyword.other.directive meta.directive
      push: header_keypairs
    - match: '{{expanded_header}}'
      captures:
        1: string.unquoted punctuation.anchor.begin
        2: string.unquoted meta.anchor
        3: string.unquoted punctuation.anchor.end
        4: storage.type.class meta.title
        5: variable.language meta.date
      set: body
    - match: ''
      set: body
  header_keypairs:
    - match: '{{header_keypair}}'
      captures:
        1: storage.type.class meta.key
        2: keyword.operator
        3: string.quoted.double
        4: string.quoted.double meta.value
        5: string.quoted.double
    - match: '\S'
      scope: invalid.illegal.hyperhelp.header
    - match: '$'
      set: main
  body:
    - match: '{{key_binding}}'
      scope: variable.language meta.keybind
    - match: '{{block_markup}}(json).*$\n?'
      captures:
        0: meta.code-fence.definition.begin.json
        1: punctuation.definition.code-fence.begin.json
        2: constant.other.language-name
      embed: scope:source.json
      embed_scope: markup.raw.code-fence.json
      escape: '{{block_markup_end}}'
      escape_captures:
        0: meta.code-fence.definition.end.json
        1: punctuation.definition.code-fence.end.json
    - match: '{{block_markup}}(python|py).*$\n?'
      captures:
        0: meta.code-fence.definition.begin.python
        1: punctuation.definition.code-fence.begin.python
        2: constant.other.language-name
      embed: scope:source.python
      embed_scope: markup.raw.code-fence.python
      escape: '{{block_markup_end}}'
      escape_captures:
        0: meta.code-fence.definition.end.python
        1: punctuation.definition.code-fence.end.python
    - match: '{{block_markup}}(xml|plist).*$\n?'
      captures:
        0: meta.code-fence.definition.begin.xml
        1: punctuation.definition.code-fence.begin.xml
        2: constant.other.language-name
      embed: scope:text.xml
      embed_scope: markup.raw.code-fence.xml
      escape: '{{block_markup_end}}'
      escape_captures:
        0: meta.code-fence.definition.end.xml
        1: punctuation.definition.code-fence.end.xml
    - match: '{{block_markup}}([\w-]*).*$\n?'
      captures:
        0: meta.code-fence.definition.begin
        1: punctuation.definition.code-fence.begin
        2: constant.other.language-name
      push:
        - meta_content_scope: markup.raw.code-fence
        - match: '{{block_markup_end}}'
          captures:
            0: meta.code-fence.definition.end
            1: punctuation.definition.code-fence.end
          pop: true
    - match: '{{inline_code_markup}}'
      captures:
        1: punctuation.definition.raw.begin
        2: markup.raw.inline
        3: punctuation.definition.raw.end
    - match: '{{hyperlink}}'
      captures:
        1: storage punctuation.link.begin
        2: storage meta.link
        3: storage punctuation.link.end
    - match: '{{anchor}}'
      captures:
        1: string.unquoted punctuation.anchor.begin
        2: string.unquoted meta.anchor
        3: string.unquoted punctuation.anchor.end
    - match: '{{hidden_anchor}}'
      captures:
        1: string.unquoted punctuation.anchor.begin
        2: string.unquoted meta.anchor.hidden
        3: string.unquoted punctuation.anchor.end
    - match: '{{separator}}'
      scope: storage.what meta.separator
{'fraction_non_alphanumeric': 0.18006530866117246, 'fraction_numerical': 0.016638158917742188, 'mean_word_length': 2.526315789473684, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '5888287', 'n_tokens_mistral': 2298, 'n_tokens_neox': 2228, 'n_words': 380}