diff --git a/Makefile b/Makefile index 7617bcf..95ab667 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,8 @@ -all: +all: test_file test_blog + +test_file: emacs --no-site-file --batch -l ./md4tj.el --eval "(md4tj-parse \"test_file.md4tj\" \"test_file.html\")" +test_blog: + emacs --no-site-file --batch -l ./md4tj.el --eval "(md4tj-parse \"test_blog.md4tj\" \"test_blog.html\")" + emacs --no-site-file --batch -l ./md4tj.el --eval "(md4tj-parse \"./blog/blogpost1.md4tj\" \"blogpost1.html\")" + emacs --no-site-file --batch -l ./md4tj.el --eval "(md4tj-parse \"./blog/blogpost2.md4tj\" \"blogpost2.html\")" diff --git a/blog/blogpost1.md4tj b/blog/blogpost1.md4tj index cf8f81e..09677f2 100644 --- a/blog/blogpost1.md4tj +++ b/blog/blogpost1.md4tj @@ -3,4 +3,5 @@ @@BLOGPOSTTITLE Blog Post 1 @@BLOGPOSTDATE 1677804254 # Blog post 1 -blog text 1! \ No newline at end of file +blog text 1! +[Link to example.com!](https://www.example.com ()) \ No newline at end of file diff --git a/blogpost1.html b/blogpost1.html new file mode 100644 index 0000000..c6ed741 --- /dev/null +++ b/blogpost1.html @@ -0,0 +1,18 @@ + + +
+ + +blog text 1!
+ +[Link to example.com!](https://www.example.com ())
+ + \ No newline at end of file diff --git a/blogpost2.html b/blogpost2.html new file mode 100644 index 0000000..1fc0bc8 --- /dev/null +++ b/blogpost2.html @@ -0,0 +1,16 @@ + + + + + +blog text 2 text!
+ + \ No newline at end of file diff --git a/md4tj-blog.el b/md4tj-blog.el index 149eda6..2c9e156 100644 --- a/md4tj-blog.el +++ b/md4tj-blog.el @@ -7,7 +7,8 @@ (require 'cl-lib) ;; (load "./md4tj-util.el") -(load-file (expand-file-name "~/.emacs.d/elpa/dash-20220608.1931/dash.el")) +;; Remember to add (setq flycheck-emacs-lisp-load-path 'inherit) to .emacs for this to work with flycheck +(load "~/.emacs.d/elpa/dash-20230415.2324/dash.el") ;; NOT needed anymore ;; Presence of blog indicated by @@BLOGINSERT line diff --git a/md4tj.el b/md4tj.el index 91bc67a..dd28e43 100644 --- a/md4tj.el +++ b/md4tj.el @@ -6,11 +6,9 @@ (require 'cl-lib) -;; (load-file "./md4tj-util.el") -;; (load-file "./md4tj-blog.el") +(load-file "./md4tj-util.el") +(load-file "./md4tj-blog.el") (require 'subr-x) -;; Crappy hack, figure out the "emacs" way of loading dash - (defun md4tj-begin-tag (tag &optional attrs) "Return beginning html tag for TAG with optional ATTRS." @@ -47,7 +45,7 @@ "\\1" ;; Then links (replace-regexp-in-string - "\\[\\([^\\[]*\\)](\\([^\\[(]*\\))" + "\\[\\([^\\[]*\\)](\\([^\\[]*\\))" (concat (md4tj-begin-tag "a" (list '("href" "\\2"))) "\\1" (md4tj-end-tag "a")) ;; Then images (replace-regexp-in-string diff --git a/test_blog.html b/test_blog.html index 10c8e93..3e90c1d 100644 --- a/test_blog.html +++ b/test_blog.html @@ -35,5 +35,7 @@