From 91fdd0b192efd30f45844fc70a120bd7d655c6d7 Mon Sep 17 00:00:00 2001 From: Michael Schmidt Date: Sun, 28 Jun 2020 01:58:55 +0200 Subject: [PATCH] Website: New assets directory for all web-only files (#2180) --- .npmignore | 7 +-- {scripts => assets}/code.js | 2 +- {scripts => assets}/download.js | 0 {scripts => assets}/examples.js | 0 favicon.png => assets/favicon.png | Bin {img => assets/img}/failures/coy-overlap.png | Bin {img => assets/img}/logo-ala.png | Bin {img => assets/img}/logo-css-tricks.png | Bin {img => assets/img}/logo-drupal.png | Bin {img => assets/img}/logo-mdn.png | Bin {img => assets/img}/logo-react.png | Bin {img => assets/img}/logo-sitepoint.png | Bin {img => assets/img}/logo-smashing.png | Bin {img => assets/img}/logo-stripe.png | Bin {img => assets/img}/spectrum.png | Bin logo.svg => assets/logo.svg | 0 {scripts => assets}/prefixfree.min.js | 0 style.css => assets/style.css | 0 {templates => assets/templates}/footer.html | 0 .../templates}/header-download.html | 0 .../templates}/header-main.html | 2 +- .../templates}/header-plugins.html | 2 +- {scripts => assets}/utopia.js | 0 {scripts => assets}/vendor/FileSaver.min.js | 0 {scripts => assets}/vendor/jszip.min.js | 0 {scripts => assets}/vendor/promise.js | 0 bower.json | 12 +----- download.html | 20 ++++----- examples.html | 18 ++++---- extending.html | 14 +++--- faq.html | 14 +++--- gulpfile.js/changelog.js | 8 +--- index.html | 34 +++++++-------- known-failures.html | 16 +++---- plugins/autolinker/index.html | 12 +++--- plugins/autoloader/index.html | 18 ++++---- plugins/command-line/index.html | 12 +++--- plugins/copy-to-clipboard/index.html | 12 +++--- plugins/custom-class/index.html | 12 +++--- plugins/data-uri-highlight/index.html | 12 +++--- plugins/diff-highlight/index.html | 12 +++--- plugins/download-button/index.html | 12 +++--- plugins/file-highlight/index.html | 12 +++--- plugins/filter-highlight-all/index.html | 12 +++--- plugins/highlight-keywords/index.html | 12 +++--- plugins/index.html | 14 +++--- plugins/inline-color/index.html | 12 +++--- plugins/jsonp-highlight/index.html | 12 +++--- plugins/keep-markup/index.html | 12 +++--- plugins/line-highlight/index.html | 12 +++--- plugins/line-numbers/index.html | 12 +++--- plugins/match-braces/index.html | 12 +++--- plugins/normalize-whitespace/index.html | 12 +++--- plugins/previewers/index.html | 12 +++--- plugins/remove-initial-line-feed/index.html | 12 +++--- plugins/show-invisibles/index.html | 12 +++--- plugins/show-language/index.html | 14 +++--- plugins/toolbar/index.html | 12 +++--- plugins/treeview/index.html | 8 ++-- plugins/unescaped-markup/index.html | 40 +++++++++--------- plugins/wpd/index.html | 16 +++---- test-suite.html | 14 +++--- test.html | 16 +++---- 63 files changed, 261 insertions(+), 280 deletions(-) rename {scripts => assets}/code.js (97%) rename {scripts => assets}/download.js (100%) rename {scripts => assets}/examples.js (100%) rename favicon.png => assets/favicon.png (100%) rename {img => assets/img}/failures/coy-overlap.png (100%) rename {img => assets/img}/logo-ala.png (100%) rename {img => assets/img}/logo-css-tricks.png (100%) rename {img => assets/img}/logo-drupal.png (100%) rename {img => assets/img}/logo-mdn.png (100%) rename {img => assets/img}/logo-react.png (100%) rename {img => assets/img}/logo-sitepoint.png (100%) rename {img => assets/img}/logo-smashing.png (100%) rename {img => assets/img}/logo-stripe.png (100%) rename {img => assets/img}/spectrum.png (100%) rename logo.svg => assets/logo.svg (100%) rename {scripts => assets}/prefixfree.min.js (100%) rename style.css => assets/style.css (100%) rename {templates => assets/templates}/footer.html (100%) rename {templates => assets/templates}/header-download.html (100%) rename {templates => assets/templates}/header-main.html (89%) rename {templates => assets/templates}/header-plugins.html (74%) rename {scripts => assets}/utopia.js (100%) rename {scripts => assets}/vendor/FileSaver.min.js (100%) rename {scripts => assets}/vendor/jszip.min.js (100%) rename {scripts => assets}/vendor/promise.js (100%) diff --git a/.npmignore b/.npmignore index a76b964aba..ded7c3a932 100644 --- a/.npmignore +++ b/.npmignore @@ -5,16 +5,11 @@ hide-*.js .DS_Store CNAME .github/ +assets/ examples/ -img/ -templates/ tests/ -scripts/ *.tgz *.html -style.css -favicon.png -logo.svg bower.json composer.json gulpfile.js diff --git a/scripts/code.js b/assets/code.js similarity index 97% rename from scripts/code.js rename to assets/code.js index d41f88bedf..e2da68aae8 100644 --- a/scripts/code.js +++ b/assets/code.js @@ -6,7 +6,7 @@ if(!document.body.addEventListener) { $$('[data-plugin-header]').forEach(function (element) { var plugin = components.plugins[element.getAttribute('data-plugin-header')]; - element.innerHTML = '
\n' + element.innerHTML = '
\n' + '

' + plugin.title + '

\n

' + plugin.description + '

'; }); diff --git a/scripts/download.js b/assets/download.js similarity index 100% rename from scripts/download.js rename to assets/download.js diff --git a/scripts/examples.js b/assets/examples.js similarity index 100% rename from scripts/examples.js rename to assets/examples.js diff --git a/favicon.png b/assets/favicon.png similarity index 100% rename from favicon.png rename to assets/favicon.png diff --git a/img/failures/coy-overlap.png b/assets/img/failures/coy-overlap.png similarity index 100% rename from img/failures/coy-overlap.png rename to assets/img/failures/coy-overlap.png diff --git a/img/logo-ala.png b/assets/img/logo-ala.png similarity index 100% rename from img/logo-ala.png rename to assets/img/logo-ala.png diff --git a/img/logo-css-tricks.png b/assets/img/logo-css-tricks.png similarity index 100% rename from img/logo-css-tricks.png rename to assets/img/logo-css-tricks.png diff --git a/img/logo-drupal.png b/assets/img/logo-drupal.png similarity index 100% rename from img/logo-drupal.png rename to assets/img/logo-drupal.png diff --git a/img/logo-mdn.png b/assets/img/logo-mdn.png similarity index 100% rename from img/logo-mdn.png rename to assets/img/logo-mdn.png diff --git a/img/logo-react.png b/assets/img/logo-react.png similarity index 100% rename from img/logo-react.png rename to assets/img/logo-react.png diff --git a/img/logo-sitepoint.png b/assets/img/logo-sitepoint.png similarity index 100% rename from img/logo-sitepoint.png rename to assets/img/logo-sitepoint.png diff --git a/img/logo-smashing.png b/assets/img/logo-smashing.png similarity index 100% rename from img/logo-smashing.png rename to assets/img/logo-smashing.png diff --git a/img/logo-stripe.png b/assets/img/logo-stripe.png similarity index 100% rename from img/logo-stripe.png rename to assets/img/logo-stripe.png diff --git a/img/spectrum.png b/assets/img/spectrum.png similarity index 100% rename from img/spectrum.png rename to assets/img/spectrum.png diff --git a/logo.svg b/assets/logo.svg similarity index 100% rename from logo.svg rename to assets/logo.svg diff --git a/scripts/prefixfree.min.js b/assets/prefixfree.min.js similarity index 100% rename from scripts/prefixfree.min.js rename to assets/prefixfree.min.js diff --git a/style.css b/assets/style.css similarity index 100% rename from style.css rename to assets/style.css diff --git a/templates/footer.html b/assets/templates/footer.html similarity index 100% rename from templates/footer.html rename to assets/templates/footer.html diff --git a/templates/header-download.html b/assets/templates/header-download.html similarity index 100% rename from templates/header-download.html rename to assets/templates/header-download.html diff --git a/templates/header-main.html b/assets/templates/header-main.html similarity index 89% rename from templates/header-main.html rename to assets/templates/header-main.html index 01fe940603..2db06c85ec 100644 --- a/templates/header-main.html +++ b/assets/templates/header-main.html @@ -1,4 +1,4 @@ -

Prism

+

Prism

Download diff --git a/templates/header-plugins.html b/assets/templates/header-plugins.html similarity index 74% rename from templates/header-plugins.html rename to assets/templates/header-plugins.html index 45e2aac856..60b5f16c36 100644 --- a/templates/header-plugins.html +++ b/assets/templates/header-plugins.html @@ -1,4 +1,4 @@ -

Prism plugins

+

Prism plugins

Download diff --git a/scripts/utopia.js b/assets/utopia.js similarity index 100% rename from scripts/utopia.js rename to assets/utopia.js diff --git a/scripts/vendor/FileSaver.min.js b/assets/vendor/FileSaver.min.js similarity index 100% rename from scripts/vendor/FileSaver.min.js rename to assets/vendor/FileSaver.min.js diff --git a/scripts/vendor/jszip.min.js b/assets/vendor/jszip.min.js similarity index 100% rename from scripts/vendor/jszip.min.js rename to assets/vendor/jszip.min.js diff --git a/scripts/vendor/promise.js b/assets/vendor/promise.js similarity index 100% rename from scripts/vendor/promise.js rename to assets/vendor/promise.js diff --git a/bower.json b/bower.json index be196bc75f..54faad4fc7 100644 --- a/bower.json +++ b/bower.json @@ -14,17 +14,9 @@ }, "ignore": [ "**/.*", - "img", - "templates", + "assets", "tests", "CNAME", - "*.html", - "style.css", - "favicon.png", - "logo.svg", - "download.js", - "prefixfree.min.js", - "utopia.js", - "code.js" + "*.html" ] } diff --git a/download.html b/download.html index 71f0e93f19..677afa7754 100644 --- a/download.html +++ b/download.html @@ -3,9 +3,9 @@ - + Download ▲ Prism - + - + @@ -132,7 +132,7 @@
-
+

Customize your download

Select your compression level, as well as the languages and plugins you need.

@@ -170,16 +170,16 @@

Customize your download

-
+
- + - - - - + + + + diff --git a/examples.html b/examples.html index e60984c4d7..e1942a2b37 100644 --- a/examples.html +++ b/examples.html @@ -3,9 +3,9 @@ - + Examples ▲ Prism - + - + @@ -51,7 +51,7 @@
-
+

Examples

The examples in this page serve a dual purpose: They act as unit tests, making it easy to spot bugs, and at the same time demonstrate what Prism can do, on simple and on edge cases.

@@ -97,14 +97,14 @@

Per language examples

-
+
- + - - - + + + diff --git a/extending.html b/extending.html index 1a77438838..532dd436aa 100644 --- a/extending.html +++ b/extending.html @@ -3,12 +3,12 @@ - + Extending Prism ▲ Prism - + - + - + @@ -24,7 +24,7 @@
-
+

FAQ

Frequently Asked Questions, with a few Questions I want people to Frequently Ask.

@@ -121,9 +121,9 @@

How can I use different highlighting for tokens with the same name in differ } -
+
- + - + diff --git a/gulpfile.js/changelog.js b/gulpfile.js/changelog.js index 147344ee5c..0c236de2a6 100644 --- a/gulpfile.js/changelog.js +++ b/gulpfile.js/changelog.js @@ -320,13 +320,7 @@ async function changes() { function changedWebsite(info) { if (info.changes.length > 0 && info.changes.every(c => { - if (/[\w-]+\.(?:html|svg)$/.test(c.file)) { - return true; - } - if (/^scripts(?:\/[\w-]+)*\/[\w-]+\.js$/.test(c.file)) { - return true; - } - return ['style.css'].indexOf(c.file) >= 0; + return /[\w-]+\.html$/.test(c.file) || /^assets\//.test(c.file); })) { addEntry('Other >> Website', info); return true; diff --git a/index.html b/index.html index 24f1f99dfb..d9e79615f4 100644 --- a/index.html +++ b/index.html @@ -7,11 +7,11 @@ window.console && console.log('foo'); - + Prism - + - + @@ -19,7 +19,7 @@
-
+
  • @@ -57,14 +57,14 @@

    Used By

    Prism is used on several websites, small and large. Some of them are:

    - Smashing Magazine - A List Apart - Mozilla Developer Network (MDN) - CSS-Tricks - SitePoint - Drupal - React - Stripe + Smashing Magazine + A List Apart + Mozilla Developer Network (MDN) + CSS-Tricks + SitePoint + Drupal + React + Stripe
    @@ -75,13 +75,13 @@

    Examples

    
     
     	

    This page’s CSS code, highlighted with Prism:

    -
    
    +	
    
     
     	

    This page’s HTML, highlighted with Prism:

    
     
     	

    This page’s logo (SVG), highlighted with Prism:

    -
    
    +	
    
     
     	

    If you’re still not sold, you can view more examples or try it out for yourself.

    @@ -292,12 +292,12 @@

    Credits

-
+
- + - + + @@ -27,7 +27,7 @@
-
+

Known failures

A list of rare edge cases where Prism highlights code incorrectly.

@@ -359,7 +359,7 @@

Coy

Coy's shadows and background might not wrap around the code correctly if combined with float of flexbox layouts.

- +

Workarounds

@@ -372,9 +372,9 @@

Workarounds

-
+
- + @@ -403,7 +403,7 @@

Workarounds

}); }); - + diff --git a/plugins/autolinker/index.html b/plugins/autolinker/index.html index 592b8d3ba2..c1ac1abff2 100644 --- a/plugins/autolinker/index.html +++ b/plugins/autolinker/index.html @@ -3,13 +3,13 @@ - + Autolinker ▲ Prism plugins - + - + @@ -52,13 +52,13 @@

HTML

<p>Autolinking in raw text: http://prismjs.com</p> -
+
- + - + diff --git a/plugins/autoloader/index.html b/plugins/autoloader/index.html index 2d7f7ca8e0..6a8187f84e 100644 --- a/plugins/autoloader/index.html +++ b/plugins/autoloader/index.html @@ -3,10 +3,10 @@ - + Autoloader ▲ Prism plugins - + - + @@ -137,17 +137,17 @@

Markdown

-
+
- + - + - - - + + + + @@ -92,13 +92,13 @@

Windows PowerShell With Output

-
+
- + - + diff --git a/plugins/copy-to-clipboard/index.html b/plugins/copy-to-clipboard/index.html index 5faca153fa..01c4e3d8a8 100644 --- a/plugins/copy-to-clipboard/index.html +++ b/plugins/copy-to-clipboard/index.html @@ -3,13 +3,13 @@ - + Copy to Clipboard ▲ Prism plugins - + - + @@ -30,14 +30,14 @@

How to use


 
 
-
+
- + - + diff --git a/plugins/custom-class/index.html b/plugins/custom-class/index.html index 1690b80bbf..624c37bd94 100644 --- a/plugins/custom-class/index.html +++ b/plugins/custom-class/index.html @@ -3,12 +3,12 @@ - + Custom Class ▲ Prism plugins - + - + @@ -171,13 +171,13 @@

Add new classes

-
+
- + - + diff --git a/plugins/data-uri-highlight/index.html b/plugins/data-uri-highlight/index.html index bcab5bdb8d..30b581b513 100644 --- a/plugins/data-uri-highlight/index.html +++ b/plugins/data-uri-highlight/index.html @@ -3,13 +3,13 @@ - + Data-URI Highlight ▲ Prism plugins - + - + @@ -42,13 +42,13 @@

Example

-
+
- + - + diff --git a/plugins/diff-highlight/index.html b/plugins/diff-highlight/index.html index 02e3e012df..1e1bd67606 100644 --- a/plugins/diff-highlight/index.html +++ b/plugins/diff-highlight/index.html @@ -3,13 +3,13 @@ - + Diff Highlight ▲ Prism plugins - + - + @@ -65,14 +65,14 @@

Example

-
+
- + - + diff --git a/plugins/download-button/index.html b/plugins/download-button/index.html index 8e29099fec..d0236bc1a8 100644 --- a/plugins/download-button/index.html +++ b/plugins/download-button/index.html @@ -3,13 +3,13 @@ - + Download Button ▲ Prism plugins - + - + @@ -39,14 +39,14 @@

Examples


 
 
-
+
- + - + diff --git a/plugins/file-highlight/index.html b/plugins/file-highlight/index.html index ff0231112c..1b41d66a25 100644 --- a/plugins/file-highlight/index.html +++ b/plugins/file-highlight/index.html @@ -3,12 +3,12 @@ - + File Highlight ▲ Prism plugins - + - + @@ -45,13 +45,13 @@

Examples

For more examples, browse around the Prism website. Most large code samples are actually files fetched with this plugin.

-
+
- + - + diff --git a/plugins/filter-highlight-all/index.html b/plugins/filter-highlight-all/index.html index 34962f65cc..bca36e1ae0 100644 --- a/plugins/filter-highlight-all/index.html +++ b/plugins/filter-highlight-all/index.html @@ -3,12 +3,12 @@ - + Filter highlightAll ▲ Prism plugins - + - + @@ -122,14 +122,14 @@

Examples

-
+
- + - + + - + @@ -61,14 +61,14 @@

HTML (Markup)

</html> -
+
- + - + diff --git a/plugins/jsonp-highlight/index.html b/plugins/jsonp-highlight/index.html index d520dd74d3..d281adf18e 100644 --- a/plugins/jsonp-highlight/index.html +++ b/plugins/jsonp-highlight/index.html @@ -3,12 +3,12 @@ - + JSONP Highlight ▲ Prism plugins - + - + @@ -154,15 +154,15 @@

Examples


 
 
-
+
- + - + diff --git a/plugins/keep-markup/index.html b/plugins/keep-markup/index.html index 333f9e0079..9075b58fa6 100644 --- a/plugins/keep-markup/index.html +++ b/plugins/keep-markup/index.html @@ -3,10 +3,10 @@ - + Keep markup ▲ Prism plugins - + - + @@ -66,13 +66,13 @@

Examples

-
+
- + - + diff --git a/plugins/line-highlight/index.html b/plugins/line-highlight/index.html index 2a974ea40b..f609a6fee1 100644 --- a/plugins/line-highlight/index.html +++ b/plugins/line-highlight/index.html @@ -3,14 +3,14 @@ - + Line highlight ▲ Prism plugins - + - + @@ -81,14 +81,14 @@

With linkable line numbers

-
+
- + - + diff --git a/plugins/line-numbers/index.html b/plugins/line-numbers/index.html index 856c8998e5..6b81b43ccf 100644 --- a/plugins/line-numbers/index.html +++ b/plugins/line-numbers/index.html @@ -3,13 +3,13 @@ - + Line Numbers ▲ Prism plugins - + - + @@ -53,13 +53,13 @@

Soft wrap support

-
+
- + - + diff --git a/plugins/match-braces/index.html b/plugins/match-braces/index.html index fdf2fa8d1d..e2cc9297ba 100644 --- a/plugins/match-braces/index.html +++ b/plugins/match-braces/index.html @@ -3,13 +3,13 @@ - + Match braces ▲ Prism plugins - + - + @@ -56,14 +56,14 @@

Lisp with rainbow braces 🌈 but without hover

(* n (factorial (- n 1))))) -
+
- + - + diff --git a/plugins/normalize-whitespace/index.html b/plugins/normalize-whitespace/index.html index a35d3e6a6f..bc2b0ab024 100644 --- a/plugins/normalize-whitespace/index.html +++ b/plugins/normalize-whitespace/index.html @@ -3,10 +3,10 @@ - + Normalize Whitespace ▲ Prism plugins - + - + @@ -162,14 +162,14 @@

Examples

-
+
- + - + diff --git a/plugins/previewers/index.html b/plugins/previewers/index.html index 6fc0ef84a7..cfefff6b18 100644 --- a/plugins/previewers/index.html +++ b/plugins/previewers/index.html @@ -3,13 +3,13 @@ - + Previewers ▲ Prism plugins - + - + @@ -211,7 +211,7 @@

new Prism.plugins.Previewer(type, updater, -
+
@@ -220,9 +220,9 @@

new Prism.plugins.Previewer(type, updater, - + - + diff --git a/plugins/remove-initial-line-feed/index.html b/plugins/remove-initial-line-feed/index.html index 9a5a4211c1..95490b28c4 100644 --- a/plugins/remove-initial-line-feed/index.html +++ b/plugins/remove-initial-line-feed/index.html @@ -3,12 +3,12 @@ - + Remove initial line feed ▲ Prism plugins - + - + @@ -41,13 +41,13 @@

With the class added

-
+
- + - + diff --git a/plugins/show-invisibles/index.html b/plugins/show-invisibles/index.html index baa3904d43..19138a0d78 100644 --- a/plugins/show-invisibles/index.html +++ b/plugins/show-invisibles/index.html @@ -3,13 +3,13 @@ - + Show Invisibles ▲ Prism plugins - + - + @@ -28,13 +28,13 @@

Examples


 
 
-
+
- + - + diff --git a/plugins/show-language/index.html b/plugins/show-language/index.html index 1f98153418..9531a13943 100644 --- a/plugins/show-language/index.html +++ b/plugins/show-language/index.html @@ -3,13 +3,13 @@ - + Show Language ▲ Prism plugins - + - + @@ -32,17 +32,17 @@

HTML (Markup)

SVG

The data-language attribute can be used to display a specific label whether it has been defined as a language or not.

-

+	

 
 
-
+
- + - + diff --git a/plugins/toolbar/index.html b/plugins/toolbar/index.html index 31eb3e2871..e85db09654 100644 --- a/plugins/toolbar/index.html +++ b/plugins/toolbar/index.html @@ -3,13 +3,13 @@ - + Toolbar ▲ Prism plugins - + - + @@ -95,12 +95,12 @@

Ordering buttons

<body data-toolbar-order="select-code,hello-world,label">
-
+
- + - + diff --git a/plugins/treeview/index.html b/plugins/treeview/index.html index 126edf2274..24d7e99402 100644 --- a/plugins/treeview/index.html +++ b/plugins/treeview/index.html @@ -6,10 +6,10 @@ Treeview ▲ Prism plugins - + - + @@ -75,9 +75,9 @@

How to use

- + - + diff --git a/plugins/unescaped-markup/index.html b/plugins/unescaped-markup/index.html index 43d39c8646..5efc7ab795 100644 --- a/plugins/unescaped-markup/index.html +++ b/plugins/unescaped-markup/index.html @@ -3,14 +3,14 @@ - + Unescaped markup ▲ Prism plugins - + - + @@ -46,18 +46,18 @@

Examples

- + Keep markup ▲ Prism plugins - + - @@ -108,18 +108,18 @@

FAQ

- + Keep markup ▲ Prism plugins - + - +
-
+

Unescaped markup

Write markup without having to escape anything.

@@ -152,13 +152,13 @@

FAQ

Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.

-
+
- + - + -->
@@ -178,13 +178,13 @@

FAQ

Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.

-
+
- + - + diff --git a/plugins/wpd/index.html b/plugins/wpd/index.html index 596b49119c..3cae97c4cc 100644 --- a/plugins/wpd/index.html +++ b/plugins/wpd/index.html @@ -3,13 +3,13 @@ - + WebPlatform Docs ▲ Prism plugins - + - + @@ -41,23 +41,23 @@

How to use

Examples

CSS

-

+	

 	

 
 	

HTML


 
 	

SVG

-

+	

 
 
-
+
- + - + diff --git a/test-suite.html b/test-suite.html index e95a5d4546..2e2e171b3b 100644 --- a/test-suite.html +++ b/test-suite.html @@ -3,11 +3,11 @@ - + Running the test suite ▲ Prism - + - + @@ -15,7 +15,7 @@
-
+

Running the test suite

@@ -162,13 +162,13 @@

Internal structure

-
+
- + - + diff --git a/test.html b/test.html index 8180554d16..55caccfcd7 100644 --- a/test.html +++ b/test.html @@ -3,9 +3,9 @@ - + Test drive ▲ Prism - + - + @@ -100,7 +100,7 @@
-
+

Test drive

Take Prism for a spin!

@@ -124,13 +124,13 @@

Test drive

-
+
- + - - + +