GithubHelp home page GithubHelp logo

cl-who's People

Contributors

alaa-alawi avatar hanshuebner avatar jacquesdnp avatar jkcunningham avatar kilianmh avatar knobo avatar kpoeck avatar mgi avatar nikodemus avatar phmarek avatar stassats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cl-who's Issues

str/fmt/esc expanded twice

Hi, I think there is a problem during the expansion because the symbols esc fmt and str are expanded twice.

e.g.

(with-html-output-to-string (s) (:a :onclick (str "Test"))) expand to "<aTest onclick='Test'></a>" but I think it makes more sense to expand into "<a onclick='Test'></a>".

Error in with-html-output

The following code:

(let ((v "18") (st nil))
  (with-html-output (st nil)
      (:div :href v)))

Outputs:


And returns: ">"
When the code:

(let ((v "18") (st nil))
  (with-html-output-to-string (st nil)
      (:div :href v)))

returns: "

"

(edit - closing parenthesis for balance)

ASDF warning

Upon loading in SBCL I get:

WARNING: System definition file #P".../quicklisp/dists/quicklisp/software/cl-who-20220331-git/cl-who.asd" contains definition for system "cl-who-test". Please only define "cl-who" and secondary systems with a name starting with "cl-who/" (e.g. "cl-who/test") in that file.

Odd behavior in mess of nested tags

I'm not sure if this is a bug or I'm doing something silly, I suspect the latter, but I'm curious to know the cause of this. I'm trying to create an h4 tag with some text in it and then a link, like this:
<h4>Foo <a href="/bar/21">&#x2795;</a></h4>

Foo

The code I'm using is such:

(with-html-output-to-string (*standard-output* nil)
    (:h4 (fmt "Foo ~A" 
        (htm (:a :href (format nil "/bar/~A" 21) "&#x2795;")))))

This produces the following output, with an extra '>' mixed in there, hings are all out of order, and some duplication occurs.

<h4><a href='/bar/21'>&#x2795;</a>Foo >&#x2795;</a></h4>

Foo >➕

I've tried all varieties of (str)/(htm)/(format)/(fmt) that I can think of.

Any guidance would be appreciated.

asdf:test-op on :cl-who results in some tests failed

In both ccl (development version 1.10) and sbcl (1.1.14) if I run:
(asdf:operate 'asdf:test-op :cl-who)

I get an error:
got an unexpected error: error while parsing arguments to DEFMACRO WITH-HTML-OUTPUT-TO-STRING:
unknown keyword: :ELEMENT-TYPE; expected one of :INDENT, :PROLOGUE

I am still a novice in common lisp matters and not sure if test-op is even supposed to work with cl-who. Just reporting it in case it is. I can do further diagnosis if you suggest.

:description

Would you please consider adding a :description option to your system definition of cl-who?

New release

Please, make a new release. The latest release in quicklisp suffers from symbol collision in
(who:with-html-output-to-string (who:str) (:a :href ""))
which is really hard to debug.

Expected behaviour inside 'let'

Is this supposed to work the way it is working currently:

(let ((a "hello"))
  (with-html-output (var (make-string-output-stream))
    (htm (:a a))))
;=> "</a>"
;expected <a>hello</a>

If so, why and what is the work around?

EVAL captures dynamic print-syntax

When a WITH-HTML-OUTPUT is compiled with non-standard print syntax (e.g. print-base 16), that is somehow captured/closed over at compile-time such that even e.g. wrapping the form in WITH-STANDARD-IO-SYNTAX does not help. This is quite unexpected behaviour and also confusing. I'm guessing what happens is in CONVERT-ATTRIBUTES the CONSTANTP attributes are formatted with tilde A at compile-time.

I'd suggest making such compile-time constant folding optional (presumably it's a speed optimization feature?), and also wrapping it in a compile-time WITH-STANDARD-IO-SYNTAX.

How do I create HTML-generating macros or functions?

Take the following as an example:

(defmacro with-html (&body body)
  `(cl-who:with-html-output-to-string (*standard-output* nil :prologue t)
                      ,@body))

(defmacro html-standard-page (&body body)
  `(with-html (:body ,@body)))

(defmacro test-g (id)
  `(:table (:tr (:td ,id))))

With this code, I would expect (html-standard-page (test-g "15")) to output something like:

`

15
`

Why doesn't it? Instead I get warnings that :td etc. are not defined. What am I doing wrong?

I hope this is an OK place to post this, as I wasn't sure where I should go with support questions. Thank you.

Attributes are not escaped

Consider for example:

(who:htm
  (:input :type "text" :name "title" :value "My cat's birthday"))

; Renders <input type='text' name='title' value='My cat's birthday' />

This would break since ' is not escaped to &apos; as required by the XML spec. I think for attributes it generally makes sense to always use escape-string-minimal, since I don't see a situation where you'd want to be able to inject arbitrary strings into the tags attribute list.

I guess this can't really be changed now without breaking a lot of existing code depending on who already escaping its attributes, but a setting to change this behavior would be nice.

Another typo

At
http://weitz.de/cl-who/#with-html-output

In
"CL-WHO will usually try not to insert any unnecessary whitespace in order to save bandwidth. However, if indent is true line breaks will be inserted and nested tags will be indented properly. The value of indent - if it is an integer - will be taken as the initial indentation. If it is not an integer it is assumed to mean 0. Value of HTML-NO-INDENT-TAGS controls which tag-contents are excempt from indentation..."

  • change "excepmt" to "exempt"
  • and maybe change
    "However, if indent is true line breaks will be"
    to "However, if indent is true, line breaks will be"

by adding a comma.

minor typo in documentation I think

In "(defmacro with-html-output-to-string..." at
http://weitz.de/cl-who/#with-html-output-to-string
is the text "(with-output-to-string (,var ,string-form :elementy-type ,element-type)" which, perhaps, should be "(with-output-to-string (,var ,string-form :element-type ,element-type)".

I think the text "elementy" is a typo.

"Ciao, Edi"
(a pun on a song by The Cult, named "Edie (Ciao Baby)")

Thank all of you very much for your work, and for making it available.

str fails

(let ((x "hi")) 
  (with-html-output-to-string (s) 
    (:a :href (str x))))
=> "<ahi href='hi'></a>"

Release with HTML5 support wanted

When installing CL-WHO via Quicklisp, version 0.11.1 is installed. This version does not include :HTML5 support. If possible, please release 0.11.2 (or something similar) with support for HTML5 (which is in the git repo anyway) for Quicklisp.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.