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 post 1 + + + +
+ +

Blog post 1

+ +

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 post 2 + + + +
+ +

Blog post 2

+ +

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 @@

Non blog text!!

+ +

link to example.com

\ No newline at end of file diff --git a/test_blog.md4tj b/test_blog.md4tj index f21e80c..212dc4c 100644 --- a/test_blog.md4tj +++ b/test_blog.md4tj @@ -16,4 +16,5 @@ @@BLOGBASEDIR ./blog/ @@BLOGINSERT -### Non blog text!! \ No newline at end of file +### Non blog text!! +[link to example.com](https://www.example.com) \ No newline at end of file diff --git a/test_file.html b/test_file.html index a0965f7..b9a6cd9 100644 --- a/test_file.html +++ b/test_file.html @@ -12,10 +12,6 @@ - - - -

Hello world!

Hello world!

@@ -69,16 +65,16 @@ int main() { -
+

Dungeon Crawl Stone Soup - My favorite FOSS roguelike (Yes, I know the greatest roguelike of all time is NetHack, I don't care).

e^{i \pi} + 1 = 0 -
+

This is a div that has monospace text.

-

Last updated: Wed Jan 4 15:08:50 2023

+

Last updated: Wed Jun 7 10:10:53 2023

\ No newline at end of file diff --git a/teximg/05e525335903ae89ce2a72ebe2582879.png b/teximg/05e525335903ae89ce2a72ebe2582879.png new file mode 100644 index 0000000..41db122 Binary files /dev/null and b/teximg/05e525335903ae89ce2a72ebe2582879.png differ