All Projects → v-exec → Purity

v-exec / Purity

Licence: other
Wiki authoring engine.

Programming Languages

PHP
23972 projects - #3 most used programming language
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Purity

ColumbusEngine
3D cross-platform game engine written in C++
Stars: ✭ 45 (+9.76%)
Mutual labels:  engine
yunfa wiki
云罚大百科
Stars: ✭ 12 (-70.73%)
Mutual labels:  wiki
wikitext
🌐 Fast wikitext-to-HTML translator
Stars: ✭ 34 (-17.07%)
Mutual labels:  wiki
DummyEngine
Small cross platform Vulkan/OpenGL 3d engine for personal experimentation
Stars: ✭ 76 (+85.37%)
Mutual labels:  engine
Edward-the-App
Write your first novel with the world's most helpful writing tool. (Out of business as of Dec 2021)
Stars: ✭ 55 (+34.15%)
Mutual labels:  writing
loco-rails
Rails is awesome, but modern web needs Loco-motive.
Stars: ✭ 53 (+29.27%)
Mutual labels:  engine
ue4-kopiarka
This is a little util that lets me copy and rename projects from one directory to another
Stars: ✭ 24 (-41.46%)
Mutual labels:  engine
pixie
Tiny template functions.
Stars: ✭ 14 (-65.85%)
Mutual labels:  engine
pixi-miniprogram
一个可运行于微信小程序的PIXI引擎,通过模拟window环境,有些功能小程序无法模拟,就直接修改了PIXI引擎代码,最终使得PIXI引擎正常运行在小程序上
Stars: ✭ 72 (+75.61%)
Mutual labels:  engine
naas
⚙️ Schedule notebooks, run them like APIs, expose securely your assets: Jupyter as a viable ⚡️ Production environment
Stars: ✭ 219 (+434.15%)
Mutual labels:  engine
unocss
The instant on-demand atomic CSS engine.
Stars: ✭ 7,866 (+19085.37%)
Mutual labels:  engine
awesome-academic-writing
MERGED with https://github.com/writing-resources/awesome-scientific-writing
Stars: ✭ 39 (-4.88%)
Mutual labels:  writing
shtm
No description or website provided.
Stars: ✭ 21 (-48.78%)
Mutual labels:  engine
Video-Engine-Dash
A Dash plugin for playing back video and optionally syncing video to timestamped CSV Data
Stars: ✭ 26 (-36.59%)
Mutual labels:  engine
DuEngine
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)
Stars: ✭ 62 (+51.22%)
Mutual labels:  engine
mine.js
🌏 A voxel engine built with JS/TS/RS. (formerly mc.js) (maybe mine.ts? or even mine.rs?)
Stars: ✭ 282 (+587.8%)
Mutual labels:  engine
Squirrel-Engine
Multithreaded C/C++ Game Engine
Stars: ✭ 90 (+119.51%)
Mutual labels:  engine
dillinger
The last Markdown editor, ever.
Stars: ✭ 7,533 (+18273.17%)
Mutual labels:  writing
dawn-api
A RESTful API package
Stars: ✭ 25 (-39.02%)
Mutual labels:  wiki
hirez-api-docs
🚧 Unofficial Hi-Rez Studios API documentation (and assets where possible) for Paladins, Realm Royale, and Smite.
Stars: ✭ 20 (-51.22%)
Mutual labels:  wiki

Purity

Purity is a specialized wiki / authoring engine written in PHP. A custom variant of it is used as the back-end for V-OS.

Text files written in the appropriate format are parsed through Purity's multi-layered parser into PHP objects called artifacts. Each artifact corresponds to a page, and once populated, is parsed into its html counterpart.

In short, Purity is a single-template content management system, made for (me, but also) programmers / people minimally experienced in web dev who:

  1. Don't want to deal with creating their own parsing system.
  2. Want to create a wiki-site / have a consistent page layout.
  3. Want to use a lightweight, simple system.
  4. Want to retain control over how things look and behave.

Features and Functionality

Purity is a content management system, made out of artifacts. An artifact is a data structure represening a template page, making Purity an appropriate engine for wiki-sites, as wiki pages are typically template-based with unique content displayed on a modular interface.

A PHP/HTML file that acts as a template with placeholders for an artifact's data is called each time a page is requested, and then that template is populated with the artifact's data.

Artifacts contain a name, image, image name, title, text, tags, custom links, and a file path. These artifacts are generated through text files written in a human-friendly format, with the intent of making writing, editing, and adding new content easy (more information on syntax below).

Using predominantly HTML and CSS, and very limited PHP, one can make a template that displays their content as they please, whilst having Purity deal with parsing the text files.

The parser allows for seamless integration of jpg, png, svg, and gif images, videos, audio files, creation of links (both pointing towards other artifacts and other sites, lists grouped by tags, access to other artifacts' information, embedded media, and custom styling of these elements through CSS).

For the more tech-oriented, artifacts can also be created procedurally in Purity, if ever one wants auto-generated pages, for instance. Furthermore, PHP and Purity's intuitive writing system can be mixed; that is to say, code can be called from the text - making it very useful to expand and implement custom content formatting and generation.

Purity has a simple API allowing basic information to be dynamically requested through client-side javascript.

Syntax

The syntax for Purity's writing system is quite simple.

Attributes

It contains attributes, which are the primary constituents of an artifact.

These are declared through the attribute name, followed by a colon, and the information to be attributed to said attribute.

All attributes, aside from name are optional, and can be omitted without issue. They can also be declared in any order.

Some attributes are collected automatically, like the file path. The artifact declaration .txt files inside folders have their path to the root of Purity saved in their path property.

name: text

image: directory>imagename

image name: text

tags: tag, tag, tag

links: linkname>link, linkname>link, linkname>link

title: text

content: text

Rules

It also contains rules, which are inline elements used to format text according to predetermined functions.

These are declared through a 'rune' syntax, where the text one wishes to be formatted is between square brackets [], with a symbol before these brackets denoting the type of formatting that should be executed.

Any attributes that take 'text' (as seen above) are capable of containing any given number of number of elements formatted through rules, and any given degree of nested rules.

=[tag] link list

-[tag] title list

=[text ++ text0] compact custom list

-[text ++ text0] spacious custom list

?[text] indented quote

~[text] monospaced note

>[code] executable PHP code

![text] subtitle

$[artifact>attribute] reference to artifact's attribute

#[artifact] local link

@[text>link] custom link

&[directory>image name (optional) ++ text] image (with optional annotation)

^[directory>audio name (optional) ++ text] audio (with optional annotation)

,[directory>video name (optional) ++ text] video (with optional annotation)

*[text] bold

_[text] italic

%[] divider

Special

Special syntax (syntax that does not conform to the symbol[data] format) is very minimal.

The text written for Purity is not parsed using whitespace, therefore, deliberate line breaks for content and titles must be declared through +.

+ line break

++ list divider

> accessor

// comment

Additional Information

Setup

Download / fork / clone this repository and copy it onto your server. Your server should be running Apache, and PHP version 7.2. For testing, feel free to use local server software like WAMP, LAMP, MAMP, XAMPP, etc.

Make sure to change .htaccess paths if you're working in a subfolder. Change RewriteRule ^(.+)$ /page.php?v=$1 [NC,L] to RewriteRule ^(.+)$ /subfolder/page.php?v=$1 [NC,L].

And for proper 404 functionality (Purity uses a custom 404 page for missing artifacts as it is setup to handle all page requests in PHP), put your site URL in the bottom of page.php in redirect().

Example

For a real-world example of an entire instance of Purity, take a look at the files found in this repo: they showcase a functional and tested example of a working instance. The example instance was made exclusively using HTML (assets/template.php), CSS (/assets/styles/style.css), and text files (/pages), without touching any part of Purity itself.

Using the API

Purity has a simple API for requesting basic artifact information using client-side Javascript. Inside /assets, requestscript.js contains a function that formats a request that corresponds to api.php's request standards. Currently, the following can be done through this method:

  • Verification of whether or not an artifact exists.

  • Request to format text into a link if it corresponds to an existing artifact.

  • Request for a select artifact's attribute.

To ensure functionaliy, be sure your server allows AJAX requests.

Creating Procedural Artifacts

To create an artifact procedurally, simply write $var = new CustomArtifact();. This data structure is identical to a regular artifact, but its attributes are all empty.

It is recommended to understand the anatomy of an artifact before creating custom ones. Simply take a look at assets/artifact.php.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].