Wikin
Documentation generated by Wikin.
Module: Generator (wikin.generator)
Classes
Generates a premium-look HTML documentation from parsed module data.
This class handles rendering the parsed Abstract Syntax Tree representation of Python functions and configurations into a Jinja2 template with modern CSS formatting and Javascript indexing for global search support.
Attributes
| Name | Type | Description |
|---|---|---|
| project_name | str | The generic name of the documented project wrapper. |
| version | str | The overarching software version of the package. |
| config | dict | Cached configuration dictionary dynamically loaded via .wikinconfig. |
| links | dict | Accessible project repository and interface navigational links wrapper. |
| multipage | bool | Instructs if internal outputs should parse identically out independently generated sub-pages. |
| env | jinja2.Environment | Central template-loading structure context. |
| template | jinja2.Template | Resolved loaded Jinja2 primary processing file HTML wrapper. |
__init__(self, project_name: str, version: str, docs_dir: str='docs')
Initialize the generator with project metadata and configuration.
This constructor initializes templating attributes, maps specific parsing mechanisms dynamically to Tomli structures,
and extracts custom routing commands externally parsed onto .wikinconfig. Contains logic to inject third-party '.wikin' plugin and theme ZIP archives.
Args
| Name | Type | Description |
|---|---|---|
| project_name | str | Textual explicit descriptor specifying overarching package build scope title. |
| version | str | The mapped tracking project versioning parameter sequence strings representation. |
| docs_dir | str | Relative destination override target for generated documentation. |
generate(self, modules: List[ModuleDoc], current_module: ModuleDoc=None, current_page: dict=None)
Transforms a list of ModuleDoc objects into an HTML string.
Generates functional page-spanning document variables alongside specific individual target structures. In dynamically triggered multipage operations, parses independently linked cross-path module references dynamically.
Args
| Name | Type | Description |
|---|---|---|
| modules | List[ModuleDoc] | Parsed object structures retaining explicit hierarchical function-level context models. |
| current_module | ModuleDoc, optional | If explicit single page operations are executing dynamically in multiprocessing tasks, denotes isolated file focus string wrappers. Defaults to None. |
| current_page | dict, optional | Selected custom page output dynamically routing to template rendering engine. |
Returns
| Type | Description |
|---|---|
| str | Substantially compiled raw output Jinja2 mapped HTML component configuration result sequence mapping wrapper. |
get_search_data(self, modules: List[ModuleDoc])
Serializes all module data into a dictionary for global search.
Retained output is actively exposed within generated individual script templates supporting isolated index-focused contextual filtering logic mapping dependencies matching context instances.
Args
| Name | Type | Description |
|---|---|---|
| modules | List[ModuleDoc] | Internal configuration structures generated across core abstract parsing elements sequentially parsing module context items linearly stringing parsed entities context paths values dict wrapper targets components structure representations mapping instances lists mappings target instance path elements. |
Returns
| Type | Description |
|---|---|
| dict | Dataclass-converted multi-level structural format mapped indexing dict target search mappings matching variables dict outputs sequence configurations. |
save(self, html: str, output_path: str)
Saves the generated HTML to the specified file path.
Instantiates any necessary sub-directories and commits rendered index outputs string elements files saving.
Args
| Name | Type | Description |
|---|---|---|
| html | str | Complete multi-line template output sequence mapping structure. |
| output_path | str | Relative destination targeting document sequence paths elements file references targets configurations formatting mapped instances target instance mapping path parameter configuration mapping structures mapping strings variables sequence variables string strings properties structure outputs mapped instances output mapped values lists formatting wrappers configuration values structural outputs maps structures templates formatting values strings strings paths configurations contexts contexts values contexts representations context implementations dict references implementations structures context environments objects files representations dependencies components instance mapping targets instances dependencies instance contexts formatting instance templates representations structures implementations values environments targets environments maps context properties paths parameters outputs configurations maps strings structural instances references settings references instance variables targets paths dependencies dependencies wrappers elements targets files elements mappings environments templates variables lists parameters mapping instance formats components strings values strings properties parameters paths paths mapped formats components configurations strings outputs configurations lists strings strings lists dependencies implementations formatting contexts targets environments instances representations formats parameters scripts configurations instances mapped configurations components mapped configurations dict references objects strings environments string variables formatting environments dependencies. |