Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code examples #14

Open
jnoller opened this issue Dec 13, 2011 · 5 comments
Open

Add code examples #14

jnoller opened this issue Dec 13, 2011 · 5 comments

Comments

@jnoller
Copy link
Contributor

@jnoller jnoller commented Dec 13, 2011

We need a side by side code example using the twitter bootstrap mechanisms for code viewing that shows Python 2 versus Python 3 code (and how little changes are needed) on the site.

@kracekumar
Copy link

@kracekumar kracekumar commented Dec 14, 2011

How about using 2to3 convert the code and test which will help 2to3 to reach accuracy in conversion?

@jnoller
Copy link
Contributor Author

@jnoller jnoller commented Dec 14, 2011

That doesn't make a lot of sense - the point is to show the difference between the two, or at least highlight 3 - not to test 2to3, since it is mostly accurate.

On Wednesday, December 14, 2011 at 10:36 AM, kracekumar wrote:

How about using 2to3 convert the code and test which will help 2to3 to reach accuracy in conversion?


Reply to this email directly or view it on GitHub:
#14 (comment)

@kracekumar
Copy link

@kracekumar kracekumar commented Dec 14, 2011

Fine. Then generating code from 2to3 will make sense and if it is feasible to run 2to3 as background process to do it. For simplicity we can add py3 code directly.

Idea For implementing:
1.add pretty.css
2.add pretty.js and body onload call prettyPrint().

Let user enter or author enter the code as follow:
<code> print("python 3 welcomes you") </code>

To highlight keywords we need to link to google's prettyprint and code should be replaced as

<pre class="prettyprint"> #actual python code </pre>

else embed pyt3 & py2 directly inside the tag
<pre class="prettyprint"> </pre>

@jnoller
Copy link
Contributor Author

@jnoller jnoller commented Dec 14, 2011

that is an interesting idea - a live 2to3 translation - open a new ticket - that's beyond the capabilities of the site right now, but a good idea!

On Wednesday, December 14, 2011 at 10:58 AM, kracekumar wrote:

Fine. Then generating code from 2to3 will make sense and if it is feasible to run 2to3 as background process to do it. For simplicity we can add py3 code directly.

Idea For implementing:
1.add pretty.css
2.add pretty.js and body onload call prettyPrint().

Let user enter or author enter the code as follow:

print("python 3 welcomes you")

To highlight keywords we need to link to google's prettyprint and code should be replaced as

#actual python code

else embed pyt3 & py2 directly inside the tag



Reply to this email directly or view it on GitHub:
#14 (comment)

@kracekumar
Copy link

@kracekumar kracekumar commented Dec 14, 2011

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants