melston

melston

Programming Elixir > 1.6 (page 167)

After following the instructions pretty successfully up to this point I find I can’t do a mix docs with the configuration given. I’m not sure what to do to get Earmark to work in this case.

When I ran mix docs as shown on page 167 I got the following:

Generating docs...
** (FunctionClauseError) no function clause matching in EarmarkParser.Helpers.LookaheadHelpers.has_still_opening_backtix/2

    The following arguments were given to EarmarkParser.Helpers.LookaheadHelpers.has_still_opening_backtix/2:

        # 1
        [verbatim: "Handle the command line parsing and the dispatch to"]

        # 2
        nil

    Attempted function clauses (showing 8 out of 8):

        defp has_still_opening_backtix(-[]-, -:force_outside-)
        defp has_still_opening_backtix(-[]-, +open+)
        defp has_still_opening_backtix(-[{:other, _} | rest]-, +nil+)
        defp has_still_opening_backtix(-[{:backtix, btx} | rest]-, +nil+)
        defp has_still_opening_backtix(-[{:escape, _} | rest]-, +nil+)
        defp has_still_opening_backtix(+[_ | rest]+, -:force_outside-)
        defp has_still_opening_backtix(-[{:backtix, btx} | rest]-, -open = {_, openedbtx}-)
        defp has_still_opening_backtix(+[_ | rest]+, -open = {_, _}-)

    (earmark_parser 1.4.12) lib/earmark_parser/helpers/lookahead_helpers.ex:45: EarmarkParser.Helpers.LookaheadHelpers.has_still_opening_backtix/2
    (earmark_parser 1.4.12) lib/earmark_parser/helpers/lookahead_helpers.ex:17: EarmarkParser.Helpers.LookaheadHelpers.opens_inline_code/1
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:531: EarmarkParser.Parser._inline_or_text?/2
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:359: EarmarkParser.Parser._consolidate_para/3
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:165: EarmarkParser.Parser._parse/4
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:66: EarmarkParser.Parser.lines_to_blocks/3
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:60: EarmarkParser.Parser.parse_lines/3
    (earmark_parser 1.4.12) lib/earmark_parser/parser.ex:26: EarmarkParser.Parser.parse_markdown/2

I tried updating to the latest version of Earmark available but got the following when running mix docs:

...

== Compilation error in file lib/Issues/github_Issues.ex ==
** (Protocol.UndefinedError) protocol Enumerable not implemented for :info of type Atom
    (elixir 1.11.2) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.11.2) lib/enum.ex:141: Enumerable.reduce/3
    (elixir 1.11.2) lib/enum.ex:369: Enum.any?/2
    (logger 1.11.2) lib/logger.ex:1020: Logger.macro_log/4
    (logger 1.11.2) expanding macro: Logger.info/1
    lib/Issues/github_Issues.ex:11: Issues.GithubIssues.fetch/2

I can eliminate the last set of errors by commenting out the calls to Logger.debug and Logger.info.

First Post!

faust

faust

Hi, I know it’s a bit late to answer this, but I hope it might help someone else who faces the same situation.
I had the same problem, and the solution was to update the docs library.
I guess the ones in the book aren’t compatible with newer Elixir versions.

I ended up using:

{:ex_doc, "~> 0.29.1"},
{:earmark, "~> 1.4.33"},

Where Next?

Popular Pragmatic Bookshelf topics Top

johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I found an issue in Chapter 7 regarding android:backgroundTint vs app:backgroundTint. How to replicate: load chapter-7 from zipfile i...
New
a.zampa
@mfazio23 I’m following the indications of the book and arriver ad chapter 10, but the app cannot be compiled due to an error in the Bas...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
New
New

Sub Categories: