DEV Community

Discussion on: What was your win this week?

Collapse
 
fennecdjay profile image
Jérémie Astor • Edited

I merged my first Pull Request that was not by me since long.
Plus it uncovered a few issues,
all thanks to the user that answered my post asking for help. I hope there'll be others!

pranav2612000 image

Also I added locations to my (rudimentary) litterate system.

GitHub logo fennecdjay / mdr

MDR, the markdown runner

MDR, a markdown runner

Linux MacOs Windows Line Count

mdr is a small program and markup designed to facilitate documentation and testing.

logo

I started it to ease Gwion's devellopment but it is not tied in any way to this project.

Let' walktrough... 😄

Hello World

let's write our first litterate progam.

Define program structure

hello_world.c

@[[ Includes ]]
int main(int argc, char** argv) {
  @[[ Print ]]
}

Add Headers

As we need the puts function, we need stdio headers.

Includes

#include <stdio.h&gt

Print function

Print

puts("Hello, World!");

Compile

let's compile hello_world.c.

exec: cc hello_world.c -o hello_world

Yes, there should be no output, and that good news.

Check

Let's look at hello_world.c

exec: cat hello_world.c

#include <stdio.h>

int main(int argc, char** argv) {
  puts("Hello, World!");
}

That's the content of the source file we generated (and compiled).

Test

Then we run it

exec: ./hello_world

Hello, World!

Do we read Hello


EDIT: I keep forgetting I can use liquid tags in dev.