Support titles in YAML front matter
See original GitHub issueHello,
I’ve problem running Marksman under SublimeText, iow. auto-completion for [[Wikilink]]
does not work and here is the output in the ST’s log panel:
:: --> marksman initialize(1): {'rootUri': 'file:///home/gour/tpnote', 'workspaceFolders': [{'uri': 'file:///home/gour/tpnote', 'name': 'tpnote'}], 'processId': 20550, 'rootPath': '/home/gour/tpnote', 'clientInfo': {'version': '1.20.0', 'name': 'Sublime Text LSP'}, 'initializationOptions': {}, 'capabilities': {'workspace': {'workspaceEdit': {'failureHandling': 'abort', 'documentChanges': True}, 'didChangeConfiguration': {'dynamicRegistration': True}, 'codeLens': {'refreshSupport': True}, 'semanticTokens': {'refreshSupport': True}, 'inlayHint': {'refreshSupport': True}, 'workspaceFolders': True, 'executeCommand': {}, 'applyEdit': True, 'configuration': True, 'symbol': {'symbolKind': {'valueSet': [10, 11, 24, 9, 3, 5, 15, 21, 1, 18, 17, 19, 6, 2, 14, 7, 25, 20, 4, 16, 12, 23, 26, 8, 13, 22]}, 'dynamicRegistration': True, 'tagSupport': {'valueSet': [1]}}}, 'textDocument': {'completion': {'dynamicRegistration': True, 'completionItemKind': {'valueSet': [13, 14, 8, 23, 4, 7, 12, 5, 1, 17, 15, 2, 9, 21, 11, 10, 24, 19, 3, 22, 25, 6, 18, 16, 20]}, 'completionItem': {'snippetSupport': True, 'insertTextModeSupport': {'valueSet': [2]}, 'resolveSupport': {'properties': ['detail', 'documentation', 'additionalTextEdits']}, 'labelDetailsSupport': True, 'documentationFormat': ['markdown', 'plaintext'], 'deprecatedSupport': True, 'insertReplaceSupport': True, 'tagSupport': {'valueSet': [1]}}, 'insertTextMode': 2}, 'formatting': {'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'synchronization': {'dynamicRegistration': True, 'willSave': True, 'willSaveWaitUntil': True, 'didSave': True}, 'colorProvider': {'dynamicRegistration': True}, 'semanticTokens': {'formats': ['relative'], 'multilineTokenSupport': True, 'tokenTypes': ['enumMember', 'enum', 'type', 'interface', 'event', 'namespace', 'class', 'string', 'parameter', 'method', 'property', 'operator', 'comment', 'keyword', 'number', 'modifier', 'regexp', 'function', 'struct', 'typeParameter', 'variable', 'macro', 'decorator'], 'dynamicRegistration': True, 'augmentsSyntaxTokens': True, 'overlappingTokenSupport': False, 'tokenModifiers': ['abstract', 'definition', 'readonly', 'deprecated', 'modification', 'defaultLibrary', 'declaration', 'documentation', 'async', 'static'], 'requests': {'range': True, 'full': {'delta': True}}}, 'typeDefinition': {'dynamicRegistration': True, 'linkSupport': True}, 'implementation': {'dynamicRegistration': True, 'linkSupport': True}, 'documentSymbol': {'symbolKind': {'valueSet': [10, 11, 24, 9, 3, 5, 15, 21, 1, 18, 17, 19, 6, 2, 14, 7, 25, 20, 4, 16, 12, 23, 26, 8, 13, 22]}, 'dynamicRegistration': True, 'hierarchicalDocumentSymbolSupport': True, 'tagSupport': {'valueSet': [1]}}, 'codeLens': {'dynamicRegistration': True}, 'inlayHint': {'dynamicRegistration': True, 'resolveSupport': {'properties': ['textEdits', 'label.command']}}, 'rangeFormatting': {'dynamicRegistration': True}, 'signatureHelp': {'signatureInformation': {'parameterInformation': {'labelOffsetSupport': True}, 'activeParameterSupport': True, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': True, 'contextSupport': True}, 'definition': {'dynamicRegistration': True, 'linkSupport': True}, 'codeAction': {'dataSupport': True, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source.fixAll', 'source.organizeImports']}}, 'dynamicRegistration': True, 'isPreferredSupport': True, 'resolveSupport': {'properties': ['edit']}, 'disabledSupport': True}, 'rename': {'prepareSupport': True, 'dynamicRegistration': True}, 'hover': {'dynamicRegistration': True, 'contentFormat': ['markdown', 'plaintext']}, 'documentLink': {'dynamicRegistration': True, 'tooltipSupport': True}, 'selectionRange': {'dynamicRegistration': True}, 'publishDiagnostics': {'dataSupport': True, 'relatedInformation': True, 'codeDescriptionSupport': True, 'versionSupport': True, 'tagSupport': {'valueSet': [2, 1]}}, 'references': {'dynamicRegistration': True}, 'declaration': {'dynamicRegistration': True, 'linkSupport': True}}, 'general': {'markdown': {'version': '3.2.2', 'parser': 'Python-Markdown'}, 'regularExpressions': {'engine': 'ECMAScript'}}, 'window': {'workDoneProgress': True, 'showDocument': {'support': True}, 'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}}}}
marksman: [11:31:36 INF] <LSP Entry> Starting Marksman LSP server: {}
:: <<< marksman 1: {'capabilities': {'renameProvider': {'prepareProvider': True}, 'hoverProvider': True, 'referencesProvider': True, 'documentSymbolProvider': True, 'completionProvider': {'triggerCharacters': ['[', '#', '(']}, 'workspace': {'fileOperations': {'didDelete': {'filters': [{'pattern': {'glob': '**/*.md', 'options': {'ignoreCase': True}, 'matches': 'file'}}]}, 'didCreate': {'filters': [{'pattern': {'glob': '**/*.md', 'options': {'ignoreCase': True}, 'matches': 'file'}}]}}, 'workspaceFolders': {'changeNotifications': True, 'supported': True}}, 'textDocumentSync': {'change': {'syncKind': 2}, 'didClose': {}, 'didOpen': {}}, 'codeActionProvider': {'resolveProvider': False}, 'definitionProvider': True, 'semanticTokensProvider': {'legend': {'tokenTypes': ['property', 'variable'], 'tokenModifiers': []}, 'range': True, 'full': {'delta': False}}, 'workspaceSymbolProvider': True}}
:: -> marksman initialized: {}
:: -> marksman textDocument/didOpen: {'textDocument': {'version': 15, 'uri': 'file:///home/gour/tpnote/first.md', 'languageId': 'markdown', 'text': '---\ntitle: "First Note"\ntags: ["test"]\n---\n\nThis is a first note with a link to the 2nd one: \n'}}
:: --> marksman textDocument/hover(2): {'position': {'character': 49, 'line': 5}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}}
:: --> marksman textDocument/codeAction(3): {'context': {'diagnostics': [], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 49, 'line': 5}, 'start': {'character': 49, 'line': 5}}}
:: <<< marksman 2: None
:: <<< marksman 3: []
:: -> marksman textDocument/didChange: {'contentChanges': [{'text': '[]', 'range': {'end': {'character': 49, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'rangeLength': 0}], 'textDocument': {'version': 16, 'uri': 'file:///home/gour/tpnote/first.md'}}
:: -> marksman textDocument/didChange: {'contentChanges': [{'text': '[]', 'range': {'end': {'character': 50, 'line': 5}, 'start': {'character': 50, 'line': 5}}, 'rangeLength': 0}], 'textDocument': {'version': 17, 'uri': 'file:///home/gour/tpnote/first.md'}}
:: <- marksman textDocument/publishDiagnostics: {'diagnostics': [{'message': "Link to non-existent document with the title ''", 'code': '2', 'range': {'end': {'character': 53, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'uri': 'file:///home/gour/tpnote/first.md'}
:: --> marksman textDocument/codeAction(4): {'context': {'diagnostics': [{'message': "Link to non-existent document with the title ''", 'code': '2', 'range': {'end': {'character': 53, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 53, 'line': 5}, 'start': {'character': 49, 'line': 5}}}
:: <<< marksman 4: []
:: -> marksman textDocument/didChange: {'contentChanges': [{'text': 's', 'range': {'end': {'character': 51, 'line': 5}, 'start': {'character': 51, 'line': 5}}, 'rangeLength': 0}], 'textDocument': {'version': 18, 'uri': 'file:///home/gour/tpnote/first.md'}}
:: <- marksman textDocument/publishDiagnostics: {'diagnostics': [{'message': "Link to non-existent document with the title 's'", 'code': '2', 'range': {'end': {'character': 54, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'uri': 'file:///home/gour/tpnote/first.md'}
:: --> marksman textDocument/codeAction(5): {'context': {'diagnostics': [{'message': "Link to non-existent document with the title 's'", 'code': '2', 'range': {'end': {'character': 54, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 54, 'line': 5}, 'start': {'character': 49, 'line': 5}}}
:: <<< marksman 5: []
:: -> marksman textDocument/didChange: {'contentChanges': [{'text': 'e', 'range': {'end': {'character': 52, 'line': 5}, 'start': {'character': 52, 'line': 5}}, 'rangeLength': 0}], 'textDocument': {'version': 19, 'uri': 'file:///home/gour/tpnote/first.md'}}
:: <- marksman textDocument/publishDiagnostics: {'diagnostics': [{'message': "Link to non-existent document with the title 'se'", 'code': '2', 'range': {'end': {'character': 55, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'uri': 'file:///home/gour/tpnote/first.md'}
:: --> marksman textDocument/codeAction(6): {'context': {'diagnostics': [{'message': "Link to non-existent document with the title 'se'", 'code': '2', 'range': {'end': {'character': 55, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 55, 'line': 5}, 'start': {'character': 49, 'line': 5}}}
:: <<< marksman 6: []
:: -> marksman textDocument/didChange: {'contentChanges': [{'text': 'c', 'range': {'end': {'character': 53, 'line': 5}, 'start': {'character': 53, 'line': 5}}, 'rangeLength': 0}], 'textDocument': {'version': 20, 'uri': 'file:///home/gour/tpnote/first.md'}}
:: <- marksman textDocument/publishDiagnostics: {'diagnostics': [{'message': "Link to non-existent document with the title 'sec'", 'code': '2', 'range': {'end': {'character': 56, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'uri': 'file:///home/gour/tpnote/first.md'}
:: --> marksman textDocument/codeAction(7): {'context': {'diagnostics': [{'message': "Link to non-existent document with the title 'sec'", 'code': '2', 'range': {'end': {'character': 56, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 56, 'line': 5}, 'start': {'character': 49, 'line': 5}}}
:: <<< marksman 7: []
:: --> marksman textDocument/codeAction(8): {'context': {'diagnostics': [{'message': "Link to non-existent document with the title 'sec'", 'code': '2', 'range': {'end': {'character': 56, 'line': 5}, 'start': {'character': 49, 'line': 5}}, 'severity': 1, 'source': 'Marksman'}], 'triggerKind': 2}, 'textDocument': {'uri': 'file:///home/gour/tpnote/first.md'}, 'range': {'end': {'character': 0, 'line': 6}, 'start': {'character': 0, 'line': 0}}}
:: <<< marksman 8: []
Below are my two test files…
Any hint?
Issue Analytics
- State:
- Created 10 months ago
- Reactions:2
- Comments:14 (5 by maintainers)
Top Results From Across the Web
YAML Front Matter
For example, the following markdown file uses YAML front matter to define meta data like title, category, tags, etc. --- title: YAML Front ......
Read more >YAML front matter | Assemble
YAML front matter ... YFM is an optional section of valid YAML that is placed at the top of a page and is...
Read more >YAML Frontmatter
A YAML frontmatter is a series of meta variables that can be defined to describe information of the file that normally is not...
Read more >Use YAML Front Matter Correctly in Obsidian - Amy Li - Medium
Although Obsidian only natively supports metadata from tags, aliases, CSS class, and publish, we can define whatever metadata we want in YAML.
Read more >Front Matter | Jekyll • Simple, blog-aware, static sites
Any file that contains a YAML front matter block will be processed by Jekyll as a special file. The front matter must be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also would like to be able to link to titles in front matter.
@artempyanykh , I think @fisher-j described it well.
The thing is that several note/doc/blog systems using MarkDown – Pandoc and Pelican to name just two – already use
tags:
andkeywords:
in the YAML front matter. In Pandoc’s example, if you generate a PDF (through e.g. LaTeX), it will store the keywords into PDF metadata.So, if we’re already re-using YAML front matter, re-using the tags may make sense too.
For inspiration perhaps see how Pandoc handles the YAML metadata block.