parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
724 stars 132 forks source link

fix: link rendering and code highlights #219

Closed franciscoj closed 3 months ago

franciscoj commented 3 months ago

Hi thanks a lot for your work on exvcr! I was recently playing a bit with it and found some issues on the documentation, so I thought a PR would help you.

The readme has some links that are not rendering well on https://hexdocs.pm/exvcr, in addition some of the code examples use Elixir as language name, so the highlighting doesn't work.

I've changed the links so that they render well on hexdocs and rexpect the existing target="_blank".

I've also changed the language in the codeblocks so that it is correctly highlighted on both hexdocs and GitHub.

Note

I was only able to get the docs rendered on Elixir 1.14. I tried 1.15 and 1.16 too, but they didn't work and I was always getting an error like this:

❯ mix docs               
Generated exvcr app

13:46:12.122 [notice] Application makeup exited: exited in: Makeup.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function Makeup.Application.start/2 is undefined (module Makeup.Application is not available)
            (makeup 1.1.2) Makeup.Application.start(:normal, [])
            (kernel 9.2.4) application_master.erl:293: :application_master.start_it_old/4

13:46:12.127 [notice] Application nimble_parsec exited: :stopped

13:46:12.127 [notice] Application earmark_parser exited: :stopped

13:46:12.127 [notice] Application eex exited: :stopped
** (MatchError) no match of right hand side value: {:error, {:makeup, {:bad_return, {{Makeup.Application, :start, [:normal, []]}, {:EXIT, {:undef, [{Makeup.Application, :start, [:normal, []], []}, {:applic
ation_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 293]}]}}}}}}
    (ex_doc 0.34.0) lib/mix/tasks/docs.ex:336: Mix.Tasks.Docs.run/3
    (mix 1.15.8) lib/mix/task.ex:455: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.8) lib/mix/cli.ex:92: Mix.CLI.run_task/2
    /path_to/elixir/shims/mix:4: (file)

I imagined this might be an error on some of the rendering libraries used by ex_docs but I didn't want to have to upgrade them all.

Links

Before

Screenshot 2024-06-09 at 14 13 15

After

Screenshot 2024-06-09 at 14 14 16

Code blocks

Before

Screenshot 2024-06-09 at 14 14 47

After

Screenshot 2024-06-09 at 14 14 55
coveralls commented 3 months ago

Coverage Status

coverage: 92.124%. remained the same when pulling ad9494d6a35294ef09606d1a077b993495b444ed on franciscoj:franciscoj/fix/docs into f5f1e67b6d1e3b786deaabee60e9160af3d14e93 on parroty:master.

parroty commented 3 months ago

Thanks!