Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

md generation

  • Loading branch information...
commit 507c0b4805a40a1b7464340125bcf831423c9e66 1 parent fc763ca
@dharmatech authored
View
9 build-md.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+process_file ()
+{
+ sed -nf include.sed $1.md.in | sed 'N;N;s/\n//' | sed -f - $1.md.in > $1.md
+}
+
+process_file print-literal-string
+
View
3  clean.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rm *.md
View
7 include.sed
@@ -0,0 +1,7 @@
+/#include file="/ {
+ =;
+ s/^[^"]*"/{r /;
+ s/".*//p;
+ a\
+ d;}
+}
View
37 print-literal-string.md
@@ -0,0 +1,37 @@
+
+# Print a literal string
+
+# C
+
+```c
+
+#include <stdio.h>
+
+int main ()
+{
+ printf("%s", "abc") ;
+
+ return 0 ;
+}
+```
+
+# Assembly
+
+```s
+
+ .include "utils.s"
+
+ global_text main
+
+ prepare_stack
+
+ literal_string "abc" , %rax
+
+ print_string %rax
+
+ print_nl
+
+ return_integer $0
+```
+
+
View
16 print-literal-string.md.in
@@ -0,0 +1,16 @@
+
+# Print a literal string
+
+# C
+
+```c
+#include file="print-literal-string.c"
+```
+
+# Assembly
+
+```s
+#include file="print-literal-string.s"
+```
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.