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
Running the examples in chapter 5 c under pytest 5.4.1 causes an AttributeError: ‘module’ object has no attribute ‘config’. In particula...
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
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
redconfetti
Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine nativel...
New

Other popular topics Top

New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
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
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New

Sub Categories: