Coder Social home page Coder Social logo

rhtml's Introduction

RHTML

RHTML stands for Reusable-Hyper-Text-Markup-Language, and is pronounced "Rech-tee-em-el" despite how its abbreviation is. As the name stands, RHTML is a compiler-like-thing that lets you reuse HTML codes, so you won't have to spend 5 minutes on updating the navbar on your website across all 50+ pages by copy pasting. Well now that I've confused everyone even more, let's get into the actual important stuff.

Installation

It is as easy as grabbing one of the binaries from the latest release. You may place the binary anywhere in your system. Adding that directory to your system PATH would make it easier for you. Otherwise you'll have to copy and paste this binary at the root directory of every single project.

Note: RHTML can only be used with Vanilla HTML. Aka it cannot be used with frameworks like NodeJS/ReactJS/etc. Besides there's no need for RHTML to support such frameworks as most of them already has this feature built in.

Creating an empty RHTML project

  • Run the command init.

Windows:

./rhtml.exe init

Linux:

./rhtml init

Integrating RHTML into an existing project

  • Run the same command init.
  • Move your entire website source code into the newly created ./src directory.

Usage

  • The newly created ./project.json JSON file is used to store info about the RHTML project you're working on. It has a pages array, in which you may add the pages that is going to be in the final build. Note: Not including any files in here will result in the build directory being empty after building. So you must add the .html files' name here.
  • The directory ./src contains all of the website source code. The RHTML compiler (or transpiler idk) will compile from this directory, to the ./build directory.
  • Reusing another .html file is done by using
#include("file.html")

in a new line. Include in RHTML is very similar to c++ #include ""'s. Except, it uses a parenthesis and there's quotes around the file name.

Building

  • Run the commmand build to build your files.

Windows:

./rhtml.exe build

Linux:

./rhtml build

The build is written to the directory ./build

Yep that's it. Have fun. :)

If you have any questions/features/etc., feel free to make a new issue about it. Now this small project of mine is almost finished so I won't be actively working on it. Still, I might do a little bit of improvements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.