Releases: williamtroup/Syntax.js
Releases · williamtroup/Syntax.js
Syntax.js v1.3.0 - SafeMode, Multi-Line Strings, Configuration, and lots of improvements!
New Features:
- Added multi-line string support for languages that support them (such as C#).
- String searching now uses an improved RegEx for more accurate searches.
- SafeMode support and new global library configuration options.
Public Functions:
- Added new public function "setConfiguration()", which will set up global configuration options for the whole library.
- The public function "getAllElementsHighlighted()" now returns a cloned version of "_elements" instead of a referenced version.
- The public functions "getLanguage()" and "getAllLanguages()" now return a cloned version of the language objects.
Configuration Option:
- Added new configuration option "safeMode" (defaults to true), which allows all errors to be ignored (all valid renders will still be displayed).
Languages:
- All language files (under "dist/languages") now pass false for the "triggerRender" parameter, as the library will render automatically once the DOM is loaded.
General Improvements:
- Removed some code that was no longer needed.
- The numbers column can no longer have its numbers selected (CSS controlled).
- The buttons (top right) can no longer have their text selected (CSS controlled).
- The error log shown when a language is not available is now only shown when "safeMode" is disabled.
Documentation:
- Renamed "OPTIONS.md" to "BINDING_OPTIONS.md" (which states all the options that can be used for the "data-syntax-options" binding attribute).
- Added a new version of "OPTIONS.md", which is now used to show all the configurations that can be used for the public function "setConfiguration()".
- Minor documentation updates to make things a bit clearer.
Fixes:
- Fixed the public function "destroyAll()" reset the "_elements" variable to the wrong type.
Syntax.js v1.2.0 - Printing, UI improvements, and setting improvements!
New Features:
- Printing support is now available as a configurable button (on by default).
- A new language label is now shown in the UI to state what language is being shown.
General Improvements:
- Redesigned the layout for the button(s) shown in the top left of the display (minor CSS class name changes), along with the new language label.
- Added new BootStrap testing files.
Languages:
- Added a new JSON property called "friendlyName", which states the friendly name to be shown in the language label.
- The JSON property "keywords" now accepts either an array of strings or a space-separated string.
Settings:
- Added a new setting called "showLanguageLabel", which states if the language label should be shown (defaults to true).
- Added a new setting called "showPrintButton", which states if the Print button should be shown (defaults to true).
- Added a new setting called "printButtonText", which states the text that should be shown for the new Print button (defaults to "Print").
Custom Triggers:
- Added a new custom trigger "onPrint", which is called when the "Print" button is clicked.
Fixes:
- Fixed the default color for "code" DOM elements reverting to the color set in Bootstrap.
Syntax.js v1.1.0 - New custom triggers, performance tweaks, and fixes!
General Improvements:
- The render() method now only scans for "div" and "code" DOM element types (faster).
- When a specific language is not supported, a new error log is shown in the console.
Custom Triggers:
- Added new custom trigger "onKeywordRender", which is called when a keyword is rendered (before main render completion).
- Added new custom trigger "onStringRender", which is called when a string is rendered (before main render completion).
- Added new custom trigger "onCommentRender", which is called when a comment is rendered (before main render completion).
Documentation:
- Fixed documentation missing references that prevented the library from working properly.
- Improved the README.md and README_NUGET.md documentation.
Syntax.js v1.0.0 - Major public function support, and language improvements!
Languages:
- Case Sensitive: Added a new language property "caseSensitive" (defaults to true) which states if the keyword matching is case sensitive.
- Added support for the TypeScript programming language (importable file).
Settings:
- Added a new setting called "highlightComments", which states if comments should be highlighted (defaults to true).
- Added a new setting called "highlightStrings", which states if strings should be highlighted (defaults to true).
- Added a new setting called "highlightKeywords", which states if keywords should be highlighted (defaults to true).
Public Functions:
- Renamed the public function "findAndBuildNewElements()" to "highlightAll()".
- Renamed the public function "getRenderedElements()" to "getAllElementsHighlighted()".
- Added new public function "removeLanguage()", which will remove a specific language that can be rendered by name.
- Added new public function "getAllLanguages()", which will return the object that contains all the language details.
- Added new public function "highlightElement()", which will render a specific DOM element (accepts either the element or the ID of the element).
- Added new public function "getLanguage()", which will return the details for a specific language (by name).
- Renamed the public function "destroy()" to "destroyAll()".
- Added a new version of the public function "destroy()", which will revert a specific element to its original HTML (minus the syntax attributes).
Custom Triggers:
- Renamed the custom trigger "onRender" to "onRenderComplete".
UI Improvements:
- The numbers column is now hidden by default on smaller screens (and the code line will now wrap).
Fixes:
- Fixed links to missing documentation in the main README.md and README_NUGET.md files.
- Fixed some grammar mistakes.
- Fixed a fault that prevented the original destroy() public function (now destroyAll()) from clearing down the elements list.
Syntax.js v0.8.0 - New settings and functions!
- Added a new setting called "showLineNumbers", which states if the line numbers should be shown (defaults to true).
- Renamed the public function "buildNewSyntaxElements" to "findAndBuildNewElements()".
- Added new public function "destroy()", which will revert all rendered elements to their original HTML (minus the syntax attributes).
Syntax.js v0.7.0 - New languages and NuGet.org support!
- Added NuGet.org Nuget package support via a new nuspec file.
- The default language "JavaScript" is no longer built-in, and must be imported like all other languages.
- Updated the project description.
- Added support for the C, JavaScript, and MS-SQL programming languages (importable files).
Syntax.js v0.6.0 - Indentation support, and new languages!
- Added support for the Swift and Visual Basic programming languages (importable files).
- Added new public function "getRenderedElements()", which returns all the elements that have been rendered.
- Added indentation support!
- Minor code correction for handling empty strings.
- Added a new setting called "removeBlankLines", which states if all the blank lines should be removed (defaults to false).
- Added some very light borders around the Numbers and Syntax DOM containers.
- Added a default font and font size via the SCSS/CSS.
Syntax.js - New custom trigger and languages!
- Added support for the C++ and Java programming languages (importable files).
- Fixed a fault that caused parameters to be parsed for custom triggers when they were not actually set.
- Fixed the default language containing the "*" symbol in the keywords.
- Renamed the root variable "--color-variable" to "--color-keyword".
- Added a new custom trigger "onKeywordClicked", which is fired when a keyword is clicked.
Syntax.js v0.4.0 - New languages and better option support!
- Removed public function "setOptions()", as it's not needed due to the options attribute.
- Removed the custom trigger "onOptionsUpdated", as it's not needed anymore.
- Added support to set the custom triggers via the "data-syntax-options" attribute options.
- The language property "multiLineComment" is now optional, as some languages don't require special characters for multi-line comments.
- Added support for the Python, Go, and Ruby programming languages (importable files).
Syntax.js v0.3.0 - Code/Pre support, and element options!
- Added Code/Pre element rendering support.
- Added options attribute "data-syntax-options" support, which will override the default options per code element rendered.
- Fixed a class name setting issue that caused a random space to appear.
- Added a new custom trigger "onCopy", which is fired when the "Copy" button for a syntax element is pressed.