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

grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
622 19610 194
New
trisolaran
Hi! :waving_hand: I would like to present LiveSelect, a little library that I wrote to easily add a dynamic selection input to your LV f...
198 11283 107
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 14721 119
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement