Coder Social home page Coder Social logo

Comments (7)

josevalim avatar josevalim commented on July 17, 2024

You are right!

It is not supposed to matter though because the supervisor is meant to pass three arguments. In the last section of chapter 5 we have:

worker(KV.Registry, [@manager_name, @bucket_sup_name, [name: @registry_name]])

We are passing the wrong arguments but it doesn't matter because we are not accessing that application yet in tests.

So there is a bug but you were not supposed to see it. :) I will leave this open because you are the second person to comment on this, which means it is time to improve it.

from elixir-lang.github.com.

ccblaisdell avatar ccblaisdell commented on July 17, 2024

Aha, I suspected I was doing something wrong :) I definitely missed adding @bucket_sup_name into the worker call.

I've made errors like this several times while following this guide. In fact, I got so stuck on my first run through that I scrapped it and started over. Is it possible with Github to highlight the changed sections with a different color or background (for example), in addition to the comments? I find it difficult sometimes to see some of the changes when looking back and forth between the guide and my editor.

from elixir-lang.github.com.

josevalim avatar josevalim commented on July 17, 2024

@ccblaisdell I don't think we can highlight but I guess we could mark the sections that were change using comments?

## Changed the supervisor arguments

and so on?

from elixir-lang.github.com.

ccblaisdell avatar ccblaisdell commented on July 17, 2024

That would help me immensely. I know there's already plenty of that going on in the guide already, but even more documentation would be great.

from elixir-lang.github.com.

dbbrian avatar dbbrian commented on July 17, 2024

I'm probably not the first one to come up with it, but I have a (terrible) hack for that... Markdown allows HTML, and comments are valid HTML, so with something like this in the .markdown file:

<!-- data-emphasize-lines: 2, 4 -->
```elixir
defmodule Math do
  def sum(a, b) do
    a + b
  end
end

And a few lines of JS and CSS, make this:

before

Looks like this:

after

I may have used that kind of trick in prod. to embed some Google Maps things... 😁

from elixir-lang.github.com.

sircharleswatson avatar sircharleswatson commented on July 17, 2024

@dbbrian That's a good idea and I think it'd make things much clearer. is there any way to specify a different color maybe?

from elixir-lang.github.com.

dbbrian avatar dbbrian commented on July 17, 2024

@sircharleswatson Thanks! And sure, the CSS can be tweaked, or the code could be extended to support multiple data- attributes.

Or something really dirty like this:

<!-- data-emphasize-lines: 2#123456, 4#abcdef -->
```elixir
defmodule Math do
  def sum(a, b) do
    a + b
  end
end

It's just an hacky way to get metadata to the client, once you have it you can parse it, and use it however you need.

/cc @josevalim

from elixir-lang.github.com.

Related Issues (20)

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.