sf-web / sf-web.github.io

Source Foundry - sourcefoundry.org website
http://sourcefoundry.org
8 stars 3 forks source link

Playground: language changing broken? #8

Open tomByrer opened 8 years ago

tomByrer commented 8 years ago

When I change the language, nothing changes but the highlighting. Used to be different code examples were swapped? Win & Linux, Chrome, Fx, IE

chrissimpkins commented 8 years ago

I don't believe that @jublo implemented different example code blocks for different languages, just the JS specimen and option to enter your own, then highlight it to date.

mynetx commented 8 years ago

@tomByrer Chris is right, for now there are no additional code samples. Do you have any suitable ones in mind?

tomByrer commented 8 years ago

Thanks for your interest! I found a decent code example collection: https://github.com/isagalaev/highlight.js/blob/master/test/detect/css/default.txt But most are missing a few essentials like comments. I'm thinking of splitting the examples into a separate repo & massage them there. I haven't decided on the best file structure / naming convention. Or maybe there is a better collection? What do you guys think?

On Nov 18, 2015, at 4:03 AM, Jublo notifications@github.com wrote:

@tomByrer Chris is right, for now there are no additional code samples. Do you have any suitable ones in mind?

— Reply to this email directly or view it on GitHub.

chrissimpkins commented 8 years ago

@tomByrer :+1: Like the idea. @jublo thoughts?

mynetx commented 8 years ago

@tomByrer Thanks for the effort you put into this! We’ll gladly take any code you can provide, but the better prepared, the less work for us! :wink:

chrissimpkins commented 8 years ago

@jublo @tomByrer have a look at https://github.com/source-foundry/code-corpora

We have a number of commonly used projects across common language types that we are using as the basis of our source code analysis to optimize Hack. Perhaps a place to pinch some code and get started?

tomByrer commented 8 years ago

That looks great @chrissimpkins; exactly what I was looking for! I discovered a few extras for commonly confused chars here: https://github.com/source-foundry/text-specimens/blob/master/semi-source/confusedchar-compact.txt

chrissimpkins commented 8 years ago

@tomByrer it is pseudo code and may cause syntax highlighting issues but it is a great example of characters that are commonly confused. thoughts @jublo?

chrissimpkins commented 8 years ago

I have been tossing around the idea of generating short code snippets for the most common programming languages as part of that repo that you linked Tom. Maybe a better approach would be to understand the common tokens that are used in each language and then find a way to display those along with commonly confused characters in each specimen. We can be creative. I think that this would be a great resource for others and would support the syntax highlighting in the ACE editor that JM developed here.

tomByrer commented 8 years ago

common tokens that are used in each language and then find a way to display those along with commonly confused characters in each specimen

That sounds like a good idea.

chrissimpkins commented 8 years ago

@tomByrer Here is where we are pulling together the source code specimens

https://github.com/source-foundry/code-corpora

I've put together an early version of a script that analyzes the token frequency in each of the language types with the Python NLTK library and intend to expand on this analysis. This was prompted by our interest in a more objective approach to the optimization of the Hack typeface and we intend to use the results to guide upcoming changes to the Hack fonts.

I think that the analysis will be very helpful for the development of a set of source code text specimen "standards" as well. We could place these out in the wild in an attempt to reach a consensus among the open source developer community.

mynetx commented 8 years ago

@chrissimpkins The confusedchar file looks good, especially in view of our discussions about backslashes, pipes etc.

chrissimpkins commented 8 years ago

@jublo question is about implementation on Font Playground as a new specimen type

mynetx commented 8 years ago

@chrissimpkins Elaborate.

chrissimpkins commented 8 years ago

@jublo see OP message and your post earlier in this thread. he suggested code for Font Playground

mynetx commented 6 years ago

@chrissimpkins Are we to swap sample code shown on editors once user changes selected language?

chrissimpkins commented 6 years ago

@jublo Your font playground design. Please implement what you feel best, PR, and we will get it merged in. Code samples still exist in that code corpora repository if they are helpful.

mynetx commented 6 years ago
chrissimpkins commented 6 years ago

add - in front of your boxes and you will get true checklist Markdown that you can check:

If you put them in the OP, you see the number of incomplete checklist tasks in the IR listing on Github. Not sure if that feature works from thread posts or not (we'll see after this is entered) :)

mynetx commented 6 years ago

@chrissimpkins Apparently thanks!