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

fixes #844 duplicate entries in doc #845

Merged
merged 5 commits into from
Nov 19, 2019
Merged

fixes #844 duplicate entries in doc #845

merged 5 commits into from
Nov 19, 2019

Conversation

SansGuidon
Copy link
Contributor

fixes #844

  • Keeps only one entry for TOML syntax highlighting
  • Reorders all the examples alphabetically to ease readability and detection of duplicates

@Keats
Copy link
Collaborator

Keats commented Nov 14, 2019

Hey, thanks for that but that list is actually generated by syntect automatically when rebuilding the syntaxes in https://github.com/getzola/zola/blob/master/components/config/examples/generate_sublime.rs#L30-L34 so it would need to be solved there

@SansGuidon
Copy link
Contributor Author

Thanks @Keats , I'll check that.

* generates syntaxes list, sorted and without duplicate
@SansGuidon
Copy link
Contributor Author

@Keats I've checked the code. The solution I came with is not what I really wanted, i.e it's a naive implementation which :

  • sorts the list
  • compare the entries for same language, and keep the one with the biggest list of file_extensions

I wanted instead to merge the duplicate entries, i.e detect when two of more entries refer to the same languages, and merge their file_extensions, but then I had to fight a battle vs Rust compiler. My understanding of this language is quite limited for now (had to learn Rust to work on this PR) while the compiler can be quite annoying / strict.

Examples online were not always relevant or clear enough. So if you have examples of clean solutions for this, I would be glad to update the PR. Otherwise feel free to do so or close it / accept it depending on the requirements :)

* generates syntaxes list, sorted and with no duplicate
* get rid of dependencies thanks to code review
* generates syntaxes list, sorted and with no duplicate
* applied code review advices, to make better usage of api
@Keats Keats changed the base branch from master to next November 19, 2019 21:50
@Keats Keats merged commit 450451b into getzola:next Nov 19, 2019
@Keats
Copy link
Collaborator

Keats commented Nov 19, 2019

Thanks!

@SansGuidon
Copy link
Contributor Author

Thank you @Keats 😁, this was a great opportunity to start learning about rust. Maybe not my last contribution.

@Keats
Copy link
Collaborator

Keats commented Nov 19, 2019

Maybe not my last contribution.

I hope it isn't!

Keats pushed a commit that referenced this pull request Feb 3, 2020
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

Successfully merging this pull request may close these issues.

2 participants