OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
{% import "include/macros.twig" as macros %}
{% block content %}
---
title: {{ node.FullyQualifiedStructuralElementName }}
{% include 'config/frontmatter.twig' %}
---
# {{ node.name }}
{{ node.summary|raw }}
{{ node.description|raw }}
`{{ node.FullyQualifiedStructuralElementName }}`
{% if node.parent %}* Parent class: {{ macros.mdClassLink(node.parent, macros.mdClassPath(node), node.parent.FullyQualifiedStructuralElementName) }}
{% endif %}
{% if node.final %}* This class is marked as **final** and can't be subclassed
{% endif %}
{% if node.deprecated %}* **Warning:** this class is **deprecated**. This means that this class will likely be removed in a future version.
{% endif %}
{% if node.interfaces is not empty %}* This class implements: {{ node.interfaces|join(', ')|raw }}
{% endif %}
{% if node.tags.see is not empty or node.tags.link is not empty %}
**See Also:**
{% for see in node.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description|raw }}{% endif %}
{% endfor %}
{% for link in node.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description|raw }}{% endif %}
{% endfor %}
{% endif %}{# node.tags.see || node.tags.link #}
{# Check constants #}
{% if node.constants|length > 0 %}
## Constants
| Constant | Type | Value |
|:--- |:--- |:--- |
{% for constant in node.constants %}
|`{{constant.FullyQualifiedStructuralElementName}}`|{{constant.type}}|{{constant.value}}|
{% endfor %}{# for constant #}
{% endif %}{# if constants #}
{# Check methods #}
{% if node.methods|length > 0 %}
## Methods
{% for method in node.methods %}
{% include 'method.md.twig' %}
{% endfor %}
{% endif %}{# if methods #}
{# Check inherited methods #}
{% if node.InheritedMethods|length > 0 %}
## Inherited methods
{% for method in node.InheritedMethods %}
{% include 'method.md.twig' %}
{% endfor %}
{% endif %}{# if InheritedMethods #}
{% include 'config/footer.md.twig' %}
{% endblock %}

View File

@@ -0,0 +1,3 @@
{# This and it will be added to every .md file at the end #}
---
> Automatically generated from source code comments on {{ "now"|date("Y-m-d") }} using [phpDocumentor](http://www.phpdoc.org/)

View File

@@ -0,0 +1,2 @@
{# This will be added to every .md file in frontmatter section #}
footer: false

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,50 @@
{#
Twig implementation of getRelativePath
#}
{% macro mdGetRelativePath(_from, _to) %}
{% set from = _from|split('/') %}
{% set to = _to|split('/') %}
{% set relPath = to %}
{% set break = false %}
{% for dir in from %}
{% if not break %}
{% set depth = loop.index0 %}
{% if dir == to[depth] %}
{% set relPath = relPath | slice(1) %}
{% else %}
{% set remaining = from|length - depth %}
{% if remaining > 1 %}
{% set relPathLen = relPath | length %}
{% set padLength = remaining - 1 %}
{% for i in 1..padLength %}
{% set relPath = '..'|split('/')|merge(relPath) %}
{% endfor %}
{% set break = true %}
{% else %}
{% set relPath0 = 'technical/' ~ relPath[0] %}
{% set relPathRest = relPath | slice(1) %}
{% set relPath = relPath0|split('/')|merge(relPathRest) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{{ relPath | join('/') }}{% endmacro %}
{#
Get full md link for node with baseDir
#}
{% macro mdNodePath(node) %}
{{ node.FullyQualifiedStructuralElementName | replace({'\\':'/'}) | trim }}.md{% endmacro %}
{#
Get full link to class
#}
{% macro mdClassPath(node) %}
{{ 'classes' ~ _self.mdNodePath(node) | trim}}{% endmacro %}
{#
Create MD link to class node from path
#}
{% macro mdClassLink(node, from, name = null) %}
[{{ name | default(node.name) }}]({{ _self.mdGetRelativePath(from, _self.mdClassPath(node))}}){% endmacro %}

View File

@@ -0,0 +1,65 @@
{% import "include/macros.twig" as macros %}
{% block content %}
---
title: {{project.name}}
{% include 'config/frontmatter.twig' %}
---
# {{ project.name|raw }}
This is an automatically generated documentation for **{{project.name}}**.
{# Gitlab supports automatic table of contents generation #}
{% if md_flavour == 'gitlab' %}
# Table of contents
[[_TOC_]]
{% endif %}
{% for namespace in project.indexes.namespaces|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
{% if namespace.classes|length > 0 or namespace.traits|length > 0 or namespace.interfaces|length > 0 %}
## {{ namespace.FullyQualifiedStructuralElementName }}
{% if namespace.classes|length > 0 %}
### Classes
| Class | Description |
|--- |--- |
{% for class in namespace.classes|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
| {{ macros.mdClassLink(class) }} | {{ class.summary|replace({'|': '&#124;'})|nl2br|replace({"\n": "", "\r": "", "\t": ""})|raw }}|
{% endfor %}{# for class #}
{% endif %}{# if classes.length #}
{% if namespace.traits|length > 0 %}
#### Traits
| Trait | Description |
|--- |--- |
{% for trait in namespace.traits|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
| {{ macros.mdClassLink(trait) }} | {{ trait.summary|replace({'|': '&#124;'})|nl2br|replace({"\n": "", "\r": "", "\t": ""})|raw }}|
{% endfor %}{# for trait #}
{% endif %}{# if traits #}
{% if namespace.interfaces|length > 0 %}
#### Interfaces
| Interface | Description |
|--- |--- |
{% for interface in namespace.interfaces|sort((a,b) => a.FullyQualifiedStructuralElementName <=> b.FullyQualifiedStructuralElementName) %}
| {{ macros.mdClassLink(interface) }} | {{ interface.summary|replace({'|': '&#124;'})|nl2br|replace({"\n": "", "\r": "", "\t": ""})|raw }}|
{% endfor %}{# for interace #}
{% endif %}{# if interfaces #}
{% endif %}{# if classes, traits, interfaces length #}
{% endfor %}{# for namespace #}
{% include 'config/footer.md.twig' %}
{% endblock %}
#### Hooks
[Reference Here](hooks.md)

View File

@@ -0,0 +1,71 @@
{% import "include/macros.twig" as macros %}
{% block content %}
---
title: {{ node.FullyQualifiedStructuralElementName }}
{% include 'config/frontmatter.twig' %}
---
# {{ node.name }}
{{ node.summary|raw }}
{{ node.description|raw }}
* Full name: `{{ node.FullyQualifiedStructuralElementName }}`
{% if node.parent %}* Parent interface: {{ macros.mdClassLink(node.parent, macros.mdClassPath(node), node.parent.FullyQualifiedStructuralElementName) }}
{% endif %}
{% if node.final %}* This interface is marked as **final** and can't be subclassed
{% endif %}
{% if node.deprecated %}* **Warning:** this interface is **deprecated**. This means that this interface will likely be removed in a future version.
{% endif %}
{% if node.interfaces is not empty %}* This interface implements: {{ node.interfaces|join(', ')|raw }}
{% endif %}
{% if node.tags.see is not empty or node.tags.link is not empty %}
**See Also:**
{% for see in node.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description|raw }}{% endif %}
{% endfor %}
{% for link in node.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description|raw }}{% endif %}
{% endfor %}
{% endif %}{# node.tags.see || node.tags.link #}
{# Check constants #}
{% if node.constants|length > 0 %}
## Constants
| Constant | Type | Value |
|:--- |:--- |:--- |
{% for constant in node.constants %}
|`{{constant.FullyQualifiedStructuralElementName}}`|{{constant.type}}|{{constant.value}}|
{% endfor %}{# for constant #}
{% endif %}{# if constants #}
{# Check methods #}
{% if node.methods|length > 0 %}
## Methods
{% for method in node.methods %}
{% include 'method.md.twig' %}
{% endfor %}
{% endif %}{# if methods #}
{# Check inherited methods #}
{% if node.InheritedMethods|length > 0 %}
## Inherited methods
{% for method in node.InheritedMethods %}
{% include 'method.md.twig' %}
{% endfor %}
{% endif %}{# if InheritedMethods #}
{% include 'config/footer.md.twig' %}
{% endblock %}

View File

@@ -0,0 +1,59 @@
### {{ method.name }}
{{ method.summary|raw }}
{# Method signature #}
```php
{% if method.final %}final {% endif %}{{method.visibility}} {%if method.static%}static {% endif %}{{ method.parent.name }}::{{ method.name }}({% for argument in method.arguments %}
{{- argument.type }}
{{- argument.byReference ? '&' }} $
{{- argument.name }}{{ argument.default ? ' = '~argument.default }}
{%- if not loop.last %}, {% endif %}
{%- endfor %})
{{- method.response.type ? ': '~method.response.type }}
```
{{ method.description|raw }}
{% if method.static %}* This method is **static**.{% endif %}
{% if method.abstract %}* This method is **abstract**.{% endif %}
{% if method.final %}* This method is **final**.{% endif %}
{% if method.deprecated %}* **Warning:** this method is **deprecated**. This means that this method will likely be removed in a future version.
{% endif %}
{% if method.arguments is not empty %}
**Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
{% for argument in method.arguments %}
| `{{ argument.name }}` | **{{ argument.type ? argument.type|raw }}** | {{ argument.description|replace({'|': '&#124;'})|nl2br|replace({"\n": "", "\r": "", "\t": ""})|raw }} |
{% endfor %}
{% endif %}{# method.arguments is not empty #}
{% if method.response.description %}
**Return Value:**
{{ method.response.description|raw }}
{% endif %}
{% if method.tags.see is not empty or method.tags.link is not empty %}
**See Also:**
{% for see in method.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description|raw }}{% endif %}
{% endfor %}
{% for link in method.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description|raw }}{% endif %}
{% endfor %}
{% endif %}{# method.tags.see || method.tags.link #}
---

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<template>
<name>md</name>
<version>1.0.0</version>
<transformations>
<transformation writer="twig" source="index.md.twig" artifact="README.md"/>
<transformation writer="twig" query="indexes.classes" source="class.md.twig" artifact="classes/{{FullyQualifiedStructuralElementName}}.md"/>
<transformation writer="twig" query="indexes.traits" source="trait.md.twig" artifact="classes/{{FullyQualifiedStructuralElementName}}.md"/>
<transformation writer="twig" query="indexes.interfaces" source="interface.md.twig" artifact="classes/{{FullyQualifiedStructuralElementName}}.md"/>
</transformations>
<parameters>
<parameter key="twig-debug">true</parameter>
</parameters>
</template>

View File

@@ -0,0 +1,53 @@
{% import "include/macros.twig" as macros %}
{% block content %}
---
title: {{ node.FullyQualifiedStructuralElementName }}
{% include 'config/frontmatter.twig' %}
---
# {{ node.name }}
{{ node.summary|raw }}
{{ node.description|raw }}
* Full name: `{{ node.FullyQualifiedStructuralElementName }}`
{% if node.parent %}* Parent trait: {{ macros.mdClassLink(node.parent, macros.mdClassPath(node), node.parent.FullyQualifiedStructuralElementName) }}
{% endif %}
{% if node.final %}* This trait is marked as **final** and can't be subclassed
{% endif %}
{% if node.deprecated %}* **Warning:** this trait is **deprecated**. This means that this class will likely be removed in a future version.
{% endif %}
{% if node.interfaces is not empty %}* This trait implements: {{ node.interfaces|join(', ')|raw }}
{% endif %}
{% if node.tags.see is not empty or node.tags.link is not empty %}
**See Also:**
{% for see in node.tags.see %}
* {{ see.reference }} {% if see.description %}- {{ see.description|raw }}{% endif %}
{% endfor %}
{% for link in node.tags.link %}
* {{ link.link }} {% if link.description and link.description != link.link %}- {{ link.description|raw }}{% endif %}
{% endfor %}
{% endif %}{# node.tags.see || node.tags.link #}
{# Gitlab supports automatic table of contents generation #}
{% if md_flavour == 'gitlab' %}
## Table of contents
[[_TOC_]]
{% endif %}
## Methods
{% for method in node.methods %}
{% include 'method.md.twig' %}
{% endfor %}
{% include 'config/footer.md.twig' %}
{% endblock %}