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") (cond ((string= (nth 0 meta) "@@TITLE")
(concat "<title>" (mapconcat 'identity (cdr meta) " ") "</title>\n")) (concat "<title>" (mapconcat 'identity (cdr meta) " ") "</title>\n"))
((string= (nth 0 meta) "@@META") ((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 () (defun md4tj-head ()
"Return text for head element on current buffer." "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"> <html lang="en-us">
<head> <head>
<link rel="stylesheet" href="test_css.css">
<title>Test webpage</title> <title>Test webpage</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
@ -10,6 +11,7 @@
<body> <body>
<h1>Hello <code>world</code>!</h1> <h1>Hello <code>world</code>!</h1>
<h2>Hello world!</h2> <h2>Hello world!</h2>
<h3>Hello world!</h3> <h3>Hello world!</h3>

View File

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