From 23480e5b44e66178cf9739d60f98878a6d5ae3fb Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Wed, 2 Apr 2025 12:44:13 +0000 Subject: [PATCH] doc(upstream): add documentation for Vegvisir 3.1.5 (#7) Reviewed-on: https://codeberg.org/vegvisir/website/pulls/7 --- Consts.php | 2 +- public/docs/v3.1.5/Reference/Env.php | 55 ++++++++++++ .../v3.1.5/Reference/JavaScript/EVENTS.php | 30 +++++++ .../docs/v3.1.5/Reference/JavaScript/MODE.php | 29 ++++++ .../v3.1.5/Reference/JavaScript/POSITION.php | 39 ++++++++ .../v3.1.5/Reference/JavaScript/TARGET.php | 41 +++++++++ .../v3.1.5/Reference/JavaScript/abort.php | 29 ++++++ .../Reference/JavaScript/bindElements.php | 22 +++++ .../Reference/JavaScript/constructor.php | 24 +++++ .../v3.1.5/Reference/JavaScript/index.php | 10 +++ .../v3.1.5/Reference/JavaScript/navigate.php | 55 ++++++++++++ .../v3.1.5/Reference/JavaScript/options.php | 55 ++++++++++++ public/docs/v3.1.5/Reference/PHP/VV/css.php | 52 +++++++++++ public/docs/v3.1.5/Reference/PHP/VV/embed.php | 52 +++++++++++ .../docs/v3.1.5/Reference/PHP/VV/include.php | 51 +++++++++++ public/docs/v3.1.5/Reference/PHP/VV/index.php | 6 ++ public/docs/v3.1.5/Reference/PHP/VV/init.php | 35 ++++++++ public/docs/v3.1.5/Reference/PHP/VV/js.php | 52 +++++++++++ public/docs/v3.1.5/Reference/PHP/VV/root.php | 36 ++++++++ public/docs/v3.1.5/Reference/PHP/index.php | 10 +++ public/docs/v3.1.5/Reference/aside.php | 89 +++++++++++++++++++ public/docs/v3.1.5/Reference/index.php | 15 ++++ public/docs/v3.1.5/Reference/layout.php | 4 + .../docs/v3.1.5/Reference/vv-attributes.php | 42 +++++++++ public/docs/v3.1.5/aside.php | 33 +++++++ public/docs/v3.1.5/get-started.php | 43 +++++++++ public/docs/v3.1.5/index.php | 19 ++++ public/docs/v3.1.5/installation.php | 86 ++++++++++++++++++ public/docs/v3.1.5/layout.php | 4 + .../v3.1.5/JS/abort/description/syntax.js.php | 1 + .../JS/abort/example_abort/example.js.php | 1 + .../JS/bindElements/description/syntax.js.php | 1 + .../bindElements/example_bind/example.js.php | 1 + .../JS/constructor/description/syntax.js.php | 1 + .../JS/events/description/syntax.js.php | 1 + .../v3.1.5/JS/mode/description/syntax.js.php | 1 + .../JS/navigate/description/syntax.js.php | 1 + .../example_element_navigate/example.js.php | 1 + .../example_shell_navigate/example.js.php | 1 + .../JS/options/description/syntax.js.php | 1 + .../JS/position/description/syntax.js.php | 1 + .../JS/target/description/syntax.js.php | 1 + .../PHP/VV/css/description/syntax.php.php | 1 + .../PHP/VV/css/example_import/index.php.php | 1 + .../PHP/VV/embed/description/syntax.php.php | 1 + .../VV/embed/example_import/compiled.html.php | 1 + .../PHP/VV/embed/example_import/icon.svg.php | 1 + .../PHP/VV/embed/example_import/index.php.php | 1 + .../PHP/VV/include/description/syntax.php.php | 1 + .../VV/include/example_import/banner.php.php | 1 + .../include/example_import/compiled.html.php | 1 + .../VV/include/example_import/index.php.php | 1 + .../PHP/VV/init/description/syntax.php.php | 1 + .../VV/init/example_init/compiled.html.php | 1 + .../PHP/VV/init/example_init/index.php.php | 1 + .../PHP/VV/init/example_init/shell.php.php | 1 + .../PHP/VV/js/description/syntax.php.php | 1 + .../PHP/VV/js/example_import/index.php.php | 1 + .../PHP/VV/root/description/syntax.php.php | 1 + .../PHP/VV/root/example_import/index.php.php | 1 + .../v3.1.5/get-started/nginx/nginx.conf.php | 1 + .../run_install_script/shell.sh.php | 1 + .../introduction_version/example.txt.php | 1 + 63 files changed, 1053 insertions(+), 1 deletion(-) create mode 100644 public/docs/v3.1.5/Reference/Env.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/EVENTS.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/MODE.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/POSITION.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/TARGET.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/abort.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/bindElements.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/constructor.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/index.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/navigate.php create mode 100644 public/docs/v3.1.5/Reference/JavaScript/options.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/css.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/embed.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/include.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/index.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/init.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/js.php create mode 100644 public/docs/v3.1.5/Reference/PHP/VV/root.php create mode 100644 public/docs/v3.1.5/Reference/PHP/index.php create mode 100644 public/docs/v3.1.5/Reference/aside.php create mode 100644 public/docs/v3.1.5/Reference/index.php create mode 100644 public/docs/v3.1.5/Reference/layout.php create mode 100644 public/docs/v3.1.5/Reference/vv-attributes.php create mode 100644 public/docs/v3.1.5/aside.php create mode 100644 public/docs/v3.1.5/get-started.php create mode 100644 public/docs/v3.1.5/index.php create mode 100644 public/docs/v3.1.5/installation.php create mode 100644 public/docs/v3.1.5/layout.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/example_abort/example.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/example_bind/example.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/constructor/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/events/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/mode/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_element_navigate/example.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_shell_navigate/example.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/options/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/position/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/target/description/syntax.js.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/example_import/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/compiled.html.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/icon.svg.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/banner.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/compiled.html.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/compiled.html.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/shell.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/example_import/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/description/syntax.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/example_import/index.php.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/nginx/nginx.conf.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/run_install_script/shell.sh.php create mode 100644 snippets/HTMLCodeDemoElement/docs/v3.1.5/introduction_version/example.txt.php diff --git a/Consts.php b/Consts.php index c17bc35..0f31a98 100644 --- a/Consts.php +++ b/Consts.php @@ -5,4 +5,4 @@ /** * # Docs */ - const VERSION_LATEST = "/public/docs/v3.1.4/"; \ No newline at end of file + const VERSION_LATEST = "/public/docs/v3.1.5/"; \ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/Env.php b/public/docs/v3.1.5/Reference/Env.php new file mode 100644 index 0000000..e0d2f08 --- /dev/null +++ b/public/docs/v3.1.5/Reference/Env.php @@ -0,0 +1,55 @@ + +
+
+

Environment variables

+

Vegvisir has a few environment variables that can be modified to change its behavior.

+

Copy .env.example.ini to .env.ini and edit the copied file to get started.

+
+
+
+

Reference

+
+
+

string

+

root_path

+

An absolute path to the folder where your project is located.

+
+
+

string

+

shell_page

+

A path relative from your root_path to a PHP file that contains a vv-shell element, and will be loaded as the shell of your page.

+
+
+

string

+

public_path

+

A path relative from your root_path to a folder containing public PHP pages and other public static assets.

+

The default for this variable is "public/".

+
+
+

string | null

+

error_page_path

+

An optional path relative from your root_path to a PHP file that will be loaded when a page can not be found.

+

Commenting-out this variable or setting it to null will disable error pages. An empty respone body will be returned.

+
+
+

string

+

worker_magic_pathname

+

Vegvisir navigation worker code will be returned when request pathname matches this string

+

This variable can be left as-is for most applications.

+
+
+

string | null

+

rfc_4288_url

+

URL to an RFC 4288 compatible MIME-type file which will be cached (until server reboot) and referenced for serving static assets.

+

The default for this variable is Apache's httpd MIME-reference.

+

Commenting-out this variable or setting it to null will disable custom MIME-lists and default to PHP's mime_content_type parser.

+
+
+

bool

+

display_php_source

+

Enabling this can lead to sensitive information being leaked from your back-end.

+

When set to true appending ".php" to the end of any page pathname will return the PHP source for that page in text/plain.

+

For example, https://example.com/page.php will let the visitor inspect the PHP code for that page.

+

Commenting-out this variable or setting it to null will default this setting to false.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/EVENTS.php b/public/docs/v3.1.5/Reference/JavaScript/EVENTS.php new file mode 100644 index 0000000..949b3a6 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/EVENTS.php @@ -0,0 +1,30 @@ + +
+
+

Navigation.EVENTS

+

A set of CustomEvent instances dispatched when various Vegvisir navigations are performed.

+
+
+ +
+
+

Properties

+
+
+

STARTED

+

An event dispatched with the type of "navstarted" on the target element when a navigation has started. This event is also dispatched on document.body.

+

The detail property of this event returns the Navigation instance that initiated the navigation.

+
+
+

FINISHED

+

An event dispatched with the type of "navfinished" on the target element when a navigation has finished loading completely (content has been injected). This event is also dispatched on document.body.

+

The detail property of this event returns the Navigation instance that initiated the navigation.

+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/MODE.php b/public/docs/v3.1.5/Reference/JavaScript/MODE.php new file mode 100644 index 0000000..07d2d52 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/MODE.php @@ -0,0 +1,29 @@ + +
+
+

Navigation.MODE

+

A static object of Navigation that alters the injection method of the target element of .navigate()

+
+
+ +
+
+

Properties

+
+
+

REPLACE

+

The inner DOM of the target element of .navigate() will be replaced with the contents of href from a Navigation instance.

+

This is the default behavior.

+
+
+

REPLACE

+

The contents of href from a Navigation instance will be inserted(appended) to the end of the existing DOM of the target element of .navigate()

+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/POSITION.php b/public/docs/v3.1.5/Reference/JavaScript/POSITION.php new file mode 100644 index 0000000..d0ebb8c --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/POSITION.php @@ -0,0 +1,39 @@ + +
+
+

Navigation.POSITION

+

A static object of Navigation that adheres to the same concept as position of .insertAdjacentElement()

+
+
+ +
+
+

Properties

+
+
+

AFTEREND

+

Inserts/replaces the DOM after the target element with the contents of href from a Navigation instance.

+
+
+

BEFOREEND

+

This is the default behavior.

+

Inserts/replaces the DOM right before closing the target element with the contents of href from a Navigation instance.

+

Navigation.MODE.REPLACE makes this perform the same operation as AFTERBEGIN.

+
+
+

AFTERBEGIN

+

Inserts/replaces the DOM right after opening the target element with the contents of href from a Navigation instance.

+

Navigation.MODE.REPLACE makes this perform the same operation as BEFOREEND.

+
+
+

BEFOREBEGIN

+

Inserts/replaces the DOM before the target element with the contents of href from a Navigation instance.

+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/TARGET.php b/public/docs/v3.1.5/Reference/JavaScript/TARGET.php new file mode 100644 index 0000000..d95cc0f --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/TARGET.php @@ -0,0 +1,41 @@ + +
+
+

Navigation.TARGET

+

A static object of Navigation that alters where the contents of a navigation should be placed relative to the target element element for .navigate().

+
+
+ +
+
+

Properties

+
+
+

TOP

+

The inner DOM of the target element will be replaced with the contents of href from a Navigation instance.

+

This is the default behavior when the vv-shell element (top navigation) is navigated.

+

Setting this parameter on a target element that isn't the vv-shell element has the same effect as a normal top navigation. The target is "ignored".

+
+
+

SELF

+

The contents of the target element will be navigated.

+

This is the default behavior when an element that isn't the vv-shell is navigated.

+

Setting this parameter on a target element that is the vv-shell (top navigation) has the same effect as TOP.

+
+
+

BLANK

+

Performs the browser-default behavior for opening links in a new window. The target element is ignored.

+
+
+

PARENT

+

The closest HTMLElement to the target element with a vv-page property present will be navigated. If no parent element with that attribute is found, the vv-shell element (top navigation) will be navigated.

+

Setting this parameter on a target element that is the vv-shell (top navigation) has the same effect as TOP.

+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/abort.php b/public/docs/v3.1.5/Reference/JavaScript/abort.php new file mode 100644 index 0000000..510ae4a --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/abort.php @@ -0,0 +1,29 @@ + +
+
+

.abort

+

Abort a Vegvisir navigation in action.

+

This is an instance property of vegvisir.Navigation.

+
+
+ +
+
+

Return value

+
+
+

AbortController

+

Returns an instance of AbortController.

+
+
+
+

Examples

+
+
+

Abort a navigation in progress

+

In this example we will perform a simple programmatic Vegvsir navigation and abort it immediately.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/bindElements.php b/public/docs/v3.1.5/Reference/JavaScript/bindElements.php new file mode 100644 index 0000000..6149bbe --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/bindElements.php @@ -0,0 +1,22 @@ + +
+
+

Navigation.bindElements()

+

Static method on the Navigation class.

+

Calling this method will trigger an automatic binding of anchor tags that haven't been bound yet.

+

SSR anchor tags are automatically bound. This method should be called after you've added anchor tags dynamically with JavaScript.

+
+
+ +
+
+
+

Examples

+
+
+

Binding an anchor tag added programmatically

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/constructor.php b/public/docs/v3.1.5/Reference/JavaScript/constructor.php new file mode 100644 index 0000000..f0dafb8 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/constructor.php @@ -0,0 +1,24 @@ + +
+
+

Navigation.constructor

+

Initialize a new Vegvisir soft-navigation programmatically.

+
+
+ +
+
+

Return value

+
+
+

Navigation

+

Returns an instance of Navigation which can then be excuted by chaining .navigate().

+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/index.php b/public/docs/v3.1.5/Reference/JavaScript/index.php new file mode 100644 index 0000000..d235e98 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/index.php @@ -0,0 +1,10 @@ + +
+
+ +

JavaScript Reference

+

Vegvisir will automatically find and bind HTMLAnchorElement tags and perform soft-navigation between pages on the same origin.

+

The Navigation lets you interact with, and expand Vegvisirs front-end behavior.

+
+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/navigate.php b/public/docs/v3.1.5/Reference/JavaScript/navigate.php new file mode 100644 index 0000000..7c6d4c7 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/navigate.php @@ -0,0 +1,55 @@ + +
+
+

.navigate()

+

+
+
+ +
+
+

Parameters

+
+
+

HTMLElement | String | null

+

target

+

An element passed either by reference or a CSS selector passed as a string (if multiple elements match the selector; the first match will be navigated).

+

If null or no value is passed to this argument, the vv-shell element will be navigated (top navigation).

+
+
+

String

+

position

+

A Navigation.POSITION string which will determine where content from the navigated page should be injected relative to target.

+
+
+

String

+

mode

+

A Navigation.MODE string which will determine how content from the navigated page should be injected relative to target.

+
+
+

Return value

+
+
+

Promise

+

Returns a Promise that will resolve when the navigated page has been injected sucessfully, or rejects if the navigation failed or if the navigation was aborted with Navigation.abort

+
+
+
+

Examples

+
+
+

Top navigation

+

Navigate the vv-shell element to another page (top navigation).

+

Remember that anchor tags with href's on the same origin are automatically navigated this way.

+
+
+ +
+
+

Navigating an element

+

Simple programmatic navigation of an element.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/JavaScript/options.php b/public/docs/v3.1.5/Reference/JavaScript/options.php new file mode 100644 index 0000000..df945a1 --- /dev/null +++ b/public/docs/v3.1.5/Reference/JavaScript/options.php @@ -0,0 +1,55 @@ + +
+
+

Navigation.options

+

An object containing parameters that can be changed to alter the behavior of a Vegvisir Navigation.

+
+
+ +
+
+

Properties

+
+
+

bool

+

pushHistory

+

Flag which when set to:

+
    +
  1. + true +

    Will cause navigations performed on an instance of Navigation to push to the History stack and update the browser pathname.

    +
  2. +
  3. + false +

    Will cause a "silent" navigation on an instance of Navigation that won't update the broweser History stack and won't change the browser pathname.

    +
  4. +
+

The default setting for this property is:

+
    +
  • true when the vv-shell (top navigation) is navigated.
  • +
  • false when an element that isn't the vv-shell element is navigated.
  • +
+
+
+

bool

+

carryRequestOptions

+

Flag which when set to:

+
    +
  1. + true +

    Will cause navigations performed on an instance of Navigation to carry the request method and response body that the initiator page received on load.

    +
  2. +
  3. + false +

    Navigations performed on an instance of Navigation will be sent as GET requests (without a request body).

    +
  4. +
+
+
+
+

Examples

+
+
+

No examples available.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/css.php b/public/docs/v3.1.5/Reference/PHP/VV/css.php new file mode 100644 index 0000000..22ab9c2 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/css.php @@ -0,0 +1,52 @@ + +
+
+

VV::css()

+

Include a CSS file into a page which will be automatically minified and inlined.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to a CSS stylehseet file.

+

Appending ".css" to the filename is optional. If omitted, the extension is infered.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a CSS file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a CSS file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns a minified version of the included stylesheet as a string. If a stylesheet can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Importing a stylesheet

+

In this example we're importing a stylesheet from /public/assets/css/style.css relative from root_path.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/embed.php b/public/docs/v3.1.5/Reference/PHP/VV/embed.php new file mode 100644 index 0000000..119f124 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/embed.php @@ -0,0 +1,52 @@ + +
+
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/include.php b/public/docs/v3.1.5/Reference/PHP/VV/include.php new file mode 100644 index 0000000..ee14bfb --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/include.php @@ -0,0 +1,51 @@ + +
+
+

VV::include()

+

Inject the compiled output of another Vegvisir page (or other PHP script).

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to another Vegvisir page or other PHP file.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a source file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a source file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns a minified version of the included source file as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Importing a code snippet into a page

+

In this example we will be including a PHP file that contains reusable code (a banner) from /snippets/banner.php into a Vegvisir page /public/index.php.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/index.php b/public/docs/v3.1.5/Reference/PHP/VV/index.php new file mode 100644 index 0000000..8a3d5a6 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/index.php @@ -0,0 +1,6 @@ + +
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/init.php b/public/docs/v3.1.5/Reference/PHP/VV/init.php new file mode 100644 index 0000000..5417adb --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/init.php @@ -0,0 +1,35 @@ + +
+
+

VV::init()

+

Initialize the Vegvisir front-end.

+

Place this as close to the bottom of your body tag in your shell_page as possible.

+
+
+ +
+
+

Parameters

+
+
+

This method takes no parameters.

+
+
+

Return value

+
+
+

string

+

Returns a script tag with the compiled and minified JavaScript required to run the Vegvisir front-end.

+
+
+
+

Examples

+
+
+

Initializing a Vegvisir website

+

In this example we will initialize a single-page website with the two required files to run a bare-bones Vegvisir website: /public/index.php and /public/shell.php.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/js.php b/public/docs/v3.1.5/Reference/PHP/VV/js.php new file mode 100644 index 0000000..ba4e092 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/js.php @@ -0,0 +1,52 @@ + +
+
+

VV::js()

+

Include a JavaScript source file into a page which will be automatically minified and inlined.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to a JavaScript source file.

+

Appending ".js" to the filename is optional. If omitted, the extension is infered.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a JavaScript source file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a JavaScript source file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns a minified version of the included JavaScript source file as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Importing a JavaScript source file

+

In this example we're importing a JavaScript source file from /public/assets/js/script.js relative from root_path.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/VV/root.php b/public/docs/v3.1.5/Reference/PHP/VV/root.php new file mode 100644 index 0000000..3ec3f43 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/VV/root.php @@ -0,0 +1,36 @@ + +
+
+

VV::root()

+

Return an absolute path to any resource relative to root_path.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to any resource relative from root_path.

+

Passing an empty string or nothing to this method will return an absolute path to the root folder itself.

+
+
+

Return value

+
+
+

string

+

Returns a string with an absolute pathname from a relative pathname passed to $pathname.

+
+
+
+

Examples

+
+
+

Check if an SVG file exists before embedding

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/PHP/index.php b/public/docs/v3.1.5/Reference/PHP/index.php new file mode 100644 index 0000000..5991928 --- /dev/null +++ b/public/docs/v3.1.5/Reference/PHP/index.php @@ -0,0 +1,10 @@ + +
+
+ +

PHP Reference

+

Vegvisir exposes a single global static class VV that can be used in any script/page loaded with Vegvisir.

+

This class contains various methods for importing, inlining assets, and returning pathnames.

+
+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/aside.php b/public/docs/v3.1.5/Reference/aside.php new file mode 100644 index 0000000..66d4b5c --- /dev/null +++ b/public/docs/v3.1.5/Reference/aside.php @@ -0,0 +1,89 @@ + + \ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/index.php b/public/docs/v3.1.5/Reference/index.php new file mode 100644 index 0000000..20024be --- /dev/null +++ b/public/docs/v3.1.5/Reference/index.php @@ -0,0 +1,15 @@ + +
+
+

Reference documents

+

Here you'll find cheat sheets for Vegvisir's VV PHP static class, and the vegvisir.Navigation JavaScript class.

+ + +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/layout.php b/public/docs/v3.1.5/Reference/layout.php new file mode 100644 index 0000000..dfc1510 --- /dev/null +++ b/public/docs/v3.1.5/Reference/layout.php @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/public/docs/v3.1.5/Reference/vv-attributes.php b/public/docs/v3.1.5/Reference/vv-attributes.php new file mode 100644 index 0000000..043fbf3 --- /dev/null +++ b/public/docs/v3.1.5/Reference/vv-attributes.php @@ -0,0 +1,42 @@ + +
+
+

Navigation attributes

+

Vegvisir has a few attributes that can be added to elements that can be used to bind navigations and change navigation behavior without JavaScript.

+
+
+

string

+

vv

+

This attribute can be added to any clickable HTML element to bind it like an anchor tag.

+

The value of this attribute should be a string with a pathname to the page that should be loaded.

+

An element with this attribute will be treated just like an anchor tag, which means (by default) the vv-shell will be navigated.

+

Note: If added to an anchor tag, the anchor href will be prefered - and the vv will be ignored.

+
+
+

string

+

vv-position

+

A Navigation.POSITION string that determines where the contents of vv (or href on an anchor tag) should be injected relative to the element with this attribute.

+
+
+

string

+

vv-mode

+

A Navigation.MODE string that determines how the contents of vv (or href on an anchor tag) should be injected relative to the element with this attribute.

+
+
+
+

Wrapper attributes

+

Vegvisir sets a few attributes on elements that wrap soft-navigated content. These attributes are created automatically when it's the first time an element is used as a wrapper.

+
+
+

string

+

vv-page

+

This attribute's value will be updated with the pathname of the page that was soft-navigated to.

+

The attribute is set when a navigation is initiated.

+
+
+

bool

+

vv-loading

+

The value of this attribute will be a string-boolean with a value of "true" or "false".

+

this attribute will be "true" when a navigation is initiated, and set to "false" when the contents of the target page has been fully loaded (DOM ready).

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/aside.php b/public/docs/v3.1.5/aside.php new file mode 100644 index 0000000..0048851 --- /dev/null +++ b/public/docs/v3.1.5/aside.php @@ -0,0 +1,33 @@ + + \ No newline at end of file diff --git a/public/docs/v3.1.5/get-started.php b/public/docs/v3.1.5/get-started.php new file mode 100644 index 0000000..4728661 --- /dev/null +++ b/public/docs/v3.1.5/get-started.php @@ -0,0 +1,43 @@ + +
+
+

Get Started with Vegvisir

+

In this guide we will install Vegvisir from a template repository. I will be using a Debian Linux environment for this demonstration.

+
+
+

Prerequisites

+
    +
  • PHP 8.3+
  • +
  • Composer
  • +
  • A web server
  • +
+
+
+

1. Clone the template repository

+

There is a template repository on Codeberg which you can clone or generate from which has a bare-bones website ready for us.

+ +
+
+

2. Run the install script

+

The template repository has an install.sh file in its root directory which will install and set up our Vegvisir configuration for us.

+ +
+
+

3. Configure your webserver

+

In this demo we will be using NGINX as our web server, and PHP-FPM (packaged by Ondřej Surý) as our FastCGI processor.

+

As long as you point all traffic to /vegvisir/public/index.php with PHP pass you should be fine with other web server programs too.

+ +
+
+

4. Done!

+

Navigate to your configured web server host and if you're greeted with a welcome to Vegvisir page, then everything is working as it should!

+

Feel free to experiment or follow the reference guide for more information about each Vegvisir feature.

+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/index.php b/public/docs/v3.1.5/index.php new file mode 100644 index 0000000..d13e598 --- /dev/null +++ b/public/docs/v3.1.5/index.php @@ -0,0 +1,19 @@ + +
+
+

Introduction

+

Vegvisir is a work in progress, based on a framework I developed for a company a few years ago, which in turn was based on a content injector I built for another company. You can read more about the history of this framework on my personal website.

+

Adding a Vegvisir version number after "/docs" in the pathname /docs/vX.X.X/example-docs-page lets you read the docs for a specific release.

+ +
+
+

Work in progress

+

This website (and the framework itself) is a work in progress. I apologize for the rushed, incomplete, confusing documentation on this site. I will make an effort to update these pages as best as I can.

+
+
+

The basics

+

The simple answer to what Vegvisir does is that it will automatically find and bind navigation handlers for all HTMLAnchorElements on a website. If the anchor href points to a page on the same origin; a PHP file (containing HTML and native PHP templating) from the website's public_path will be automatically soft-navigated to.

+

Another thing that Vegvisir lets you do with those soft-navigated pages is to inject and minify assets such as CSS stylesheets, JavaScript source files, and other assets that output text.

+

And the last thing that Vegvisir will offer for you is embeding snippets of PHP code (or another page) into a page.

+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/installation.php b/public/docs/v3.1.5/installation.php new file mode 100644 index 0000000..ddca810 --- /dev/null +++ b/public/docs/v3.1.5/installation.php @@ -0,0 +1,86 @@ + +
+
+ +

Installation

+

In this guide we will be installing Vegvisir on a Debian-based system with NGINX as the web server. The process should be similar for other configurations as well.

+

Please contact me if you need help

+
+
+
+ +

Prerequisites

+
    +
  • PHP 8.0 or newer (PHP 8.3 is recommended)
  • +
  • A web server (NGINX is used in this guide)
  • +
+
+
+
+ +

Step 1: Clone the repo

+

Let's start by cloning Vegvisir to a folder. The code for Vegvisir will be separate from the code for your project.

+ +

I have cloned this into the folder /var/www/vegvisir but you can put it wherever you want.

+
+
+
+ +

Step 2: Install dependencies

+

Vegvisir only has one dependency, let's cd into our folder and install it with Composer.

+ +
+
+
+ +

Step 3: Configure virtual host

+

We will be pointing a virtual host to the /public/index.php file from the Vegvisir root directory.

+

Since your project files will live in a different directory, this can be set-and-forget.

+ +
+
+
+ +

Step 4: Create project folder

+

We're almost done here. We want to create a separate folder which will hold our project files.

+

Let's create a folder /var/www/my-website as an example - you can put this wherever you want!

+ +
+
+
+ +

Step 5: Point Vegvisir to project folder

+

Now let's finish up by pointing Vegvisir to the folder we just created.

+

Make a copy of the .env.example.ini file from Vegvisir's root directory and place it in the same spot as .env.ini

+ +
+
+
+ +

There is only one line we need to change inside the .env.ini file we just created. It should be the top most variable called root_path.

+

Change the value of this variable to an absolute path to your project root folder. In our case it will be /var/www/my-website.

+ +
+
+
+ +

Done!

+

That's all there is to it. Restart your webserver if you haven't and navigate to your published website.

+

If everything worked correctly, you should see a default landing page with a summary.

+
+
+
+
+ +

Static assets

+

Vegvisir will automatically serve anything that isn't a .php file under /public in your project directory as a static asset. You can for example put your robots.txt file under /public/robots.txt and it will be returned as a text/plain document.

+

While this works fine for smaller assets, they still have to be passed through the PHP CGI. This process is a bit slower than serving assets with your web server directly - and might be a lot slower for larger files.

+

To fix this, let's add an optional location block to our NGINX configuration which will handle assets. The process should be similar for other web servers - contact me if you need help.

+
+
+
+ +

Let's add the following location block to our NGINX virtual host that we set up in Step X.

+
+
+
\ No newline at end of file diff --git a/public/docs/v3.1.5/layout.php b/public/docs/v3.1.5/layout.php new file mode 100644 index 0000000..8ad743c --- /dev/null +++ b/public/docs/v3.1.5/layout.php @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/description/syntax.js.php new file mode 100644 index 0000000..1908234 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/description/syntax.js.php @@ -0,0 +1 @@ +
new Navigation().abort -> AbortController
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/example_abort/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/example_abort/example.js.php new file mode 100644 index 0000000..efed215 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/abort/example_abort/example.js.php @@ -0,0 +1 @@ +
const nav = new vegvisir.Navigation("some/page");
// Abort initialized navigation
nav.abort.abort();
// Navigate to URL if not aborted
if (!nav.abort.aborted) {
    nav.navigate();
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/description/syntax.js.php new file mode 100644 index 0000000..e654ddf --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/description/syntax.js.php @@ -0,0 +1 @@ +
Navigation.bindElements() -> void
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/example_bind/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/example_bind/example.js.php new file mode 100644 index 0000000..e95abcf --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/bindElements/example_bind/example.js.php @@ -0,0 +1 @@ +
const element = document.createElement("a");
element.href = "/example-page";
// Append a new anchor tag to the bottom of vv-shell
vegvisir.Navigation.shellElement.appendChild(element);
// Bind the new element so we're soft-navigating that element
vegvisir.Navigation.bindElements();
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/constructor/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/constructor/description/syntax.js.php new file mode 100644 index 0000000..4dfe519 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/constructor/description/syntax.js.php @@ -0,0 +1 @@ +
new Navigation(
    hrefURL|String|null,
    options?: Navigation.options
-> this
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/events/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/events/description/syntax.js.php new file mode 100644 index 0000000..43ff107 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/events/description/syntax.js.php @@ -0,0 +1 @@ +
{
    STARTED  = "navstarted",
    FINISHED = "navfinished"
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/mode/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/mode/description/syntax.js.php new file mode 100644 index 0000000..69135b7 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/mode/description/syntax.js.php @@ -0,0 +1 @@ +
{
    REPLACE = "replace",
    INSERT  = "insert"
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/description/syntax.js.php new file mode 100644 index 0000000..a24a1ad --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/description/syntax.js.php @@ -0,0 +1 @@ +
.navigate(
    targetHTMLElement|String|null = Navigation.shellElement,
-> Promise<void>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_element_navigate/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_element_navigate/example.js.php new file mode 100644 index 0000000..b35a8fe --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_element_navigate/example.js.php @@ -0,0 +1 @@ +
const nav = new vegvisir.Navigation("/example-page");
// Navigate the passed <article> element to "public/example-page" by element reference
nav.navigate(document.querySelector("article"));
// Navigate the first section inside the article element element to "public/example-page" by CSS selector
nav.navigate("article > section:first-child");
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_shell_navigate/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_shell_navigate/example.js.php new file mode 100644 index 0000000..597eee9 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/navigate/example_shell_navigate/example.js.php @@ -0,0 +1 @@ +
new vegvisir.Navigation("/example-page").navigate();
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/options/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/options/description/syntax.js.php new file mode 100644 index 0000000..fcb28a8 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/options/description/syntax.js.php @@ -0,0 +1 @@ +
{
    bool pushHistorytrue,
    bool carryRequestOptionsfalse
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/position/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/position/description/syntax.js.php new file mode 100644 index 0000000..1e298fe --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/position/description/syntax.js.php @@ -0,0 +1 @@ +
{
    AFTEREND    = "afterend",
    BEFOREEND   = "beforeend",
    AFTERBEGIN  = "afterbegin",
    BEFOREBEING = "beforebegin"
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/target/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/target/description/syntax.js.php new file mode 100644 index 0000000..c6c81cf --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/JS/target/description/syntax.js.php @@ -0,0 +1 @@ +
{
    TOP    = "_top",
    SELF   = "_self",
    BLANK  = "_blank",
    PARENT = "_parent"
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/description/syntax.php.php new file mode 100644 index 0000000..6dca964 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::css(
        string $pathname,
        bool $relative = true
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/example_import/index.php.php new file mode 100644 index 0000000..e28e12d --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/css/example_import/index.php.php @@ -0,0 +1 @@ +
<style><?= VV::css("public/assets/css/style.css"?></style>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/description/syntax.php.php new file mode 100644 index 0000000..1cf5a11 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::embed(
        string $pathname,
        bool $relative = true
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/compiled.html.php new file mode 100644 index 0000000..1e6760a --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/compiled.html.php @@ -0,0 +1 @@ +
<button>
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 22"><g><path class="solid" d="M12 22 0 0h24Z"/><path class="stroke" d="M12 17.823 20.63 2H3.37L12 17.823M12 22 0 0h24L12 22Z"/><g opacity=".5"><path class="solid" d="M24 22 12 0h24Z"/><path class="stroke" d="M24 17.823 32.63 2H15.37L24 17.823M24 22 12 0h24L24 22Z"/></g></g></svg>
    <p>Cool button</p>
</button>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/icon.svg.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/icon.svg.php new file mode 100644 index 0000000..8d64b06 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/icon.svg.php @@ -0,0 +1 @@ +
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 22">
    <g>
        <path class="solid" d="M12 22 0 0h24Z"/>
        <path class="stroke" d="M12 17.823 20.63 2H3.37L12 17.823M12 22 0 0h24L12 22Z"/>
        <g opacity=".5">
            <path class="solid" d="M24 22 12 0h24Z"/>
            <path class="stroke" d="M24 17.823 32.63 2H15.37L24 17.823M24 22 12 0h24L24 22Z"/>
        </g>
    </g>
</svg>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/index.php.php new file mode 100644 index 0000000..952657c --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/embed/example_import/index.php.php @@ -0,0 +1 @@ +
<button>
    <?= VV::embed("public/assets/icon.svg"?>
    <p>Cool button</p>
</button>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/description/syntax.php.php new file mode 100644 index 0000000..cd4bb9b --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::include(
        string $pathname,
        bool $relative = true
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/banner.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/banner.php.php new file mode 100644 index 0000000..c66c006 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/banner.php.php @@ -0,0 +1 @@ +
<section class="banner">
    <h1>This snippet can be imported into any page with VV::include()</h1>
    <p>We can also use native PHP templating to perform SSR.</p>
    <p>Did we get a foo? <?= array_key_exists("foo"$_GET) ? "yes we did" : "no we didn't" ?>.</p>
</section>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/compiled.html.php new file mode 100644 index 0000000..5faf7a0 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/compiled.html.php @@ -0,0 +1 @@ +
<main>
    <section class="banner">
        <h1>This snippet can be imported into any page with VV::include()</h1>
        <p>We can also use native PHP templating to perform SSR.</p>
        <p>Did we get a foo? yes we did.</p>
    </section>
    <section>
        <h1>Hey psst!</h1>
        <p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
    </section>
</main>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/index.php.php new file mode 100644 index 0000000..dfd9fa4 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/include/example_import/index.php.php @@ -0,0 +1 @@ +
<main>
    <?= VV::include("snippets/banner?foo=bar"?>
    <section>
        <h1>Hey psst!</h1>
        <p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
    </section>
</main>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/description/syntax.php.php new file mode 100644 index 0000000..9f78810 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::init(): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/compiled.html.php new file mode 100644 index 0000000..26113a5 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/compiled.html.php @@ -0,0 +1 @@ +
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <vv-shell>
        <section>
            <h1>Hey!</h1>
            <p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
        </section>
    </vv-shell>
    <script>...</script>
</body>
</html>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/index.php.php new file mode 100644 index 0000000..f99e45d --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/index.php.php @@ -0,0 +1 @@ +
<section>
    <h1>Hey!</h1>
    <p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
</section>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/shell.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/shell.php.php new file mode 100644 index 0000000..369b3eb --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/init/example_init/shell.php.php @@ -0,0 +1 @@ +
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <?php // The landingpage "/public/index.php" will be loaded INTO this vv-shell element ?>
    <vv-shell></vv-shell>
    <?= VV::init() ?>
</body>
</html>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/description/syntax.php.php new file mode 100644 index 0000000..50dba88 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::js(
        string $pathname,
        bool $relative = true
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/example_import/index.php.php new file mode 100644 index 0000000..43859b8 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/js/example_import/index.php.php @@ -0,0 +1 @@ +
<script><?= VV::js("public/assets/js/script.js"?></script>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/description/syntax.php.php new file mode 100644 index 0000000..2d764b6 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::root(
        string $pathname = ""
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/example_import/index.php.php new file mode 100644 index 0000000..d6e80e1 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/PHP/VV/root/example_import/index.php.php @@ -0,0 +1 @@ +
<?php if (is_file(VV::root("public/assets/my-icon.svg"))): ?>
    <?= VV::embed("public/assets/my-icon.svg"?>
<?php endif?>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/nginx/nginx.conf.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/nginx/nginx.conf.php new file mode 100644 index 0000000..69536ba --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/nginx/nginx.conf.php @@ -0,0 +1 @@ +
server {
        listen 80;
        server_name _;
        # Replace <path_to_repo> with your directory path
        root <path_to_repo>/vegvisir/public;
        location ~ /* {
                try_files /index.php = 503;
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        }
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/run_install_script/shell.sh.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/run_install_script/shell.sh.php new file mode 100644 index 0000000..c33657d --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/get-started/run_install_script/shell.sh.php @@ -0,0 +1 @@ +
./install.sh
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.5/introduction_version/example.txt.php b/snippets/HTMLCodeDemoElement/docs/v3.1.5/introduction_version/example.txt.php new file mode 100644 index 0000000..c83b516 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.5/introduction_version/example.txt.php @@ -0,0 +1 @@ +
# Get the reference for VV::css() for the latest version of Vegvisir
/docs/Reference/PHP/VV/css
# Get the reference for VV::css() for a specific version of Vegvisir (v3.1.5 for example)
/docs/v3.1.5/Reference/PHP/VV/css
\ No newline at end of file