The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2018-01-05

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:07 tchaves joined #mojo
02:18 disputin joined #mojo
04:39 gizmomathboy joined #mojo
05:04 dboehmer_ joined #mojo
06:16 ghenry joined #mojo
06:57 eseyman joined #mojo
07:17 Vandal joined #mojo
07:25 kes joined #mojo
07:53 trone joined #mojo
08:13 mishanti1 jberger: Thank you for chiming in yesterday. Sadly it did not seem to work. The layout is still not loaded and mojo does not seem to even try. I also tried with `inline => '<% layout "wrapper"; %><%== $output %>', output => $output`. No worky.
08:13 mishanti1 What is interesting is that when I use the code you suggested my other variant the layout is never loaded. However if I place the _exact same_ code in a template file and just do `$c->render('mytemplate', output => $output);` the the layout is loaded.
08:14 mishanti1 I've been reading the docs up and down but have not seen anything to suggest that there are limitations as to where a `layout` statement will have effect.
08:41 McA joined #mojo
09:19 tot joined #mojo
09:21 dod joined #mojo
09:27 dod joined #mojo
10:17 trone_ joined #mojo
10:59 tchaves joined #mojo
11:03 dod1 joined #mojo
11:40 dod joined #mojo
11:53 jamesaxl joined #mojo
12:27 karjala_ joined #mojo
12:28 gabiruh joined #mojo
12:33 CandyAngel Ah, isn't it fun when you request an XML file and instead of redirecting you to the login page if you aren't logged in, it just sends you the HTML for the login page instead? -.-
12:40 haarg undecided on using Mojo::DOM or hacking html5 stuff on top of HTML::TreeBuilder for a non-mojo project (metacpan)
12:40 haarg kind of annoying that the HTML::Parser ecosystem is so shit
12:45 pink_mist you can always try Mojo::DOM58 - https://metacpan.org/pod/Mojo::DOM58
12:58 karjala_ joined #mojo
12:59 karjala_ joined #mojo
13:09 haarg i do see a minor issue with Mojo::DOM
13:10 haarg it doesn't properly understand html embedded in mathml embedded in html
13:11 haarg and i guess s/mathml/svg/ as well
13:17 sri it should
13:19 sri if it's in the html5 spec Mojo::DOM should handle it
13:22 haarg https://perl.bot/p/c284ax as an example
13:22 haarg with Mojo::DOM, the inner div breaks out of the p tag
13:23 haarg which doesn't seem to be the proper behavior
13:24 haarg not relevant to what i'm working on, just something i noticed
13:24 sri div does break paragraphs
13:25 sri are there special rules in the html spec for that scenario?
13:25 haarg i believe so
13:25 sri i'd appreciate a github issue with reference to the spec section
13:26 sri we follow this spec https://html.spec.whatwg.org
13:26 haarg i'll see if i can track it down a bit more
13:26 haarg svg and mathml are a bit odd in the html spec because it basically defers to the svg and mathml specs
13:27 haarg which have their own information about embedding in html
13:27 haarg and they are a bit of a hybrid html/xml format
13:28 haarg but i can confirm that in both firefox and chrome, the inner div doesn't break the p
13:29 sri full mathml/svg support seems unlikely, but if we just need to stop at <svg> and <math> boundaries for stuff like paragraph breakage, that would be a simple change
13:31 sri if we had to apply xml rules in those blocks things would get interesting
13:31 haarg from my reading, it's basically a common denominator format
13:32 haarg like, no namespaces, but still with self closing tags
13:33 haarg so what Mojo::DOM does is mostly fine, it only get weird because they have ways of embedding html themselves
13:36 sri sounds like we might get away with <svg> and <math> boundaries for closing html tags
13:36 haarg that seems likely
13:36 sri code in question is https://github.com/kraih/mojo/blob/master/lib/Mojo/DOM/HTML.pm#L246
13:36 sri afraid my head is still not clear enough to look into it this week... flu is very persistent :S
13:38 haarg there's some fun stuff in the mathml spec, like if you don't include the encoding="text/html" on a annotation-xml tag, but put an html tag in it anyway, it terminates the math element, so any following mathml stuff is treated as html
13:39 haarg i guess that's bound to happen when you start embedding xml into a xml-like format
13:47 marty_ joined #mojo
13:49 jamesaxl joined #mojo
14:12 Pyritic joined #mojo
14:23 purplecoffee joined #mojo
14:29 purpleco_ joined #mojo
14:34 dod joined #mojo
14:36 Vandal joined #mojo
14:37 Pyritic joined #mojo
14:48 gryphon joined #mojo
14:52 dod joined #mojo
14:55 dod joined #mojo
14:56 dod joined #mojo
15:01 gizmomathboy joined #mojo
15:03 jamesaxl joined #mojo
15:06 dod joined #mojo
15:07 dod joined #mojo
15:08 sh14 joined #mojo
15:11 sh14 joined #mojo
15:12 dod1 joined #mojo
15:18 karjala_ joined #mojo
15:19 dod joined #mojo
15:20 dod joined #mojo
15:21 ChmEarl joined #mojo
15:22 geospeck joined #mojo
15:23 dod joined #mojo
15:34 zivester joined #mojo
15:36 CandyAngel If I am adding "extra" keys to a hash, is the custom to have the key prefix be "x_" or "x-" ?
15:37 perlpilot that's a little vague.  how are they "extra"?  What does the hash represent?
15:38 perlpilot For hashes that have "metadata", I usually use a "meta" key to another hashref and stick stuff in there.
15:38 CandyAngel Well, where I have seen it before is when the additional key is for a plugin, but it needs adding to an existing section
15:38 CandyAngel Like if it came from YAML
15:39 CandyAngel I can't remember where I've seen it though
15:41 perlpilot usually you see some sort of x- prefix in HTTP headers, and I can't recall seeing it elsewhere
15:41 dod joined #mojo
15:42 perlpilot (also, "X-" prefix in HTTP headers is deprecated in RFC6648)
15:42 CandyAngel Ah, I saw it in Yancy :P
15:43 CandyAngel https://metacpan.org/pod/Yancy#Extended-Collection-Configuration
15:44 CandyAngel Not quite what I was thinking of though
15:46 CandyAngel But I am "extending" the hash (which in this case, is some values pulled from an XML file I fetch)
15:46 CandyAngel Which doesn't include the ID used to fetch it, so I want to add it
15:46 sri html has data-* attributes
15:50 haarg CPAN::Meta v2 has x_
15:50 haarg i've often see _ prefixes for stuffing data into "foreign" structures
15:51 CandyAngel Having tablify deal nicely with uneven sized things is awesome :)
15:52 CandyAngel Some ids I don't have access to, but now it just has the id and a blank line <3
15:52 CandyAngel might add an x-error though to make it clearer
16:00 karjala_ joined #mojo
16:05 CandyAngel Would adding events to CookieJar be considered? Or should I just abuse ignore? :)
16:05 karjala_ joined #mojo
16:08 CandyAngel Actually.. I could have an AutoSave role..
16:10 sri new events usually get accepted if there's two good use cases
16:14 purplecoffee joined #mojo
16:16 CandyAngel I'll bear that in mind, but I think an autosave role with 'after collect' should work alright for what I have in mind
16:16 CandyAngel But for not, home time.. to work on a completely different project..but still involving Mojo :D
16:16 CandyAngel for now*
17:07 geospeck joined #mojo
17:41 jberger MOJO ALL THE THINGS!!!!
17:50 maschine I have a subprocess that a longish loop runs under - it doesn't block, but how do I stop it from timing out?
17:50 maschine when I run it on a smaller file, it works, but a file double the size and it does an inactivity timeout before the loop finishes
17:50 Grinnz depends which timeout you're hitting
17:50 Grinnz yeah, increase the inactivity timeout
17:50 mohawk sounds like a subprocess might be in order
17:51 maschine it is a subprocess :p
17:51 Grinnz generally you need to do that when using slow subprocesses or websockets
17:51 mohawk i didn't know those could time out
17:51 mohawk every day is a school day
17:51 dustinm joined #mojo
17:51 Grinnz the inactivity timeout always applies to a request that's waiting on the event loop
17:52 Grinnz not the subprocess itself, you'd have to implement that timeout yourself
17:54 maschine can I just do $c->inactivity_timeout(3600); before my subprocess?  http://bit.ly/2m037ZF
17:54 Grinnz i think so
17:55 Grinnz you can also do it globally with the env var
17:55 maschine yeah, I only need it for this one route though
18:02 maschine yay it works :)
18:03 mohawk noice
18:33 tchaves joined #mojo
18:53 Seth joined #mojo
18:54 tchaves joined #mojo
19:03 geospeck joined #mojo
19:13 Seth joined #mojo
19:40 bwf joined #mojo
20:16 gryphon joined #mojo
20:26 ghenry joined #mojo
20:53 Seth joined #mojo
21:03 FROGGS joined #mojo
21:10 ghenry joined #mojo
22:10 pirateFinn joined #mojo
22:12 gizmomathboy joined #mojo
22:13 kensanata joined #mojo
22:17 kensanata I wrote a little server using Mojo::IOLoop (a gopher server frontend to a wiki). It has $stream->on(read => sub {}) and appears to get chunks of input (about 130k?). How do I listen for an EOF or provide an end-of-message in case of binary data?
22:18 kensanata My setup is here: https://github.com/kensanata/oddmuse/blob/master/stuff/gopher-server.pl#L146 and processing is here: https://github.com/kensanata/oddmuse/blob/master/stuff/gopher-server.pl#L620
23:10 ghenry joined #mojo
23:19 sri kensanata: http://mojolicious.org/perldoc/Mojo/IOLoop/Stream#close

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary