evnu

evnu

Docception - Run doctests for markdown files

Hi!

I spent some hours the last few days to put together a simple helper to check that code examples in README.md files can actually be tested against the project. The result is Docception, which exposes a mix task to check any markdown file using Elixir’s own doctest:

$ mix docception README.md # run the doctests in README.md

The approach of Docception is simply: It reads a file, generates an abstract Erlang Form for the Docs chunk, and puts that into the very-private-do-not-trust-I-will-be-there-later ExUnit.DocTest.__doctests__/1 function. See the repository for some more information and an example project using the mix task within an alias for mix test.

I hope somebody finds that useful, or at least interesting.

Most Liked

Qqwy

Qqwy

TypeCheck Core Team

Nice! This is great, because I love literate programming :smile:

OvermindDL1

OvermindDL1

Ooo I’ve always wanted that to be done, always wished I could doctest an md file instead of an elixir file. :slight_smile:

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
OvermindDL1
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM. ...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New

Other popular topics Top

hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement