diff --git a/Gemfile b/Gemfile index 3f499413..fcb0ffb3 100644 --- a/Gemfile +++ b/Gemfile @@ -28,3 +28,6 @@ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.0" if Gem.win_platform? +group :jekyll_plugins do + gem "jekyll-last-modified-at" +end \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 080e7b8e..2afbe907 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -121,6 +121,9 @@ GEM jekyll-github-metadata (2.9.4) jekyll (~> 3.1) octokit (~> 4.0, != 4.4.0) + jekyll-last-modified-at (1.2.1) + jekyll (>= 3.7, < 5.0) + posix-spawn (~> 0.3.9) jekyll-mentions (1.4.1) html-pipeline (~> 2.3) jekyll (~> 3.0) @@ -211,6 +214,7 @@ GEM sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) + posix-spawn (0.3.13) public_suffix (2.0.5) rb-fsevent (0.10.3) rb-inotify (0.9.10) @@ -247,6 +251,7 @@ PLATFORMS DEPENDENCIES github-pages jekyll-feed (~> 0.6) + jekyll-last-modified-at minima (~> 2.0) tzinfo-data wdm (~> 0.1.0) diff --git a/_api/eventManager.md b/_api/eventManager.md new file mode 100644 index 00000000..7dfa193c --- /dev/null +++ b/_api/eventManager.md @@ -0,0 +1,9 @@ +--- +title: Event Manager +--- +Explain the event manager + +## Events +There are many built-in events, they include (but are not limited to) the following: +1. +1. diff --git a/_api/plugin/events.md b/_api/plugin/events.md new file mode 100644 index 00000000..cae60d25 --- /dev/null +++ b/_api/plugin/events.md @@ -0,0 +1,24 @@ +--- +title: plugin.events() +plugin: true +method: true +--- +Listen to and emit events. + +## Syntax +> plugin.events(); + +## Event Methods +* on(*event*, *data*) +* emit(*event*, *data*, *options*) + +## Examples +```javascript +const plugin = underscript.plugin('My great plugin'); +const eventManager = plugin.events(); +eventManager.on(':load', () => console.log('Page finished loading')); + +// Call a custom event +eventManager.emit('customevent', {foo: 'bar'}); +eventManager.on('customevent', (data) => console.log(data.foo)); // output: bar +``` \ No newline at end of file diff --git a/_api/plugin/logger.md b/_api/plugin/logger.md new file mode 100644 index 00000000..a8c1e904 --- /dev/null +++ b/_api/plugin/logger.md @@ -0,0 +1,16 @@ +--- +title: plugin.logger() +plugin: true +method: true +--- +The logger is a way to output to console, prefixing the plugin name to the console output. + +## Syntax +> plugin.logger() + +## Methods + + +## Examples +```javascript +``` diff --git a/_api/plugin/name.md b/_api/plugin/name.md new file mode 100644 index 00000000..ac73403c --- /dev/null +++ b/_api/plugin/name.md @@ -0,0 +1,15 @@ +--- +title: plugin.name +plugin: true +method: false +property: true +--- +Output the name of the plugin + +## Syntax +> plugin.name; + +## Examples +```javascript +console.log(plugin.name); // My awesome plugin +``` diff --git a/_api/plugin/settings.md b/_api/plugin/settings.md new file mode 100644 index 00000000..772e8839 --- /dev/null +++ b/_api/plugin/settings.md @@ -0,0 +1,16 @@ +--- +title: plugin.settings() +plugin: true +method: true +--- +Provides access to the settings API + +## Syntax +> + +## Methods +* + +## Examples +```javascript +``` diff --git a/_api/plugin/toast.md b/_api/plugin/toast.md new file mode 100644 index 00000000..928ad1db --- /dev/null +++ b/_api/plugin/toast.md @@ -0,0 +1,16 @@ +--- +title: plugin.toast() +plugin: true +method: true +--- +Allow plugins to send toasts + +## Syntax +> + +## Methods +* + +## Examples +```javascript +``` diff --git a/_api/underscript/_packs.buy.md b/_api/underscript/_packs.buy.md new file mode 100644 index 00000000..325c41e5 --- /dev/null +++ b/_api/underscript/_packs.buy.md @@ -0,0 +1,12 @@ +--- +title: underscript.buyPacks() +method: true +--- +Buy packs + +## Syntax +> + +## Examples +```javascript +``` diff --git a/_api/underscript/addStyle.md b/_api/underscript/addStyle.md new file mode 100644 index 00000000..b1b60e5f --- /dev/null +++ b/_api/underscript/addStyle.md @@ -0,0 +1,29 @@ +--- +title: underscript.addStyle() +method: true +--- +Add CSS to the document. + +## Syntax +> underscript.addStyle(...styles); + +...styles +: Styles to add to the document + +Return Value +: Returns `Modifier Object` +```js +{ + remove(), + replace(...styles), + append(...styles), +} +``` + +## Examples +```js +const style = underscript.addStyle('style1 {}'); // Styles: style1 +style.remove(); // Styles: none +style.replace('style2 {}'); // Styles: style2 +style.append('style3 {}', 'style4 {}'); // Styles: style2, style3, style4 +``` diff --git a/_api/underscript/onPage.md b/_api/underscript/onPage.md new file mode 100644 index 00000000..b9e21a48 --- /dev/null +++ b/_api/underscript/onPage.md @@ -0,0 +1,18 @@ +--- +title: underscript.onPage() +method: true +--- +Check if you're on a page + +## Syntax +> underscript.onPage(*name*, *fn*); + +### Parameters +name +: Name of page to check + +fn +: callback function, optional, gets called if on page + +Return Value +: true if on page diff --git a/_api/underscript/packs.open.md b/_api/underscript/packs.open.md new file mode 100644 index 00000000..ff945480 --- /dev/null +++ b/_api/underscript/packs.open.md @@ -0,0 +1,24 @@ +--- +title: underscript.openPacks() +method: true +--- +Opens packs and outputs the results (via toast). + +## Syntax +> underscript.openPacks(*count*, *type*); + +### Parameters +count +: Number of packs to open + +type +: Type of pack to open ('', 'DR', 'Shiny', 'Super', 'Final') (default: '') + +## Examples +```javascript +// Open 10 packs +undescript.openPacks(10); + +// Open 5 deltarune packs +undescript.openPacks(5, 'DR'); +``` diff --git a/_api/underscript/plugins.md b/_api/underscript/plugins.md new file mode 100644 index 00000000..98f5ac5d --- /dev/null +++ b/_api/underscript/plugins.md @@ -0,0 +1,36 @@ +--- +title: underscript.plugin() +method: true +--- +The Plugin API is a service made to allow elevated access to UnderScript's internals. + +## Syntax +> underscript.plugin(*name*); + +name +: Name of plugin (See [name restrictions](#restrictions)) + +## Methods +{% for page in site.api %} + {% if page.plugin and page.method %} +{{ page.title }} +: {{ page.excerpt }} + {% endif %} +{% endfor %} + +## Properties +{% for page in site.api %} + {% if page.plugin and page.property %} +{{ page.title }} +: {{ page.excerpt }} + {% endif %} +{% endfor %} + +## Restrictions +Plugin names have the following restrictions: + +1. No two plugins may share the same name +2. Plugin names cant be longer than 20 characters +3. Plugin names can only contain alphanumeric characters and space (A-Z0-9 ) + +Any plugin names outside these bounds will trigger an error and not create a plugin diff --git a/_api/underscript/streamerMode.md b/_api/underscript/streamerMode.md new file mode 100644 index 00000000..8c782323 --- /dev/null +++ b/_api/underscript/streamerMode.md @@ -0,0 +1,15 @@ +--- +title: underscript.streamerMode() +method: true +--- +Detect if streamer mode is active + +## Syntax +> underscript.streamerMode(); // Returns true if streamer mode enabled, otherwise false + +## Examples +```javascript +if (underscript.streamerMode()) { + // Do something special +} +``` diff --git a/_api/underscript/version.md b/_api/underscript/version.md new file mode 100644 index 00000000..7bb0a09a --- /dev/null +++ b/_api/underscript/version.md @@ -0,0 +1,9 @@ +--- +title: underscript.version +method: false +property: true +--- +The version of UnderScript being used. + +## Syntax +> underscript.version; diff --git a/_config.yml b/_config.yml index 6e468a4d..605408e5 100644 --- a/_config.yml +++ b/_config.yml @@ -5,10 +5,15 @@ discord_url: https://discord.gg/jRupwTU repository: feildmaster/UnderScript theme: jekyll-theme-dinky permalink: /:title +plugins: + - jekyll-last-modified-at collections: features: output: true permalink: /feature/:title + api: + output: true + permalink: /api/:title defaults: - scope: # Make all file layouts "default" path: "" @@ -20,3 +25,9 @@ defaults: values: layout: "feature" author: "feildmaster" + - scope: # make author of api feildmaster + path: "" + type: "api" + values: + layout: "api" + author: "feildmaster" diff --git a/_features/api.md b/_features/api.md index 80b29fda..bcea7d98 100644 --- a/_features/api.md +++ b/_features/api.md @@ -1,5 +1,5 @@ --- -title: Plugin API +title: Public API date: 2019-12-30 version: 0.30.0 banner: @@ -7,50 +7,23 @@ credit: notice: requested-by: CMD_God --- -Underscript exposes a public API via the variable `underscript`. - -

Methods

-* TOC -{:toc} - -### openPacks() -Opens packs and outputs the results. -

Syntax

-> underscript.openPacks(*count*, *type*); - -

Parameters

-count -: Number of packs to open - -type -: Type of pack to open ('', 'DR', 'Shiny', 'Super', 'Final') (default: '') - -### streamerMode() -

Syntax

-> underscript.streamerMode(); // Returns true if streamer mode enabled, otherwise false - -### onPage() -

Syntax

-> underscript.onPage(*name*, *fn*); - -

Parameters

-name -: Name of page to check - -fn -: callback function, optional, gets called if on page - -Return Value -: true if on page - -### eventManager() -Listen to and emit events. -

Syntax

-> underscript.eventManager(); - -

Methods

-* on -* emit +Underscript exposes a public API via the variable `underscript`. + +## Methods +{% for page in site.api %} + {% if page.plugin != true and page.method %} +{{ page.title }} +: {{ page.excerpt }} + {% endif %} +{% endfor %} + +## Properties +{% for page in site.api %} + {% if page.plugin != true and page.property %} +{{ page.title }} +: {{ page.excerpt }} + {% endif %} +{% endfor %} ## Examples ```javascript @@ -64,11 +37,4 @@ if (underscript.streamerMode()) console.log('Streaming!'); if (underscript.onPage('Packs')) console.log('On Pack page!'); // or underscript.onPage('Packs', () => console.log('On Pack page!')); - -// Event Manager -const eventManager = underscript.eventManager(); -eventManager.on(':load', () => console.log('Page finished loading')); - -eventManager.emit('customevent', {foo: 'bar'}); -eventManager.on('customevent', (data) => console.log(data.foo)); ``` diff --git a/_features/iconHelper.md b/_features/iconHelper.md new file mode 100644 index 00000000..e0fc03e5 --- /dev/null +++ b/_features/iconHelper.md @@ -0,0 +1,9 @@ +--- +title: Icon Helper +date: 2019-09-02 +version: 0.29.0 +banner: +credit: +notice: +requested-by: Bihapove, timbob +--- diff --git a/_features/missingImport.md b/_features/missingImport.md new file mode 100644 index 00000000..300ff758 --- /dev/null +++ b/_features/missingImport.md @@ -0,0 +1,9 @@ +--- +title: +date: 2019-08-24 +version: 0.28 +banner: +credit: +notice: +requested-by: +--- diff --git a/_features/toastContent.md b/_features/toastContent.md new file mode 100644 index 00000000..ded24274 --- /dev/null +++ b/_features/toastContent.md @@ -0,0 +1,9 @@ +--- +title: +date: 2019-08-24 +version: 0.28 +banner: +credit: +notice: +requested-by: +--- diff --git a/_features/translationPreview.md b/_features/translationPreview.md new file mode 100644 index 00000000..ffd08e76 --- /dev/null +++ b/_features/translationPreview.md @@ -0,0 +1,9 @@ +--- +title: +date: 2019-10-05 +version: 0.30.0 +banner: +credit: +notice: +requested-by: +--- diff --git a/_layouts/api.html b/_layouts/api.html new file mode 100644 index 00000000..80d5bf21 --- /dev/null +++ b/_layouts/api.html @@ -0,0 +1,11 @@ +--- +layout: default +--- +

{{ page.title }}

+by {{ page.author }} ({{ page.date | date: "%B %-d, %Y" }}) +
+ +{{ content }} + +
+{{ page.last_modified_at | date: "Last updated: %B %-d, %Y at %H:%M" }} \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss index 4099547f..796f8113 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -27,7 +27,7 @@ a.installed::after { content: '!' } a.update::before { content: 'Update '; } li:target { background-color: yellow; } -dl dd { font-style: initial; } +dl dd, dl p { font-style: initial; } blockquote { border-left: 5px solid rgb(138, 138, 138); background-color: rgb(207, 207, 207); }