2
0
Fork 0
Python port of Planète Casio's BBcode translator.
Go to file
Thomas Touhey ba03eea1a7 chore: add demo and docker 2023-12-02 16:09:09 +01:00
docker chore: add demo and docker 2023-12-02 16:09:09 +01:00
docs chore: add demo and docker 2023-12-02 16:09:09 +01:00
tests chore: add demo and docker 2023-12-02 16:09:09 +01:00
textoutpc chore: add demo and docker 2023-12-02 16:09:09 +01:00
.editorconfig refactor: port the project to docutils and poetry 2023-12-01 02:45:10 +01:00
.gitignore chore: add demo and docker 2023-12-02 16:09:09 +01:00
.pre-commit-config.yaml refactor: port the project to docutils and poetry 2023-12-01 02:45:10 +01:00
.python-version Newest elements for SaWellan to fix. 2020-07-01 12:10:35 +02:00
.tool-versions refactor: port the project to docutils and poetry 2023-12-01 02:45:10 +01:00
LICENSE.txt Latest changes (and mirror testing) 2019-06-25 14:49:22 +02:00
Makefile refactor: port the project to docutils and poetry 2023-12-01 02:45:10 +01:00
Makefile.msg refactor: port the project to docutils and poetry 2023-12-01 02:45:10 +01:00
README.rst Put TODO list in the README directly. 2020-07-01 12:21:32 +02:00
poetry.lock chore: add demo and docker 2023-12-02 16:09:09 +01:00
pyproject.toml chore: add demo and docker 2023-12-02 16:09:09 +01:00

README.rst

Planète Casio's textout() BBcode markup language translator

This module contains a BBcode to HTML translator for Planète Casio. For more information, read the documentation accessible on the official website.

Warning

If you are accessing this repository from another forge (such as Planète Casio's forge), keep in mind that it is only a mirror and that the real repository is located in my forge for now.

For example, if we want to translate some basic multi-block text to HTML:

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))

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"].