From fe33f74aafb85a06a4e6ccda818996c341552f6d Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Sat, 4 Jul 2026 12:23:25 -0400 Subject: [PATCH] chore!: upgrade mdex to 0.13 If a Tableau blog uses MDEx syntax highlighting, the latest version of MDEx has breaking changes to how syntax highlighting works and your blog configuration must be modified for it to continue working. There are two supported syntax highlighters: Lumis (tree-sitter) and Syntect (Sublime Text grammars). Tableau includes the Lumis syntax highlighter package, but it is not fully configured without modification to the blog `config/config.exs` for selecting the appropriate syntax highlighting NIF: ```elixir config :mdex_native, syntax_highlighter: :lumis config :mdex_native, syntax_highlighter: :syntect ``` The MDEx options configuration must also be updated: ```diff render: [unsafe: true], syntax_highlight: [ - formatter: {:html_inline, theme: "neovim_dark"} + engine: :lumis, + opts: [formatter: {:html_inline, theme: "neovim_dark"}] ], plugins: [MDExGFM] ``` More details for each syntax highlighter can be found at https://mdex.hexdocs.pm/lumis.html or https://mdex.hexdocs.pm/syntect.html. --- lib/tableau.ex | 7 ++++++- mix.exs | 3 ++- mix.lock | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/tableau.ex b/lib/tableau.ex index 49c2ff4..3531de1 100644 --- a/lib/tableau.ex +++ b/lib/tableau.ex @@ -19,6 +19,8 @@ defmodule Tableau do import Config + config :mdex_native, syntax_highlighter: :lumis + config :tableau, :config, url: "http://localhost:8080", timezone: "America/Indiana/Indianapolis", @@ -41,7 +43,10 @@ defmodule Tableau do footnotes: true ], render: [unsafe: true], - syntax_highlight: [formatter: {:html_inline, theme: "neovim_dark"}], + syntax_highlight: [ + engine: :lumis, + opts: [formatter: {:html_inline, theme: "neovim_dark"}] + ], plugins: [MDExGFM] ] ] diff --git a/mix.exs b/mix.exs index 77b4045..dfd3cff 100644 --- a/mix.exs +++ b/mix.exs @@ -37,7 +37,8 @@ defmodule Tableau.MixProject do {:date_time_parser, "~> 1.2"}, {:html_entities, "~> 0.5.2"}, {:libgraph, "~> 0.16.0"}, - {:mdex, "~> 0.11.1"}, + {:lumis, "~> 0.6.0"}, + {:mdex, "~> 0.13.3"}, {:schematic, "~> 0.5.1"}, {:slugify, "~> 1.3"}, {:tz, "~> 0.28.1"}, diff --git a/mix.lock b/mix.lock index 7c899a1..7635fae 100644 --- a/mix.lock +++ b/mix.lock @@ -14,7 +14,7 @@ "makeup": {:hex, :makeup, "1.2.2", "882d46dc0905e9ff7abf2aab61a7e6b3dcc555533977d8a23b06019e6c89ac94", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "9a1a24e5b343b8ae16abea0822c10a6f75da27af7fa802ada5251f7579bfccfa"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, "makeup_erlang": {:hex, :makeup_erlang, "1.1.0", "835f7e60792e08824cda445639555d7bf1bbbddb1b60b306e33cb6f6db24dc74", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "1cd6780fb1dd1a03979abaed0fe82712b0625118fd5257d3ebbf73f960c73c3c"}, - "mdex": {:hex, :mdex, "0.11.7", "583b35c7160c4e26deab6233f967669d51de6f8b5f7b605adc55037abf7a20d2", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:lumis, "~> 0.1", [hex: :lumis, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:rustler, "~> 0.32", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.7", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "6dac3deb3ecb1a0a5ac9f383c9c57e46510b0a519e6fb21883d9ead34d0e4ffd"}, + "mdex": {:hex, :mdex, "0.13.3", "3fe9f351e9940fc69116e08b0a512a44dc90973186a10671dab1433a0fabd6ca", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:lumis, "~> 0.1", [hex: :lumis, repo: "hexpm", optional: true]}, {:mdex_native, ">= 0.2.4", [hex: :mdex_native, repo: "hexpm", optional: false]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}], "hexpm", "e970a6e323b46c14af5926cb1fbfa855aba782394abc3b7deb99d849f47412de"}, "mdex_native": {:hex, :mdex_native, "0.2.4", "a74b9d799d3fc487b1f97b70ee9b04108c7af0514920d56828e173d19312c2a9", [:mix], [{:rustler, "~> 0.32", [hex: :rustler, repo: "hexpm", optional: true]}, {:rustler_precompiled, "~> 0.7", [hex: :rustler_precompiled, repo: "hexpm", optional: false]}], "hexpm", "d71185c43c5209c6939f4b65f903f71c892512c93ea6843171227855d2d976f5"}, "mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"}, "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},