<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi, Utkarsh<br>
<br>
This feature will require some work - not just from pretty-printing.
<br>
<br>
Consider an html file:<br>
<br>
<!DOCTYPE><br>
<html><br>
<head><br>
<meta charset="utf-8" /><br>
<title>hello</title><br>
<link href="global.css" type="text/css" rel="stylesheet"/><br>
<style><br>
h1 {<br>
text-align:center;<br>
}<br>
</style><br>
<script src="jquery.js" type="text/javascript"></script><br>
</head><br>
<body><br>
<h1>My title</h1><br>
<script><br>
console.log($('h1').text())<br>
</script><br>
</body><br>
<br>
When this file is extracted. The css panel should show the
<style></style> content. The html panel should show the
<script></script> content. However, <br>
the 'run' should display the html using the included global.css and
jquery.js files.<br>
<br>
This is a feature beyond what seems to be provided by the online
jsfiddle. There the assumption is that the user is trying out a code
fragment to see what it does not working with a full web page. <br>
<br>
There are a couple of other quirks we need to try. <br>
<br>
In the case of javascript or html, the user may want to copy and
paste the text to the fiddler. Since the user is learning to create
web pages with javascript, this is a reasonable use case. This text
should be saved as a full html page. <br>
<br>
The model I am using is a learner who uses a text editor (nano or
gedit) to prepare and edit html files and then wants to open it in
Browse and test with the fiddler. After making some corrections, the
user wants to save the file and perhaps resume editing with a local
editor. The user also may want to display the web page by url
(<a class="moz-txt-link-freetext" href="file:///home/olpc/Documents/myfile.html">file:///home/olpc/Documents/myfile.html</a>). This will require the
user to copy the file from the Journal to the Documents folder. <br>
<br>
One problem last year is that there was not enough time for us to
really check out these capabilities so I will not be surprised if
some of these cases need more programming work in the web-console
code. <br>
<br>
Note:<br>
<br>
On 05/17/2016 07:50 AM, Sebastian Silva wrote:
<br>
My concern is that these features are rather simple to implement,
but
<br>
hard to decide on. A medium-experienced python programmer might do
each
<br>
in a couple of days. Utkarsh is a fine programmer so we should have
him
<br>
do something significant with real impact, and avoid design
deadlocks.
<br>
<br>
Sebastian's compliment is well-deserved. However, my experience is
that even the simplest feature proves to have hidden and frustrating
complexity. I think this BeautifulSoup case is a perfect example. In
principle it should require an import and one line of code to save
the file in a more readable form. Then you got caught up in the
conversion of quotes to '&' format. Further, the text produced
apparently violates some assumptions Richa made about parsing the
file.<br>
<br>
It is clear that design deadlocks are to be avoided. My approach is
to build the capability and then let the users decide rather than
wait for approval in advance. Like any experiment, if the result is
not successful - something is learned.<br>
<br>
Some may judge that Sugar is a failed effort and should be abandoned
in favor of something significant with real impact.<br>
<br>
I believe the effort to provide computing capability to learners who
do not have ready access to computers and to provide these computers
with the maximum educational opportunity is a worthwhile venture and
could have important and significant impact. So I continue to work
to that end. <br>
<br>
Tony<br>
<br>
<br>
<div class="moz-cite-prefix">On 05/17/2016 07:49 AM, Ütkarsh Tiwari
wrote:<br>
</div>
<blockquote
cite="mid:CAFRUKofzJAqrzSe77tOS=tjMv+F+UMWPu+YZr+=euzCL3Y-bMg@mail.gmail.com"
type="cite">
<p dir="ltr">Checkout the web-console.py file for the relevant
extraction code. <a moz-do-not-send="true"
href="https://github.com/richaseh/browse-activity/tree/add_image">https://github.com/richaseh/browse-activity/tree/add_image</a></p>
<p dir="ltr">Thanks,<br>
Utkarsh</p>
<div class="gmail_quote">On May 17, 2016 11:13 AM, "Yash Agarwal"
<<a moz-do-not-send="true"
href="mailto:agrwal.ysh94@gmail.com">agrwal.ysh94@gmail.com</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">oh, then I'll need to see Richa's code for
this. can you send a link or just paste the relevant code
snippet here</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, May 17, 2016 at 11:07 AM Ütkarsh
Tiwari <<a moz-do-not-send="true"
href="mailto:iamutkarshtiwari@gmail.com" target="_blank">iamutkarshtiwari@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr">Hi Yash,<br>
The exactly situation here is that the
prettified html code inside the .html file
generated(after save) can't be properly parsed by the
methods(responsible for extracting js/html/css code from
.html file) written by Mr. Richa Sehgal because the
prittfied code contains the escaped characters which
result in unexpected behaviour.</p>
<p dir="ltr">Thanks,<br>
Utkarsh</p>
<div class="gmail_quote">On May 17, 2016 10:59 AM, "Yash
Agarwal" <<a moz-do-not-send="true"
href="mailto:agrwal.ysh94@gmail.com" target="_blank">agrwal.ysh94@gmail.com</a>>
wrote:<br type="attribution">
<blockquote style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">
<div dir="ltr">Hi,
<div>It would helpful if you could clarify a little,
Beautifulsoup is full featured HTML parser and
prettifying the .html file is just one of the
features. If I understand correctly you want to
prettify the code the user writes in your editor--
this can be done in real-time(little difficult) or
when the user clicks a button <prettify my
code>(quite simple to implement). If you want
to store the prettified file it shouldn't have a
problem-- could clarify what the exact issue is
here<span style="line-height:1.5">. </span></div>
<div><br>
</div>
<div>Cheers,</div>
<div>Yash</div>
</div>
<br>
<div class="gmail_quote">
<div>
<div dir="ltr">On Tue, May 17, 2016 at 7:31 AM
Dave Crossland <<a moz-do-not-send="true"
href="mailto:dave@lab6.com" target="_blank">dave@lab6.com</a>>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div class="gmail_extra">Hi
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">Kindly, I'm confused
about this js fiddler activity; why are you
putting effort into writing a fiddle
program, instead of merely packaging an
existing libre fiddle program for Sugar? </div>
<div class="gmail_extra"><br>
Cheers</div>
</div>
<div dir="ltr">
<div class="gmail_extra">Dave</div>
</div>
</div>
<div>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:Sugar-devel@lists.sugarlabs.org"
target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a moz-do-not-send="true"
href="http://lists.sugarlabs.org/listinfo/sugar-devel"
rel="noreferrer" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
<br>
</body>
</html>