Skip to main content

No project description provided

Project description

Macros
=====

Version 0.0.1.


Macros is a collection of Hy macros. It will be developed
further to provide further convenience. It is on a very early stage.
DO NOT USE IN PRODUCTION.

install with

.. code-block:: sh

pip install git+git://github.com/Hylands/macros.git

for the very latest version, or


.. code-block:: sh

pip install macros

for the more stable version.

Then use the macros in hy using

.. code-block:: hy

(require macros.flask)
(require macros.flow)
and then use the route macro.


.. code-block:: hy

(route "/" "home.html")
(route "/" (defn womethods [] ("hello, world")))
(route "/" ["GET" "POST"] (defn wmethods [] ("hello, world")))
(route "/" ["GET" "POST"] "templatewmethods.html")
(route "/<name>/<address>" "template.html" [name] [[address "N/A"]])

The syntax is for a template:

.. code-block:: hy

(route *route-endpoint* [*possibly a list of methods*] *template* [*required args*] [*optional args*])

where *optional args* can be of the form [arg1 arg2] for the default value of None
or [[arg1 42] arg2] where arg1 would have the default value of 42, but arg2 would have the default value of None.

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

macros-0.0.1.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file macros-0.0.1.tar.gz.

File metadata

  • Download URL: macros-0.0.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for macros-0.0.1.tar.gz
Algorithm Hash digest
SHA256 04d2c7b614ce2ae401764ab37b1faa507dce26e3295bd93a679402864228218a
MD5 be904b304401a6e7be6afe9bb76ec212
BLAKE2b-256 29e06f48cec5972bf3e034823859c877830b611f9e48ddc7e10132fa393302e2

See more details on using hashes here.

Supported by

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