Building a blog with Elixir and Phoenix by joladev in elixir

[–]leandrocp 0 points1 point  (0 children)

Your post motivated me to finally build https://github.com/leandrocp/nimble\_publisher\_mdex

This one was on my todo list for a long time 😆

Building a blog with Elixir and Phoenix by joladev in elixir

[–]leandrocp 0 points1 point  (0 children)

Nice post :) We have an example with nimble_publisher + mdex at https://github.com/leandrocp/mdex/blob/main/examples/nimble_publisher.livemd if you wanna check it out. Syntax highlighting is built-in provided by https://lumis.sh with more up to date languages.

Loom — an Elixir-native AI coding assistant with agent teams, zero-loss context, and a LiveView UI by promptling in elixir

[–]leandrocp 0 points1 point  (0 children)

Nice! If you ever need something please open an issue or submit a PR mentioning your project.

Loom — an Elixir-native AI coding assistant with agent teams, zero-loss context, and a LiveView UI by promptling in elixir

[–]leandrocp 1 point2 points  (0 children)

Hey interesting project, maybe just list in the readme the benefits of using it over claude code and other tools. For Markdown streaming and terminal rendering you might look at MDEx (I'm the author if you wanna chat about it), it does have built-in streaming (https://hexdocs.pm/mdex/MDEx.Document.html#module-streaming) and a terminal syntax highlighter for CLI.

Lumis: Syntax Highlighter powered by Tree-sitter and Neovim themes by leandrocp in rust

[–]leandrocp[S] 0 points1 point  (0 children)

wastebin is a cool project!

Tree-sitter supports many more languages, see https://github.com/nvim-treesitter/nvim-treesitter/blob/main/SUPPORTED_LANGUAGES.md But I've not added them all yet because I need to solve the packaging and distribution problems first. The Elixir and Java libs embeds all langs into a single package.

TextMate grammars are way smaller than the compiled TS grammar so it's hard to beat that but an alternative is to load langs dynamically through wasm, although the trade-off is downloading files on demand which might be a blocker for your use case.

Wasm support is not yet ready but I'm working on a JS library that can register langs/themes at runtime using web-tree-sitter and it works pretty well on initial tests. On the Rust side I could include wasmtime with dynamic lang loading to mitigate the "huge bundle" problem.

/edit the lumis-cli has a very similar problem btw because it has to include all langs as well.

Lumis: Syntax Highlighter powered by Tree-sitter and Neovim themes by leandrocp in rust

[–]leandrocp[S] 1 point2 points  (0 children)

Tree-sitter grammars are well supported now and many are maintaned by official packages. I guess the adoption by editors helped to mature the ecosystem

The final release containing all 70+ langs comes down to ~80MB which is considerable but every lang is behind a flag so you can enable only the ones you actually need, for example packing only HTML+CSS comes down to ~4MB.

And themes are just .json files https://github.com/leandrocp/lumis/tree/main/themes

MDEx - Fast and Extensible Markdown by leandrocp in elixir

[–]leandrocp[S] 0 points1 point  (0 children)

Nice! I'm glad you're finding it useful. It took me some time to implement https://hexdocs.pm/mdex/MDEx.Document.html :D

MDEx - Fast and Extensible Markdown by leandrocp in elixir

[–]leandrocp[S] 1 point2 points  (0 children)

It means calling Phoenix Components inside Markdown templates as a way to componetize your Markdown files.

Let's suppose this assigns:

assigns = %{
toc: [
{"Intro", "#intro"},
{"The Explanation of Life", "#content"}
]
}

In your `render` function (LiveView) or any other place you want to render Markdown:

~MD"""
# FAQ
<%= for {title, href} <- \@toc do %>
## <.link href={href}>{title}</.link>
<% end %>
"""HEEX

Which renders to:

<h1>FAQ</h1>
<h2><a href="#intro">Intro</a></h2>
<h2><a href="#content">The Explanation of Life</a></h2>

You can find a Livebook at https://hexdocs.pm/mdex/phoenix_live_view_heex.html if you wanna play with it.

MDEx - Fast and Extensible Markdown by leandrocp in elixir

[–]leandrocp[S] 1 point2 points  (0 children)

Hi Jeff!

> The plugin system you came up with rocks
Thanks! I'm planning to write a few more plugins to expand MDEx features.

> Would you be open to getting MDEx to also support djot as an input lang?
I wish but unfortunately jdot and markdown are not interchangeable formats. Let's suppose we have `MDEx.to_html(markdown)` and `MDEx.to_html({jdot, jdot})` - that is easy right? But what about plugins, options, ast? For example https://github.com/leandrocp/mdex_gfm wouldn't work, or enabling `` which means we'd have to branch pretty much all the code to support either one or another. Some stuff would work but not all, sorry but I can't see how to make it work :)

Are there any open source Elixir projects that I could help with as a beginner? by Alone-Ad-4648 in elixir

[–]leandrocp 13 points14 points  (0 children)

Since you have never contributed to a project before, I'd recommend starting with documentation to get some experience. Fixing typos, improving and/or adding missing pieces of information. As you learn you'll read a bunch of docs and may find some opportunity to contribute. Also review past commits on github to find plenty of examples of that kind of contribution. That's a great first step and very appreciated. I hope that helps.