I can't see a way in the GeoNet editor to format a code sample properly. This is crucial for a technical discussion forum, to avoid mangling users' code samples.
StephenSee this link and the one contained within. Browsers differ in how they interact with the code, particularly if you want to copy a code snippet to your python IDE of choice.
I'm not authorized to see that link?
Granted that browsers differ in how they see code, the site needs to make it as easy as possible to format code correctly, without introducing spaces, tabs, bad quotation characters, etc. If it's not easy for people to do it, they won't do it, meaning that our job of helping answer code questions will be made much harder.
This site needs something like the Code Sample formatting tags on Stack Exchange:
In short the skinny, copied from my post, is that IE 11 doesn't remove the line numbers when you copy and paste code into a script window in several python IDEs. It was found that other browsers didn't exhibit this behaviour and this is not suitable for me since I can't switch browsers in my teaching labs...here are some results...
Bonum est vespere iudices
Dan Patterson 20-Jul-2014 11:25 AM (in response to V Stuart Foote)
I gave it a try...here is an example of copy/paste into:
pythonwin script window
01.# Here is an example
01.# Here is an example
Not very useful
In order to format content, I need to click the "Use advanced editor" button, which is only available
from a specific view. To do this, I first click on the document in the stream view:
Then I can reply to the post/comment:
Then I'm offered the advanced editor:
And then I can choose formatting:
I once saw a "Use this editor always" choice, but I seem to have lost it while trying to get the
screenshots embedded in this reply.
Hopefully Tim's team can find away to expose this aspect of the editor more cleanly in the days to come.
OK the request is now "de-confusify the ability to format code in the forums"
No-one is going to wade through all those options to format code properly. And what about the original poster?
If it's too hard to do properly, people won't do it, which means that posts containing code will be a mess, and helpful people won't answer them.
Python formatter is still wonky...notice that there are 5 quotes in the first line and there were blank lines for line 3 and line 5 which have been stripped. Using Pythonwin and Pyscripter ... browser is IE 11....sigh
ErrorsInPythonFormatting.py Triple quotes above supposed to be in line 1
line 3 is supposed to be blank as is line 5
Retrieving data ...