initial simple example with omd

This commit is contained in:
Stavros Polymenis 2016-08-30 22:04:12 +01:00
commit 6b70398a90
3 changed files with 57 additions and 0 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
all: foo
foo: src/logarion.ml
ocamlfind ocamlopt -o logarion -linkpkg -package omd,Str src/logarion.ml

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Logarion
## Summary
A Yamado archive publisher.
Focuses on:
1. System simplicity by delegating all functionality but parsing Yamado archives and generating outputs.
Where possible it can compose with other programs (e.g. Pandoc).
2. Output quality
3. Distributed interactivity, like sharing with friends.
_YMD_ files can be stored internally and controlled by Logarion, or they can be piped from other sources.
Logarion can be used in two modes:
- Static, published upon a command
Suitable for situations where installation on the server is not possible.
Has the limitation that it can only output specific output once.
- Dynamic, published upon request according to query
Supports interactive features like searching and more advanced Atom feed parameters.
## Source file structure
- `src/`: Source code directory
## Requirements
- [omd](https://github.com/ocaml/omd

19
src/logarion.ml Normal file
View File

@ -0,0 +1,19 @@
let ymd s =
let open Str in
bounded_split_delim (regexp "---") s 5
let html_of string =
let open Omd in
to_html (of_string string)
let test = "---
title: Test
author: orbifx
---
Hello _world_!"
let () =
let md_str = List.nth (ymd test) 2 in
Printf.printf "%s" (html_of md_str)