I’ve held out as long as possible. I cannot solve this issue despite pouring over endless forum posts and other resources. I’m trying to extend Markdown syntax so that a niche feature of pandoc’s “fenced_divs” extension are scoped. Specifically, I want
::::::::::{.columns}
::: column
* a two-column list
* with all default markdown scopes
:::
::: column
* like *italics* and **bold** or x^2^ or ~~this~~
* to apply
::::::::::
I write a lot in markdown and use pandoc to convert .md to .pptx, which enables setting two-column text in the slides. I want to be able to style the markup within the column blocks, if i want, and i want to be able to style the column blocks themselves, so that I can subject them to code folding, for example, or different highlight. My syntax file is below. One thing I know, though, is that the patience of forum users is generous, for which i’m thankful.
%YAML 1.2
---
# https://forum.sublimetext.com/t/additional-markdown-context-hugo-sites/65054/12
# https://forum.sublimetext.com/t/syntax-inheritance-and-the-extends-key/66672/2
file_extensions:
- md
- Rmd
scope: text.md
#scope: text.html.markdown
#scope: text.html.markdown.pptx
version: 2
name: Markdown PPTX
extends: Packages/Markdown/Markdown.sublime-syntax
contexts:
markdown:
- meta_prepend: true
- include: pptx-columns
# New context for a columns block
pptx-columns:
#- match: '^{10,}\{\s*\.columns\s*\}\s*$'
- match: '^::::::::::{.columns}$'
#scope: meta.tag.pptx.columns.begin
scope: text.html.columns-begin.markdown.pptx
push: columns-container-content
# Context for the content inside a columns container.
columns-container-content:
# Recognize the start of a column block.
- match: '^::: column$'
push: column-block
# Recognize the closing of the columns container.
- match: '^::::::::::$'
pop: true
# For any other content, include the parent Markdown rules.
- include: Packages/Markdown/Markdown.sublime-syntax
column-block:
- meta_scope: meta.block.column.markdown
# Embed the full Markdown syntax for the content within a column.
escape: '^:::$'
pop: true