Arc Forumnew | comments | leaders | submitlogin
1 point by wfarr 6107 days ago | link | parent

For clarity's sake, here's my blogpage macro:

  (mac blogpage (title . body)
    `(tag html
       (tag head
          (prn "<link rel=\"stylesheet\" type=\"text/css\" href=\"index.css\">")
          (tag title (pr ,title)))
       (tag body
         (div (id "container")
           (div (id "header")
             (pr blogtitle*))
           (div (id "tabBar")
             (maketab "blog" "Home")
             (maketab "about" "About")
             (maketab "emacs" "Emacs")
             (when (admin user)
               (tab "newpost" "New")))
           (div (id "main")
             (div (id "content") ,@body)
             (div (id "sidebar")
               (link "archive")))
           (div (id "footer") (pr copyright*))))))
Please note that in this case, I renamed my tabs macro to maketab, to avoid conflicts.


2 points by cadaver 6106 days ago | link

What you need is a doctype:

  (mac blogpage (title . body)
    `(do (prn "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">")
         (tag html
          ...
That should sort out the CSS problems.

-----

2 points by cooldude127 6106 days ago | link

maybe we could use some doctype macros in html.arc

-----

1 point by wfarr 6106 days ago | link

Additionally, I'd like to see the link macro replaced by something that doesn't... uh, conflict with the <link> tag (which is forcing us to use ugly (pr)s right now instead of (tag)).

-----

1 point by cooldude127 6106 days ago | link

what's wrong with this:

  (attribute link type opstring)
  (attribute link href opstring)
  (attribute link rel  opstring)
  (gentag type "text/css" rel "stylesheet" href "styles.css")

-----

1 point by wfarr 6106 days ago | link

While the doctype would sort them out usually, it seems that (defop index.css ...) is serving up the page oddly now, such that the CSS isn't being applied.

-----

2 points by sjs 6106 days ago | link

It's a clever hack but I'm not crazy about the inline CSS and JS in news.arc. I would just serve static files and as a bonus you'll get all the benefits of the CSS and JS modes of your text editor while editing the stuff. Perhaps pg just wanted to keep the arc dir tidy and doesn't actually do that on news.yc.

-----

2 points by wfarr 6106 days ago | link

Thanks.

I'll test it when "anarki" unbreaks for me.

-----