aboutsummaryrefslogtreecommitdiffhomepage
path: root/org/ao_read_markup_source.org
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-04-24 22:35:39 -0400
committerRalph Amissah <ralph@amissah.com>2016-04-24 22:35:39 -0400
commit9c14b019a6f695b54a035605e3bb3fc76bf20aa6 (patch)
tree517169ec313d81aca54da3ddcb1f329b7caba695 /org/ao_read_markup_source.org
parentstep1 (diff)
Diffstat (limited to 'org/ao_read_markup_source.org')
-rw-r--r--org/ao_read_markup_source.org98
1 files changed, 0 insertions, 98 deletions
diff --git a/org/ao_read_markup_source.org b/org/ao_read_markup_source.org
deleted file mode 100644
index 08f1b45..0000000
--- a/org/ao_read_markup_source.org
+++ /dev/null
@@ -1,98 +0,0 @@
-#+TITLE: sdp read markup source
-#+AUTHOR: Ralph Amissah
-#+EMAIL: ralph.amissah@gmail.com
-#+STARTUP: indent
-#+LANGUAGE: en
-#+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:nil _:nil -:t f:t *:t <:t
-#+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
-#+OPTIONS: author:nil email:nil creator:nil timestamp:nil
-#+PROPERTY: header-args :padline no :exports code :noweb yes
-#+EXPORT_SELECT_TAGS: export
-#+EXPORT_EXCLUDE_TAGS: noexport
-#+FILETAGS: :sdp:rel:ao:
-#+TAGS: assert(a) class(c) debug(d) mixin(m) sdp(s) tangle(T) template(t) WEB(W) noexport(n)
-
-* read markup source :markup:
-[[./sdp.org][sdp]] [[./][org/]]
-
-** source string :string:
-#+name: ao_read_markup_source
-#+BEGIN_SRC d
-final private string markupSourceString(in char[] fn_src) {
- enforce(
- exists(fn_src)!=0,
- "file not found"
- );
- string source_txt_str;
- try {
- if (exists(fn_src)) {
- source_txt_str = readText(fn_src); // ok
- }
- }
- catch (ErrnoException ex) {
- // Handle errors
- }
- catch (UTFException ex) {
- // Handle validation errors
- }
- catch (FileException ex) {
- // Handle errors
- }
- std.utf.validate(source_txt_str);
- return source_txt_str;
-}
-#+END_SRC
-
-** source line array :array:
-#+name: ao_read_markup_source
-#+BEGIN_SRC d
-final private char[][] markupSourceLineArray(in string src_text) {
- char[][] source_line_arr =
- split(cast(char[]) src_text, rgx.line_delimiter);
- return source_line_arr;
-}
-#+END_SRC
-
-** insert source content raw line array :array:
-#+name: ao_read_markup_source
-#+BEGIN_SRC d
-final char[][] markupInsertSourceContentRawLineArray(in char[] fn_src) {
- enforce(
- match(fn_src, rgx.src_fn_find_inserts),
- "not a sisu markup filename"
- );
- auto source_txt_str = markupSourceString(fn_src);
- auto source_line_arr = markupSourceLineArray(source_txt_str);
- return source_line_arr;
-}
-#+END_SRC
-
-** source content raw line array :array:
-#+name: ao_read_markup_source
-#+BEGIN_SRC d
-final char[][] markupSourceContentRawLineArray(in char[] fn_src) {
- enforce(
- match(fn_src, rgx.src_pth),
- "not a sisu markup filename"
- );
- auto source_txt_str = markupSourceString(fn_src);
- auto source_line_arr = markupSourceLineArray(source_txt_str);
- return source_line_arr;
-}
-#+END_SRC
-
-* tangles :tangle:
-** code structure: :ao_read_markup_source.d:
-#+name: tangle_ao_read_markup_source
-#+BEGIN_SRC d :tangle ../lib/sdp/ao_read_markup_source.d
-/+
- read markup source
- ao_read_markup_source.d
-+/
-mixin template SiSUmarkupRaw() {
- struct MarkupRaw {
- auto rgx = Rgx();
- <<ao_read_markup_source>>
- }
-}
-#+END_SRC