/pages/docs/internals/index.md

https://github.com/rcarmo/sushy · Markdown · 61 lines · 34 code · 27 blank · 0 comment · 0 complexity · 97a7094e743822fa062da687eb76ba9b MD5 · raw file

  1. From: Rui Carmo
  2. Date: 2014-11-03 19:09:00
  3. Last-Modified: 2014-12-29 11:15:00
  4. Title: Internals
  5. <img src="hy.png" style="float:left; width: 120px; height: auto;">
  6. ## Hy
  7. Sushy is written in [Hy][hy], a [LISP][lisp] dialect that compiles to [Python][python] bytecode -- in effect, [Python][python] in fancy dress, chosen due to its conciseness and seamless integration with [Python][python] libraries.
  8. The following is a short description of each module.
  9. ---
  10. ### `app`
  11. This is a simple WSGI entry point, doing double duty as a [Bottle][b]-based develpment server.
  12. ### `config`
  13. The `config` module is (predictably) where Sushy is configured. Most configurable options come from environment variables, but some conventions like URL routes, meta pages and ignored folders are set there.
  14. ### `indexer`
  15. Like its name entails, the `indexer` module handles full-text and link indexing.
  16. ### `models`
  17. This is the only "pure" [Python][python] module. Its main purpose is to encapsulate database setup and access (which use the `peewee` ORM) into a small set of functional primitives.
  18. ### `render`
  19. This simply imports and abstracts away all markup processors, providing a single rendering function.
  20. ### `routes`
  21. URL routes and HTTP request handling, again courtesy of [Bottle][b].
  22. ### `render`
  23. The `render` module encapsulates all the markup renderers, providing a uniform API for them.
  24. ### `store`
  25. The `store` module provides functions to find, retrieve and parse raw page markup and front matter.
  26. ### `transform`
  27. This performs all the HTML transformations that turn the rendered markup into actual Wiki pages, reformatting links and other tags.
  28. ### `utils`
  29. This is a small grab bag of utility functions (some of which are straight ports from my [utilities library][utils]).
  30. [hy]: http://hylang.org
  31. [lisp]: Wikipedia:LISP
  32. [python]: http://python.org
  33. [utils]: https://github.com/rcarmo/python-utils
  34. [b]: http://bottlepy.org