From cjstuij at gmail.com Wed Jun 7 15:19:09 2006 From: cjstuij at gmail.com (Ties Stuij) Date: Wed, 7 Jun 2006 17:19:09 +0200 Subject: [cl-markdown-devel] #. compile problem Message-ID: He Gary, Sbcl is not totally happy with cl-markdown. In line-is-link-label-p it won't fasl-ize #.(ppcre:create-scanner '(:sequence link-label)) eg: ; file: /home/zeno/lisp/lib/cl-markdown/dev/markdown.lisp ; in: DEFUN LINE-IS-LINK-LABEL-P ; (CL-PPCRE:SCAN # CL-MARKDOWN::LINE) ; --> CL-PPCRE:SCAN LOAD-TIME-VALUE SB-KERNEL:MAKE-VALUE-CELL ; --> CL-PPCRE:CREATE-SCANNER ; ==> ; # ; ; caught ERROR: ; Objects of type FUNCTION can't be dumped into fasl files. the form should work fine without reading it in advance, or ..? btw, i just got cl-markdown hooked up in the web-app i'm working on. It functions quite nicely. A whole lot better than the nl2br methodology, thanks! Greets, Ties From gwking at metabang.com Wed Jun 7 16:11:29 2006 From: gwking at metabang.com (Gary King) Date: Wed, 7 Jun 2006 12:11:29 -0400 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: Hi, Thanks for the notice. I got into the habit of #. my create-scanner forms as an optimization but should probably just trust the compiler. > btw, i just got cl-markdown hooked up in the web-app i'm working on. > It functions quite nicely. A whole lot better than the nl2br > methodology, thanks! Hey, great. Please keep me up to date with any problems you encounter or ideas that would make CL-Markdown easier to use. -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally) From cjstuij at gmail.com Wed Jun 7 17:44:50 2006 From: cjstuij at gmail.com (Ties Stuij) Date: Wed, 7 Jun 2006 19:44:50 +0200 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: > It functions quite nicely. ehh... having said that. I didn't actually try more than one sentence. when i render (without the indentation): # bla www.frankrijk.com http://www.spanje.com ties at sleep.se i get (again without the indentation):

bla www.frankrijk.com http://www.spanje.com ties at sleep.se

e.g. a long line of big text. Shouldn't markdown have wrapped them all in

s? Bulletting frankrijk and spanje for example bullets them correctly, so i gather it's in the paragraph detection code. I tried to figure it out, but i'm not that fast. greets, Ties From gwking at metabang.com Wed Jun 7 19:00:50 2006 From: gwking at metabang.com (Gary King) Date: Wed, 7 Jun 2006 15:00:50 -0400 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: Hi Ties, I think that this is a bug that is fixed. Where I try your sample, I get: >

bla >

>

www.frankrijk.com >

>

http://www.spanje.com >

>

ties at sleep.se >

which is correct as far as the structure goes but is missing the automatic URL conversation -- I'll try to look into that later today or tomorrow. On Jun 7, 2006, at 1:44 PM, Ties Stuij wrote: >> It functions quite nicely. > > ehh... having said that. I didn't actually try more than one sentence. > > when i render (without the indentation): > > # bla > > www.frankrijk.com > > http://www.spanje.com > > ties at sleep.se > > i get (again without the indentation): > >

bla > > www.frankrijk.com > > http://www.spanje.com > > ties at sleep.se >

> > e.g. a long line of big text. Shouldn't markdown have wrapped them all > in

s? Bulletting frankrijk and spanje for example bullets them > correctly, so i gather it's in the paragraph detection code. I tried > to figure it out, but i'm not that fast. > > greets, > Ties -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally) From cjstuij at gmail.com Wed Jun 7 21:02:50 2006 From: cjstuij at gmail.com (Ties Stuij) Date: Wed, 7 Jun 2006 23:02:50 +0200 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: > > ehh... having said that well i pulled like hell on all markdowns dependencies, removed every potential stale fasl (in hindsight probably only fresh as grass fasls) but no dice. what helped a bit was removing (some-element-p (chunk-enders (current-chunk-parser)) (lambda (p) (funcall p line))) from chunk-source, right under ;; end current chunk this lets my program regognize the end of a and wraps a maximum of two text blocks seperated by an empty line in

s. If there are more than two, all but the last text blocks are wrapped in the one and the last is wrapped in the other. It's voodoo to me. I will now leave the world of programming and start a farm on the countryside greets, Ties From gwking at metabang.com Thu Jun 8 19:38:35 2006 From: gwking at metabang.com (Gary King) Date: Thu, 8 Jun 2006 15:38:35 -0400 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: <11B419B5-C055-4B1C-A3F9-B1835BEC8DC0@metabang.com> I will make sure that the latest stuff is out that in darcs and ASDF- Install land and get back to you. On Jun 7, 2006, at 5:02 PM, Ties Stuij wrote: >> > ehh... having said that > > well i pulled like hell on all markdowns dependencies, removed every > potential stale fasl (in hindsight probably only fresh as grass fasls) > but no dice. > > what helped a bit was removing > > (some-element-p (chunk-enders (current-chunk-parser)) > (lambda (p) (funcall p line))) > > from chunk-source, right under > ;; end current chunk > > this lets my program regognize the end of a and wraps a maximum of > two text blocks seperated by an empty line in

s. If there are more > than two, all but the last text blocks are wrapped in the one and the > last is wrapped in the other. > > It's voodoo to me. I will now leave the world of programming and start > a farm on the countryside > > greets, > Ties -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally) From gwking at metabang.com Fri Jun 9 13:52:11 2006 From: gwking at metabang.com (Gary King) Date: Fri, 9 Jun 2006 09:52:11 -0400 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: Message-ID: <0D9F4762-C50C-410C-AB5B-6237B131DEC8@metabang.com> Hi again, FWIW, I did a fresh install with the ASDF-Installable versions this morning and CL-Markdown worked as far as the paragraph structures go. I haven't gotten to testing a fresh darcs pull yet though and I'm having some hard disk conniptions that are slowing up progress a bit (current drive starting to fail, new drive on the way...). On Jun 7, 2006, at 5:02 PM, Ties Stuij wrote: >> > ehh... having said that > > well i pulled like hell on all markdowns dependencies, removed every > potential stale fasl (in hindsight probably only fresh as grass fasls) > but no dice. > > what helped a bit was removing > > (some-element-p (chunk-enders (current-chunk-parser)) > (lambda (p) (funcall p line))) > > from chunk-source, right under > ;; end current chunk > > this lets my program regognize the end of a and wraps a maximum of > two text blocks seperated by an empty line in

s. If there are more > than two, all but the last text blocks are wrapped in the one and the > last is wrapped in the other. > > It's voodoo to me. I will now leave the world of programming and start > a farm on the countryside > > greets, > Ties -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally) From gwking at metabang.com Mon Jun 12 16:57:08 2006 From: gwking at metabang.com (Gary King) Date: Mon, 12 Jun 2006 12:57:08 -0400 Subject: [cl-markdown-devel] #. compile problem In-Reply-To: References: <0D9F4762-C50C-410C-AB5B-6237B131DEC8@metabang.com> Message-ID: <9DFEEB69-7991-48CA-AFFE-E4694C2AEA24@metabang.com> Hi Ties, I've looked into this a little more and here is what I think is happening: CL-Markdown uses my containers library (CL-Containers) and, in particular, the iterator constructs. These let me create an iterator and use it without caring about where the data originates because the iterator is supposed to abstract all of that out. So the call in chunk-source can look like: > (with-iterator (i source :treat-contents-as :lines :skip-empty- > chunks? nil) > (iterate-elements > i > (lambda (line) > (chunk-line line)))) where source can be a string or a pathname. The with-iterator macro eventually turns into a call to make-iterator and make-iterator uses the arguments it is supplied to construct the appropriate class and instantiate it. in particular, if source is a pathname, the iterator will be of type 'file-line-iterator; if source is a string, you'll get a 'line-iterator. The line-iterator is a subclass of delimited iterator and uses #\linefeed, #\newline (and now #\return) to find lines. On OS X, this code > (list (char-code #\linefeed) (char-code #\newline) (char-code # > \return)) return various things in various Lisps: > (MCL) ==> 10 13 13 > (SBCL 0.9.11) ==> 10 10 13 > (OpenMCL) ==> 10 10 13 So if one of your strings had switched to #\return's instead of # \linefeed or #\newlines, then this is probably what caused the problem. I'm adding #\return to the list of delimiters for the line- iterator so that should correct this problem. Note that the file-line-iterator uses read-line to suck in each line. This means that the changing the delimiter won't have any effect on files. It also means that the line ending in files will be significant to CL-Markdown (i.e., CL-Markdown won't work correctly if read-line doesn't read lines ). HTH, please keep me informed as to any more trials and tribulations you encounter (and successes too!) On Jun 9, 2006, at 3:59 PM, Ties Stuij wrote: > Eureka! > i got it. > >> So are you saying that >> >> ? (markdown "..." :stream t) >> >> works but >> >> ? (markdown "..." :stream "/my/file/name/here") >> >> fails? > > No i store two strings in elephant class slots: the markdown text and > the output of the markdown. Since elephant only references slots you > ask for, this seemed to me to be the most efficient way to use it. If > you want to update the text you can edit it in place through a form > (we're talking browsers here). > > Anyway, it turns out that get?/post?/the browser?/ucw? saves > line-jumps as returns in stead of newlines. Something a newbie like me > doesn't think about so fast. I solved it in my app by regexp-replacing > through the string. I was gonna supply a patch but i noticed your code > decides on a low (container) level if the text you want to process is > a string or whatever, so i don't really know what is the preferred > route. > > Btw, while on my bughunt i installed through asdf-install and noticed > it installed a couple of dependencies that were not needed with the > darcs markdown, eg trivial shell, lml2, lift, cl-html-diff and > cl-difflib. You probably knew this and it is no biggie but you never > know. > > Anyway, thanks for the help, > > Greets, > Ties -- Gary Warren King metabang.com http://www.metabang.com/ (413) 210 7511 gwking on #lisp (occasionally)