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

Playground: language changing broken? #8

Open
tomByrer opened this issue Nov 17, 2015 · 20 comments
Open

Playground: language changing broken? #8

tomByrer opened this issue Nov 17, 2015 · 20 comments

Comments

@tomByrer
Copy link

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

@chrissimpkins
Copy link
Contributor

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
Copy link
Contributor

mynetx commented Nov 18, 2015

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

@tomByrer
Copy link
Author

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
Copy link
Contributor

@tomByrer 👍 Like the idea. @jublo thoughts?

@mynetx
Copy link
Contributor

mynetx commented Dec 3, 2015

@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! 😉

@chrissimpkins
Copy link
Contributor

@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
Copy link
Author

tomByrer commented Jan 2, 2016

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
Copy link
Contributor

@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
Copy link
Contributor

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
Copy link
Author

tomByrer commented Jan 3, 2016

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
Copy link
Contributor

@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
Copy link
Contributor

mynetx commented Jan 3, 2016

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

@chrissimpkins
Copy link
Contributor

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

@mynetx
Copy link
Contributor

mynetx commented Jan 3, 2016

@chrissimpkins Elaborate.

@chrissimpkins
Copy link
Contributor

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

@mynetx
Copy link
Contributor

mynetx commented Sep 16, 2017

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

@chrissimpkins
Copy link
Contributor

@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
Copy link
Contributor

mynetx commented Sep 17, 2017

  • Ask user whether they want to keep snippet edits (if any)
  • update code sample as per selected language

@chrissimpkins
Copy link
Contributor

chrissimpkins commented Sep 17, 2017

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

  • Ask user whether they want to keep snippet edits (if any)
  • update code sample as per selected language

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
Copy link
Contributor

mynetx commented Sep 17, 2017

@chrissimpkins Apparently thanks!

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

No branches or pull requests

3 participants