Skip to content

Commit fe33f74

Browse files
committed
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.
1 parent 9cc5777 commit fe33f74

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

lib/tableau.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ defmodule Tableau do
1919
2020
import Config
2121
22+
config :mdex_native, syntax_highlighter: :lumis
23+
2224
config :tableau, :config,
2325
url: "http://localhost:8080",
2426
timezone: "America/Indiana/Indianapolis",
@@ -41,7 +43,10 @@ defmodule Tableau do
4143
footnotes: true
4244
],
4345
render: [unsafe: true],
44-
syntax_highlight: [formatter: {:html_inline, theme: "neovim_dark"}],
46+
syntax_highlight: [
47+
engine: :lumis,
48+
opts: [formatter: {:html_inline, theme: "neovim_dark"}]
49+
],
4550
plugins: [MDExGFM]
4651
]
4752
]

mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ defmodule Tableau.MixProject do
3737
{:date_time_parser, "~> 1.2"},
3838
{:html_entities, "~> 0.5.2"},
3939
{:libgraph, "~> 0.16.0"},
40-
{:mdex, "~> 0.11.1"},
40+
{:lumis, "~> 0.6.0"},
41+
{:mdex, "~> 0.13.3"},
4142
{:schematic, "~> 0.5.1"},
4243
{:slugify, "~> 1.3"},
4344
{:tz, "~> 0.28.1"},

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"makeup": {:hex, :makeup, "1.2.2", "882d46dc0905e9ff7abf2aab61a7e6b3dcc555533977d8a23b06019e6c89ac94", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "9a1a24e5b343b8ae16abea0822c10a6f75da27af7fa802ada5251f7579bfccfa"},
1515
"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"},
1616
"makeup_erlang": {:hex, :makeup_erlang, "1.1.0", "835f7e60792e08824cda445639555d7bf1bbbddb1b60b306e33cb6f6db24dc74", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "1cd6780fb1dd1a03979abaed0fe82712b0625118fd5257d3ebbf73f960c73c3c"},
17-
"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"},
17+
"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"},
1818
"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"},
1919
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},
2020
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},

0 commit comments

Comments
 (0)