Added ability to add css

This commit is contained in:
j4nk 2023-01-02 20:08:12 -05:00
parent eba7517f65
commit 114337d8b4
4 changed files with 7 additions and 1 deletions

View File

@ -154,7 +154,9 @@
(cond ((string= (nth 0 meta) "@@TITLE")
(concat "<title>" (mapconcat 'identity (cdr meta) " ") "</title>\n"))
((string= (nth 0 meta) "@@META")
(concat (md4tj-begin-tag "meta" (md4tj-list-to-tuple-list (cdr meta)))))))
(concat (md4tj-begin-tag "meta" (md4tj-list-to-tuple-list (cdr meta)))))
((string= (nth 0 meta) "@@CSS")
(concat (md4tj-begin-tag "link" (list (list "rel" "stylesheet") (list "href" (nth 1 meta))))))))
(defun md4tj-head ()
"Return text for head element on current buffer."

1
test_css.css Normal file
View File

@ -0,0 +1 @@
body {background-color: #00ff00;}

View File

@ -2,6 +2,7 @@
<html lang="en-us">
<head>
<link rel="stylesheet" href="test_css.css">
<title>Test webpage</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
@ -10,6 +11,7 @@
<body>
<h1>Hello <code>world</code>!</h1>
<h2>Hello world!</h2>
<h3>Hello world!</h3>

View File

@ -1,6 +1,7 @@
@@META charset UTF-8
@@META name viewport content width=device-width,initial-scale=1.0
@@TITLE Test webpage
@@CSS test_css.css
# Hello `world`!
## Hello world!
### Hello world!