Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code output not rendered. cannot embed lisp code. #7

Open
fselcukcan opened this issue Feb 9, 2014 · 1 comment
Open

code output not rendered. cannot embed lisp code. #7

fselcukcan opened this issue Feb 9, 2014 · 1 comment

Comments

@fselcukcan
Copy link

i try to make use of cl-markup as follows. i have some functions that is created by markup to create parts of a single page.
and a big function that uses html and other little functions to create whole page.
but on browser this yields only created strings of html. only div in the code below is rendered.
(defun compose-home-page ()
(html
(:body
(morph-categories-axis)
(morph-time-axis)
(:div :style "height:45px; border:1px solid;"
(morph-name)
(morph-search)))))

and i cannot embed do lists inside the markup or html. this below code is rendered just like the above, all lines starting from dolist are ignored by the browser.
(defun compose-home-page ()
(html
(:body
(morph-categories-axis)
(morph-time-axis)
(:div :style "height:45px; border:1px solid;"
(morph-name)
(morph-search))
(dolist (itable (gather-all-artickles))
(dolist (iart itable)
(morph-artickle-section (getf iart :date)
(getf iart :author)
(getf iart :title)
(getf iart :body)
(getf iart :unique-id)
(getf iart :upvotes)
(getf iart :downvotes)))))))

the part of the first function above is similar to the followings. a part of it:
(setf time-axis-url
'(( "29s" . "1")("28s" . 2)("27f" . 3)("26t" . 4)("25w" . 5)("24t" . 6)("23m" . 7)("22m" . 8)))

(defun morph-time-axis ()
(markup
(:div :id "time-axis"
:style "height:100%; width:18px; position: fixed; border:1px solid; right: 0px;"
(loop for i in time-axis-url
collect (markup (:a :href (car i))
(:span " "))))))

@fukamachi
Copy link
Contributor

dolist doesn't return any values. Use mapcar or loop ... collect instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants