Skip to content

Commit

Permalink
Merge pull request #10 from williamtroup/0.7.0
Browse files Browse the repository at this point in the history
0.7.0
  • Loading branch information
William Troup authored Nov 28, 2023
2 parents 5f49fb7 + 6afc6d0 commit c9e80fa
Show file tree
Hide file tree
Showing 26 changed files with 456 additions and 100 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.vs
/.vscode
.DS_Store
*.nupkg
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
Syntax.js

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Syntax.js%2C%20a%20free%20JavaScript%20syntax%20highlighter&url=https://github.com/williamtroup/Syntax.js&hashtags=javascript,syntax,highlighter)
[![npm](https://img.shields.io/badge/npmjs-v0.6.0-blue)](https://www.npmjs.com/package/jsyntax.js)
[![npm](https://img.shields.io/badge/npmjs-v0.7.0-blue)](https://www.npmjs.com/package/jsyntax.js)
[![nuget](https://img.shields.io/badge/nuget-v0.7.0-purple)](https://www.nuget.org/packages/jSyntax.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Syntax.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Syntax.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup)
</h1>

> <p align="center">A lightweight, and easy to use, JavaScript syntax highlighter!</p>
> <p align="center">v0.6.0</p>
> <p align="center">A lightweight, and easy-to-use, JavaScript library for code syntax highlighting!</p>
> <p align="center">v0.7.0</p>
<br />
![Syntax.js](docs/images/main.png)
Expand Down
95 changes: 95 additions & 0 deletions README_NUGET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Syntax.js v0.7.0

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Syntax.js%2C%20a%20free%20JavaScript%20syntax%20highlighter&url=https://github.com/williamtroup/Syntax.js&hashtags=javascript,syntax,highlighter)
[![npm](https://img.shields.io/badge/npmjs-v0.7.0-blue)](https://www.npmjs.com/package/jsyntax.js)
[![nuget](https://img.shields.io/badge/nuget-v0.7.0-purple)](https://www.nuget.org/packages/jSyntax.js/)
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/williamtroup/Syntax.js/blob/main/LICENSE.txt)
[![discussions Welcome](https://img.shields.io/badge/discussions-Welcome-red)](https://github.com/williamtroup/Syntax.js/discussions)
[![coded by William Troup](https://img.shields.io/badge/coded_by-William_Troup-yellow)](https://github.com/williamtroup)

> A lightweight, and easy-to-use, JavaScript library for code syntax highlighting!

## What features does Syntax.js have?

- Zero-dependencies and extremely lightweight!
- Full API available via public functions.
- Fully styled in CSS/SASS (including the buttons) and compatible with the Bootstrap library.
- Full CSS theme support (using :root variables).
- Custom triggers for actions (when elements are rendered, options are updated, etc, etc.).
- Fully configurable.


## What browsers are supported?

All modern browsers (such as Google Chrome, FireFox, and Opera) are fully supported.


## What are the most recent changes?

To see a list of all the most recent changes, click [here](https://github.com/williamtroup/Syntax.js/blob/main/docs/CHANGE_LOG.md).


## How do I get started?

To get started using Syntax.js, do the following steps:

### 1. Prerequisites:

Make sure you include the "DOCTYPE html" tag at the top of your email, as follows:

```markdown
<!DOCTYPE html>
```

### 2. Include Files:

```markdown
<link rel="stylesheet" href="dist/syntax.js.css" />
<script src="dist/syntax.js"></script>
```

### 3. Create DOM Container:

```markdown
<div data-syntax-language="javascript">
var something = true;

if ( something ) {
console.log( "Output is written." ); // Comment

/* Multi-line
comment */
}
</div>

<code data-syntax-language="javascript" data-syntax-options="{ 'showCopyButton': false }">
<pre>
var something = true;

if ( something ) {
console.log( "Output is written." ); // Comment

/* Multi-line
comment */
}
</pre>
</code>
```

To see a list of all the available options you can use for "data-syntax-options", click [here](https://github.com/williamtroup/Syntax.js/blob/main/docs/OPTIONS.md).


### 4. Finishing Up:

That's it! Nice and simple. Please refer to the code if you need more help (fully documented).


## How do I go about customizing Syntax.js?

To customize, and get more out of Syntax.js, please read through the following documentation.


### 1. Public Functions:

To see a list of all the public functions available, click [here](https://github.com/williamtroup/Syntax.js/blob/main/docs/FUNCTIONS.md).
2 changes: 1 addition & 1 deletion dist/languages/syntax.c-plus-plus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Syntax.js v0.6.0 | (c) Bunoon | MIT License */
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "c-plus-plus", {
keywords: [
"alignas",
Expand Down
2 changes: 1 addition & 1 deletion dist/languages/syntax.c-sharp.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Syntax.js v0.6.0 | (c) Bunoon | MIT License */
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "c-sharp", {
keywords: [
"abstract",
Expand Down
40 changes: 40 additions & 0 deletions dist/languages/syntax.c.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "c", {
keywords: [
"auto",
"else",
"long",
"switch",
"break",
"enum",
"register",
"typedef",
"case",
"extern",
"return",
"union",
"char",
"float",
"short",
"unsigned",
"const",
"for",
"signed",
"void",
"continue",
"goto",
"sizeof",
"volatile",
"default",
"if",
"static",
"while",
"do",
"int",
"struct",
"_Packed",
"double"
],
comment: "//",
multiLineComment: [ "/*", "*/" ]
} );
2 changes: 1 addition & 1 deletion dist/languages/syntax.go.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Syntax.js v0.6.0 | (c) Bunoon | MIT License */
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "go", {
keywords: [
"break",
Expand Down
2 changes: 1 addition & 1 deletion dist/languages/syntax.java.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Syntax.js v0.6.0 | (c) Bunoon | MIT License */
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "java", {
keywords: [
"abstract",
Expand Down
74 changes: 74 additions & 0 deletions dist/languages/syntax.javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*! Syntax.js v0.7.0 | (c) Bunoon | MIT License */
$syntax.addLanguage( "javascript", {
keywords: [
"abstract",
"arguments",
"await",
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"continue",
"debugger",
"default",
"delete",
"do",
"double",
"else",
"enum",
"eval",
"export",
"extends",
"false",
"final",
"finally",
"float",
"for",
"function",
"goto",
"if",
"implements",
"import",
"in",
"instanceof",
"int",
"interface",
"let",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"typeof",
"var",
"void",
"volatile",
"while",
"with",
"yield"
],
comment: "//",
multiLineComment: [
"/*",
"*/"
]
} );
Loading

0 comments on commit c9e80fa

Please sign in to comment.