Module loglan_db.model_html.html_definition
This module contains a HTMLExportDefinition Model
Classes
class DefinitionFormatter
-
Additional methods for definition's formatting
Subclasses
Static methods
def format_body(body: str) ‑> str
-
Substitutes tags in the definition's body Formats punctuation signs :param body: :return:
def highlight_key(def_body, word, case_sensitive: bool = False) ‑> str
-
Highlights the current key from the list, deselecting the rest :param def_body: :param word: :param case_sensitive: :return:
def tagged_definition_body(body: str, key_word: str, tag: str) ‑> str
-
Generate Definition.body as HTML tag with highlighted key word
Args
body: key_word: tag: Returns:
def tagged_word_name(usage: str, d_source_word, tag: str) ‑> str
-
Generate Word.name as HTML tag
Args
usage: d_source_word: tag: Returns:
def tagged_word_origin_x(d_source_word, tag: str) ‑> str
-
Generate Word.origin_x as HTML tag
Args
d_source_word: tag: Returns:
class HTMLExportDefinition (**kwargs)
-
HTMLExportDefinition Class
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs
.Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships.
Ancestors
- BaseDefinition
- sqlalchemy.orm.decl_api.Model
- flask_sqlalchemy.model.Model
- InitBase
- DBBase
- DefinitionFormatter
Instance variables
var body
var created
var grammar_code
var language
var notes
var position
var slots
var updated
var usage
var word_id
Methods
def export_for_english(self, word: str, style: str = 'ultra') ‑> str
-
:param word: :param style: :return:
def export_for_loglan(self, style: str = 'ultra') ‑> str
-
:param style: :return:
Inherited members