Git Product home page Git Product logo

autumn's People

Contributors

leandrocp avatar paradox460 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

paradox460

autumn's Issues

Explore Zed languages and themes

For syntax highlight to work, it must load a language grammar that defines all scopes for each source code token that matches a class in the CSS theme file.

Currently we rely on Helix language definitions and themes which means we depend on Helix's project to maintain those files in order to generate the right colors at the end of the day.

For example the Elixir grammar defines a @namespace scope even though the official grammar doesn't define such scope. That means all themes must consider that scope to highlight Elixir code properly, otherwise Autumn fallbacks to the foreground color. For example the Dracula theme doesn't define that scope and will render a white text where you'd expect to see some color (module names), see https://autumn-30n.pages.dev/elixir_dracula

This approach saves a bunch of time but on the other hand brings the problem explained above. The fix to this problem could be:

  • Fix the language/theme upstream (helix repo)
  • Use the official tree-sitter grammar instead of Helix's - some languages take this approach but it causes mismatches with the themes in Helix
  • Fork languages/themes in Autumn to apply specific fixes

While those fixes are doable, another approach is loading Zed languages and themes since those seems to be more updated and renders colors more accurately. The downside is that Zed doesn't support all languages we need at this moment, in special Swift that we use at https://dockyard.com/blog

To conclude, we would benefit having a mixed approach using Zed as the main source for languages/themes and fallback to Helix, until we can eventually drop Helix at all.

Lua doesn't seem to work

I noticed that lua doesn't seem to actually tokenize and render into anything.

example

┌─ 01:09:15 PM
│mitchell in 🌐 nublar in blog on  main [?⇡] via  v1.16.1 (OTP 26) took 36s
└─  iex
Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.16.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Mix.install [:autumn]
Resolving Hex dependencies...
Resolution completed in 0.066s
New:
  autumn 0.1.5
  castore 1.0.6
  rustler_precompiled 0.7.1
  toml 0.7.0
* Getting autumn (Hex package)
* Getting rustler_precompiled (Hex package)
* Getting toml (Hex package)
* Getting castore (Hex package)
==> toml
Compiling 10 files (.ex)
Generated toml app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> rustler_precompiled
Compiling 4 files (.ex)
Generated rustler_precompiled app
==> autumn
Compiling 5 files (.ex)

13:09:37.574 [debug] Downloading NIF from https://github.com/leandrocp/autumn/releases/download/v0.1.5/libinkjet_nif-v0.1.5-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz

13:09:38.365 [debug] NIF cached at /home/mitchell/.cache/rustler_precompiled/precompiled_nifs/libinkjet_nif-v0.1.5-nif-2.15-x86_64-unknown-linux-gnu.so.tar.gz and extracted to /home/mitchell/.cache/mix/installs/elixir-1.16.1-erts-14.2.2/0c46c564577fb109b3bf673cf29529d4/_build/dev/lib/autumn/priv/native/libinkjet_nif-v0.1.5-nif-2.15-x86_64-unknown-linux-gnu.so
Generated autumn app
:ok
iex(2)> Autumn.highlight!("lua", "os.foo({ foo = bar})", theme: "dracula") |> IO.puts()
<pre class="autumn highlight" style="background-color: #282A36; color: #f8f8f2;"><code class="language-lua" translate="no">os.foo({ foo = bar})</code></pre>
:ok
iex(3)>

not sure if this is an inket thing or an autumn thing tho.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.