axelson

axelson

Scenic Core Team

Elixir hexdocs doesn't find expected results for some searches

I’ve been working on some code using macros today and I’ve come across a few searches on the elixir hexdocs that feel like they really should have results instead of their current no results pages.

Here are the searches and what I think they should point to:

“__using__”

“after_compile”

I searched on the current 1.17.1 docs. Here are the screenshots:


It’s pretty frustrating knowing these concepts exist but not being able to find the specifics in the docs. Are there any previous examples of updating the docs to make specific searches like these possible?

Marked As Solved

josevalim

josevalim

Creator of Elixir

@axelson all of those issues are related to the search engine. The search engine would tokenize by splitting on _ and -, which means __using__ is simply using. I have fixed that issue and the one by @Nicd.

After compile works if you search it as @after_compile, I will try to see if we can make it work as after_compile only.

Also Liked

Nicd

Nicd

Now that you opened the discussion, there’s one issue that I just haven’t bothered filing a bug for yet. If you access a search URL directly or just press enter when writing a Module.function type search, like https://hexdocs.pm/elixir/search.html?q=Process.monitor (clickable link), it will show you no results. But if you click on the search bar, the autocomplete will show the results you wanted. It seems the autocomplete is smarter than the actual search engine.

Edit: Well, decided to file that issue: Autocomplete returns results that the actual search doesn't · Issue #1930 · elixir-lang/ex_doc · GitHub

D4no0

D4no0

Topics related to metaprogramming in general are divided into different sections and are hard to find even to this day.

I would personally recommend reading the book Metaprogramming Elixir by Chris McCord, you will find there a lot of things you were missing before, I always find myself returning to it because honestly I cannot find stuff on hexdocs just as you pointed out.

A simple example of hidden things is the @external_resource attribute that can recompile the source file based on an external file change, quite useful even for some generic use-cases that are not leaning heavily into metaprogramming.

axelson

axelson

Scenic Core Team

Thanks Jose! That’s a great improvement!

Where Next?

Popular in Questions Top

LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
mgjohns61585
Could someone help me? I'm making my first elixir program, number guessing game. I can't figure out how to convert the user's guess from ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New

Other popular topics Top

bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement