Skip to main content

Modern language for HTML templates and markup generation with Python-like concise syntax, code reuse & modularity. Partial Django integration.

Project description

Introduction

If you are new to Hypertag, see the Quick Start for a brief introduction, or the complete Language Reference for details.

Hypertag is a modern language for front-end development that allows writing markup documents in a way similar to writing Python scripts, where indentation determines relationships between nested elements and removes the need for explicit closing tags. Hypertag provides:

Setup

Install:

pip install hypertag-lang               # watch out the name, it is "hypertag-lang"

Usage:

from hypertag import HyperHTML
html = HyperHTML().render(script)       # rendering of a Hypertag `script` to HTML

Why to use Hypertag

  • Concise syntax: inspired by Python, the indentation-based syntax is a lot cleaner, more readable and maintainable than raw markup; it requires less typing, is less redundant, and lets you concentrate on coding rather than chasing unmatched opening-closing tags.
  • Code reuse by means of functions/classes is the corner stone of programming, yet it is missing from HTML; this is fixed now with Hypertag: programmers can create reusable components in a form of custom tags (hypertags), defined either as Python functions (external tags) or directly in a document using Hypertag syntax (native tags); hypertags can be parameterized and may represent complex pieces of combined: content, style and layout - for a reuse across documents.
  • Fine-grained control over rendering process is possible with a range of native control blocks (for, while, if-elif-else, try-else) constituting a core part of Hypertag syntax, unlike in templating languages, where control structures are artificially overlaid on top of another language (HTML).
  • Modularity in Hypertag is modeled after Python's: every script may import tags and variables from other scripts, from Python modules, and from the dynamic context of script rendering; scripts and modules are arranged into packages; with these mechanisms in place, building libraries of reusable components is easy and fun.
  • Applicability to different target languages. Hypertag is not just a templating system put on top of HTML. Hypertag is a full-featured standalone programming language tailored to the generation of documents of all kinds. By defining new tags, Hypertag can be adapted to produce an arbitrary document description language.

Acknowledgements

Hypertag was partially modeled on Python's syntax, and was inspired by indentation-based templating languages: Slim, Plim, Shpaml, Haml.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hypertag-lang-1.0.3.tar.gz (92.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypertag_lang-1.0.3-py3-none-any.whl (88.9 kB view details)

Uploaded Python 3

File details

Details for the file hypertag-lang-1.0.3.tar.gz.

File metadata

  • Download URL: hypertag-lang-1.0.3.tar.gz
  • Upload date:
  • Size: 92.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for hypertag-lang-1.0.3.tar.gz
Algorithm Hash digest
SHA256 54c17502da9b1d29bd9cfcf9291daefce37b9f720cf326c2f6bc4526f8e26b39
MD5 6e66feaf652333f494635e303aa10b67
BLAKE2b-256 bf1317c407b5a06f0e54c67b9f17ca25a81d367ae09077fcd4d71aed7dad38bc

See more details on using hashes here.

File details

Details for the file hypertag_lang-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: hypertag_lang-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 88.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for hypertag_lang-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e136cf7cbb0acb0b7b65f90e29c2f3274842fa9d547a8b5634826e9f84a9d332
MD5 156dceedb905ca524c9fec2d35e44bd1
BLAKE2b-256 9ea482598c88d6fdd5bc193982d407fc22cdb7df7364811812a2d73360691c66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page