%YAML 1.2 --- # Open Shownotes Format Syntax Highlighting for Sublime. # # 2018 by Tim Pommerening # A very simple Syntax Highlighting for Sublime and the Open Shownotes Format (osf). # The syntax highlighting may not cover the complete OSF specification. # It was done to fit my needs. # # Open Shownotes Format: https://github.com/shownotes/OpenShownotesFormat # Syntax: See http://www.sublimetext.com/docs/3/syntax.html # Colors: See https://github.com/cj/sublime/blob/master/Color%20Scheme%20-%20Default/Monokai.tmTheme # name: Open Shownotes Format (osf) file_extensions: - osf scope: source.osf variables: timecode: '^([0-9]){2}(:[0-9]{2}){2}(\.[0-9]{0,3})?' ux_timestamp: '^[0-9]+' chaptername: '(.*) (?=\#(c|chapter)($|\b))' chaptertag: '(\#c(hapter)?)($|\b)' url: '[[:word:]]+:\/\/\S+(?=>)' placeholder_url: '.*(?=>)' contexts: main: # Header - match: '\[(/)?header\]' scope: comment # Timecode at Chapters - match: '\b({{timecode}}|{{ux_timestamp}})\b(?=.*\#c)' scope: keyword push: chapter # Chapter Name (for use without timecode) - match: '{{chaptername}}' scope: storage.type # Chapter Tag #c - match: '{{chaptertag}}' scope: constant.language pop: true # Timecode at other entries - match: '\b({{timecode}}|{{ux_timestamp}})\b(?=.*\#)' scope: entity.name.class # Other tags #other Tags - match: '( \#[[:word:]]+)+' scope: string # Other tags #other Tags - match: '( \#.*+)+' scope: invalid # First indention - - match: '^(-)+ ' scope: entity.name.class # Begin of Link - match: '\<(?=.*?\>)' scope: entity.name.class push: link chapter: # Chapter Name - match: '{{chaptername}}' scope: storage.type # Chapter Tag #c - match: '{{chaptertag}}' scope: constant.language pop: true link: # Valid URL - match: '{{url}}' scope: variable.parameter # Invalid URL (placeholder) - match: '{{placeholder_url}}' scope: invalid - match: '\>' scope: entity.name.class pop: true