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

belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
New
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1030 17300 381
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New

Sub Categories: