2018-04-15 01:26:30 +02:00
|
|
|
Planète Casio's textout() BBcode markup language translator
|
|
|
|
===========================================================
|
|
|
|
|
2018-07-27 02:25:38 +02:00
|
|
|
This module contains a BBcode to HTML translator for
|
|
|
|
`Planète Casio`_. For more information, read the
|
2019-06-25 14:57:15 +02:00
|
|
|
documentation accessible on `the official website`_.
|
2018-07-26 20:33:43 +02:00
|
|
|
|
2018-04-15 01:26:30 +02:00
|
|
|
.. warning::
|
2018-04-15 02:04:07 +02:00
|
|
|
|
2019-06-25 14:49:22 +02:00
|
|
|
If you are accessing this repository from another forge (such as
|
2019-06-25 14:51:27 +02:00
|
|
|
`Planète Casio's forge <https://gitea.planet-casio.com/cake/textout>`_),
|
2018-04-15 01:26:30 +02:00
|
|
|
keep in mind that it is only a mirror and that the real repository
|
2019-06-25 14:51:27 +02:00
|
|
|
is located `in my forge <https://forge.touhey.org/pc/textout.git>`_
|
|
|
|
for now.
|
2018-04-15 01:26:30 +02:00
|
|
|
|
2019-06-25 14:49:22 +02:00
|
|
|
For example, if we want to translate some basic multi-block text to HTML:
|
2018-04-15 01:26:30 +02:00
|
|
|
|
2019-06-25 14:49:22 +02:00
|
|
|
.. code-block:: python
|
2018-04-15 01:26:30 +02:00
|
|
|
|
2019-06-25 14:49:22 +02:00
|
|
|
from textoutpc import tohtml
|
|
|
|
|
|
|
|
text = """[img=center]https://www.planet-casio.com/skins/bootstrap/img/default/logo.png[/img]
|
|
|
|
|
|
|
|
Hello [color=R10]world[/color]!
|
|
|
|
[ul]
|
|
|
|
[*]This module is made by [url=https://thomas.touhey.fr/]Thomas Touhey[/url]!
|
|
|
|
[*]Use `.tohtml()` to translate magically to HTML!
|
|
|
|
[/]
|
|
|
|
"""
|
|
|
|
|
|
|
|
print(tohtml(text))
|
2018-04-15 01:26:30 +02:00
|
|
|
|
2020-07-01 12:21:32 +02:00
|
|
|
What is left to do for the next release
|
|
|
|
---------------------------------------
|
|
|
|
|
|
|
|
- Fix the not-passing unit test (``[color=blue]oh[youtube]h4WLX8hfpJw``).
|
|
|
|
- Produce a test stylesheet for demonstration purposes.
|
|
|
|
- Manage lightscript (or even markdown?) as output languages;
|
|
|
|
- Check where the errors are to display them to the user:
|
|
|
|
|
|
|
|
* Count character offset, line number and column number in the lexer;
|
|
|
|
* Produce readable exceptions;
|
|
|
|
* Make a clean interface to transmit them;
|
|
|
|
- Check why exceptions on raw tags effectively escape the content, as it
|
|
|
|
shouldn't…?
|
|
|
|
- Look for security flaws (we really don't want stored XSS flaws!).
|
|
|
|
- Implement match names (such as ``\[\*+\]`` for lists).
|
|
|
|
- Manage keywords with tags such as ``[tag key=value other="something else"]``.
|
|
|
|
|
2018-09-11 02:20:08 +02:00
|
|
|
.. _Planète Casio: https://www.planet-casio.com/
|
2019-06-25 14:49:22 +02:00
|
|
|
.. _the official website: https://textout.touhey.pro/
|