{"id":16668540,"url":"https://github.com/codhek/voila","last_synced_at":"2025-04-09T19:32:29.671Z","repository":{"id":83582857,"uuid":"167596252","full_name":"CodHeK/Voila","owner":"CodHeK","description":"A simple and easy to grasp front-end framework that lets you modularise and stuff logic into your static HTML :sunglasses:","archived":false,"fork":false,"pushed_at":"2019-02-11T06:41:33.000Z","size":112,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T21:23:34.556Z","etag":null,"topics":["cli","custom-parser","frontend-framework","modular-framework","npm-package"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodHeK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-25T18:45:04.000Z","updated_at":"2019-07-15T22:41:03.000Z","dependencies_parsed_at":"2023-07-07T21:01:13.354Z","dependency_job_id":null,"html_url":"https://github.com/CodHeK/Voila","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodHeK%2FVoila","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodHeK%2FVoila/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodHeK%2FVoila/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodHeK%2FVoila/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodHeK","download_url":"https://codeload.github.com/CodHeK/Voila/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248097978,"owners_count":21047346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","custom-parser","frontend-framework","modular-framework","npm-package"],"created_at":"2024-10-12T11:25:47.112Z","updated_at":"2025-04-09T19:32:29.657Z","avatar_url":"https://github.com/CodHeK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](logo.png)\n\n![voila](https://img.shields.io/badge/npm-v1.2.2-blue.svg) ![build](https://img.shields.io/badge/build-passing-green.svg)\n\n[Link to the presentation](https://drive.google.com/file/d/1XnWTu-PowXnXtUk1_Bp1mdJavCoPA6zg/view?usp=sharing)\n\nVoilaJS is a  SAML ( Syntactically awesome markup language ) which boosts your static front-end development process by allowing you to write your HTML in the form of modules, very similar to React but, with a much less steeper learning curve! ( All you need to know is to write `JSON` and that's easy! :stuck_out_tongue:)\n\nThe best part is HTML just became programmable :stuck_out_tongue: !! But how ?\n\nWhat we thought was, CSS has it's programmable counter-part ( SASS ) why not HTML ? Guess what, now it has one, we call it SAML ( full form above ).\n\nJust like other front-end frameworks, we too have out our own CLI to bootstrap your starter code.\n\n\n## Installation :\n#\n```\n$ npm i -g voila-cmd\n```\n\nNext, we need to initialize a project, it's simple!\n\n```\n$ voila init\n```\n\nThis generates a `voila.json` file in your project directory and also a `config.js` file where you write all your HTML logic, sound's weird saying that doesn't it! :stuck_out_tongue:\n\n```\n{\n  title: 'forms',\n  description: 'forms',\n  css: 'Bootstrap',\n  entry: 'index.html',\n  author: '',\n  License: 'ISC',\n  git: false,\n  config: 'config.js'\n}\n```\nYou can also add `git repository` to your project, voila automatically initializes a empty git repository with the needed files in `.gitignore`.\n\n```\n$ cd directory\n```\n\n```\nexports.root = [\n  {\n    div: [\n      {\n        id: 'root',\n        //ADD YOUR ELEMENTS HERE\n        div: [\n          {\n            class: 'col-md-3'\n          }\n        ],\n        h1: [\n          {\n            class: 'title1',\n            value: 'first h1'\n          },\n          {\n            class: 'title2',\n            value: 'second h1'\n          }\n        ]\n      }\n    ]\n  }\n]\n```\n\nAbove, is an example of a simple configuration, ( configurations need to be written in the `JSON` format ).\n\nThis `JSON` gets compiled to the `HTML` below:\n\n```\n\u003croot \u003e\n  \u003cdiv id=\"root\" \u003e\n    \u003cdiv class=\"col-md-3\" \u003e  \u003c/div\u003e\n\n    \u003ch1 class=\"title1\" \u003e first h1 \u003c/h1\u003e\n\n    \u003ch1 class=\"title2\" \u003e second h1 \u003c/h1\u003e\n  \u003c/div\u003e\n\u003c/root\u003e\n```\n\n\nOnce, you've written your own `configuration`, voila needs to parse and compile it into `HTML`, to do that run...\n\n\n```\n$ voila load\n```\n\nWe have built our own `parser` that parses the `JSON` configurations and converts them into it's equivalent `HTML` syntax.\n\nThis `HTML` is can be viewed by starting the `server`, just run ...\n\n```\n$ voila start\n```\n\n## Writing HTML  in Component Style :\n\n- config.js\n```\nconst { main } = require('./components/main');\nconst { navbar } = require('./components/navbar');\n\nlet Main = main();\nlet Navbar = navbar();\n\nexports.root = [\n  {\n    div: [\n      {\n        id: 'root',\n        //ADD YOUR ELEMENTS HERE\n        Navbar,\n        Main\n      }\n    ]\n  }\n]\n```\n\n- main.js\n```\nmodule.exports.main = () =\u003e {\n  return [\n    {\n      class: 'container',\n      div: [\n        {\n          class: 'starter-template',\n          h1: [\n            {\n              value: 'Bootstrap starter template'\n            }\n          ],\n          p: [\n            {\n              class: 'lead',\n              value: 'Use this document as a way to quickly start any new project.\u003cbr\u003e All you get is this text and a mostly barebones HTML document.'\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n- navbar.js\n```\nmodule.exports.navbar = () =\u003e {\n  return [\n    {\n      class: 'navbar navbar-expand-md navbar-dark bg-dark fixed-top',\n      a: [\n        {\n          class: 'navbar-brand',\n          value: 'Logo'\n        }\n      ],\n      button: [\n        {\n          class: 'navbar-toggler',\n          type: 'button',\n          span: [\n            {\n              class: 'navbar-toggler-icon',\n            }\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n\n## Examples :\n#\nWe have added 2 examples one for `Bootstrap` and other for `Materialize` :\n```\n$ git clone this repository / download zip\n```\n\n```\n$ cd example\n```\n\n```\n$ voila start\n```\nView your static webpage server on `http://localhost:(port)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodhek%2Fvoila","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodhek%2Fvoila","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodhek%2Fvoila/lists"}