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

Autoloader Plugin #766

Merged
merged 3 commits into from
Sep 22, 2015
Merged

Autoloader Plugin #766

merged 3 commits into from
Sep 22, 2015

Conversation

Golmote
Copy link
Contributor

@Golmote Golmote commented Sep 10, 2015

Discussion about this lies in #456. Our main issue was to determine the dependencies for each language. Here, with a map automatically kept up to date with a gulp task, the issue is solved.

See online example here.

What do you think?

}

// The dependencies map is built automatically with gulp
var lang_dependencies = /*languages_placeholder[*/{"javascript":"clike","actionscript":"javascript","aspnet":"markup","bash":"clike","c":"clike","csharp":"clike","cpp":"c","coffeescript":"javascript","css-extras":"css","d":"clike","dart":"clike","fsharp":"clike","glsl":"clike","go":"clike","groovy":"clike","haml":"ruby","handlebars":"markup","jade":"javascript","java":"clike","less":"css","markdown":"markup","objectivec":"c","php":"clike","php-extras":"php","processing":"clike","qore":["clike"],"jsx":["markup","javascript"],"ruby":"clike","sass":"css","scss":"css","scala":"java","smarty":"markup","swift":"clike","textile":"markup","twig":"markup","typescript":"javascript","wiki":"markup"}/*]*/;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an artifact of the gulp task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of what you mean by artifact, but yes, it was built automatically through gulp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment strings at the beginning and end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! Yes, the gulp task uses them to know where to insert the generated object.

@mAAdhaTTah
Copy link
Member

Awesome, I'll have to play around with this.

@Golmote
Copy link
Contributor Author

Golmote commented Sep 10, 2015

@mAAdhaTTah: Please let me know if you find any flaw.

var load = function() {
var force = false;
// Do we want to force reload the grammar?
if(lang.indexOf('!') > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Change to >=

Golmote added a commit that referenced this pull request Sep 22, 2015
@Golmote Golmote merged commit ed4ccfe into PrismJS:gh-pages Sep 22, 2015
@Golmote Golmote deleted the prism-autoload branch September 22, 2015 18:01
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.

None yet

2 participants