Skip to content
forked from leandrocp/autumn

Syntax highlighter for source code parsed with Tree-Sitter and styled with Helix Editor themes.

License

Notifications You must be signed in to change notification settings

paradox460/autumn

 
 

Repository files navigation

Autumn

Autumn logo

Syntax highlighter for source code parsed with Tree-Sitter and styled with Helix Editor themes.

Hex Version Hex Docs MIT

Features

Installation

Add :autumn dependency:

def deps do
  [
    {:autumn, "~> 0.1"}
  ]
end

Usage

Autumn.highlight!("elixir", "Atom.to_string(:elixir)") |> IO.puts()
#=> <pre class="autumn highlight" style="background-color: #282C34; color: #ABB2BF;">
#=> <code class="language-elixir" translate="no">
#=> <span class="namespace" style="color: #61AFEF;">Atom</span><span class="operator" style="color: #C678DD;">.</span><span class="function" style="color: #61AFEF;">to_string</span><span class="" style="color: #ABB2BF;">(</span><span class="string" style="color: #98C379;">:elixir</span><span class="" style="color: #ABB2BF;">)</span>
#=> </code></pre>

Autumn.highlight!("rb", "Math.sqrt(9)", theme: "dracula") |> IO.puts()
#=> <pre class="autumn highlight" style="background-color: #282A36; color: #f8f8f2;">
#=> <code class="language-ruby" translate="no">
#=> <span class="constructor" style="color: #BD93F9;">Math</span><span class="punctuation delimiter" style="color: #f8f8f2;">.</span><span class="function method" style="color: #50fa7b;">sqrt</span><span class="punctuation bracket" style="color: #f8f8f2;">(</span><span class="constant numeric" style="color: #BD93F9;">9</span><span class="punctuation bracket" style="color: #f8f8f2;">)</span>
#=> </code></pre>

Samples

Visit https://autumn-30n.pages.dev to see all available samples like the ones below:

Elixir source code in onedark theme

Elixir source code in github_light theme

Looking for help with your Elixir project?

DockYard logo

At DockYard we are ready to help you build your next Elixir project. We have a unique expertise in Elixir and Phoenix development that is unmatched and we love to write about Elixir.

Have a project in mind? Get in touch!

Acknowledgements

About

Syntax highlighter for source code parsed with Tree-Sitter and styled with Helix Editor themes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 89.4%
  • Rust 9.7%
  • Elixir 0.9%