Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6630a55
monolithic lua API, working on styling and usability
SlashScreen Sep 8, 2025
4dd450c
More maintainable templates. Now... analysis and toc
SlashScreen Sep 9, 2025
f5f5c6d
added permalinks
SlashScreen Sep 9, 2025
87651e8
got the arrows to display inline
SlashScreen Sep 9, 2025
3d4e291
with great strife I have generated a TOC
SlashScreen Sep 9, 2025
27385a9
ok got permalinks working well enough
SlashScreen Sep 9, 2025
685019c
toc style pass
SlashScreen Sep 9, 2025
f9e0c02
added type backlinking
SlashScreen Sep 10, 2025
4801a9c
Added TOCs to the other generated pages, fixed links I hope
SlashScreen Sep 10, 2025
7dc085e
remove ruby stuff. dorry badosu
SlashScreen Sep 10, 2025
67b9645
lining up and polish
SlashScreen Sep 10, 2025
3200cdf
Fixed backlinks enough, supporting generics I think?
SlashScreen Sep 14, 2025
379bdb6
fixed a lot of bugs
SlashScreen Sep 14, 2025
99d3e53
fixed a bunch of spacing issues
SlashScreen Sep 14, 2025
97af4ed
used styles instead
SlashScreen Sep 15, 2025
f00ea1a
working on getting CI to work
SlashScreen Sep 15, 2025
0f30a3d
Merge branch 'master' into site_formatting_template
SlashScreen Sep 16, 2025
41c2d49
fixed type linking. kind of a bandaid solution. If it doesn't work ag…
SlashScreen Sep 16, 2025
724867c
Merge branch 'site_formatting_template' of github.com:SlashScreen/Rec…
SlashScreen Sep 16, 2025
2bc0cfc
tweaks 1
SlashScreen Sep 17, 2025
9f9122b
removed duplicate property and type tables
SlashScreen Sep 17, 2025
662e5c3
more link fixes, added the permalink bump thing
SlashScreen Sep 17, 2025
54738a3
type renderign works, now permalinks
SlashScreen Sep 21, 2025
804079f
rethinking how globals are generated
SlashScreen Sep 23, 2025
45bd1a3
side quest: promote forum
SlashScreen Sep 23, 2025
4e7e056
1st draft of refactor. probably extremely broken
SlashScreen Sep 24, 2025
e72f2ae
working through bugs
SlashScreen Sep 25, 2025
1c66bdc
ironing out more bugs
SlashScreen Oct 2, 2025
011b359
ok maybe wasn't the right approach
SlashScreen Oct 3, 2025
81f3999
complete structural rethinking. see will be difficult. Have a few bugs
SlashScreen Oct 9, 2025
d9b3802
added method support
SlashScreen Oct 9, 2025
e399859
fixed types
SlashScreen Oct 9, 2025
c8cfde4
ok see kinda works now
SlashScreen Oct 11, 2025
5d148e4
formatting changes
SlashScreen Oct 11, 2025
b4ea30e
bump emmylua version
SlashScreen Oct 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions doc/site/layouts/docs/lua_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ <h3 class="display-inline">
*/}}
{{ define "render_alias"}}
{{ $level := .level }}
{{ $name_path := append (slice "type" ( replace .data.name "." "-" )) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand All @@ -141,8 +140,7 @@ <h3 class="display-inline">
*/}}
{{ define "render_class" }}
{{ $level := .level }}
{{ $name_path := append (slice "type" ( replace .data.name "." "-" )) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand All @@ -164,7 +162,7 @@ <h3 class="display-inline">
{{ template "leveled_tag_closer" $level }} {{ template "render_common" (dict "data" . "type_info" $type_info) }}
</summary>
{{ range sort .members "name" }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "name_path" $name_path "type_info" $type_info) }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "type_info" $type_info) }}
{{ end }}
</details>
</div>
Expand All @@ -177,8 +175,7 @@ <h3 class="display-inline">
*/}}
{{ define "render_enum" }}
{{ $level := .level }}
{{ $name_path := append (slice "type" ( replace .data.name "." "-" )) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand All @@ -193,7 +190,7 @@ <h3 class="display-inline">
{{ template "leveled_tag_closer" $level }} {{ template "render_common" (dict "data" . "type_info" $type_info) }}
</summary>
{{ range sort .members "name" }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "name_path" $name_path "type_info" $type_info) }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "type_info" $type_info) }}
{{ end }}
</details>
</div>
Expand All @@ -206,8 +203,7 @@ <h3 class="display-inline">
*/}}
{{ define "render_table" }}
{{ $level := .level }}
{{ $name_path := append (slice "property" ( replace .data.name "." "-" )) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand All @@ -223,7 +219,7 @@ <h3 class="display-inline">
{{ template "leveled_tag_closer" $level }} {{ template "render_common" (dict "data" . "type_info" $type_info) }}
</summary>
{{ range sort .members "name" }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "name_path" $name_path "type_info" $type_info) }}
{{ template "render_member" (dict "data" . "level" (add $level 1) "type_info" $type_info) }}
{{ end }}
</details>
</div>
Expand All @@ -236,8 +232,7 @@ <h3 class="display-inline">
*/}}
{{ define "render_function" }}
{{ $level := .level }}
{{ $name_path := append (slice "property" ( replace .data.name "." "-" )) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand Down Expand Up @@ -278,8 +273,7 @@ <h4>Returns</h4>
*/}}
{{ define "render_field" }}
{{ $level := .level }}
{{ $name_path := append (slice "property" .data.name) .name_path }}
{{ $name_path_string := delimit $name_path "-" }}
{{ $name_path_string := index .type_info .data.name }}
{{ $type_info := .type_info }}

{{ with .data }}
Expand Down Expand Up @@ -318,7 +312,8 @@ <h4>Returns</h4>
{{- range uniq $words -}}
{{- if not ( collections.In $kw . ) -}}
{{- if not ( hasPrefix . `"`) -}} {{/* Hack to filter out strings in unions */}}
{{ with $link := (index $type_info .) }}
{{ $link := (index $type_info .) }}
{{ if $link }}
{{- $type_link := printf "[%s](#%s)" . $link -}}
{{- $typedef = replace $typedef . $type_link -}}
{{ end }}
Expand Down
13 changes: 13 additions & 0 deletions doc/site/layouts/partials/analyze_globals.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ $result := dict }}

{{ $root_name := .root_name }}

{{ range .data }}
{{ $type := .type }}
{{ $name := (delimit (slice $root_name "." .name)) "." "-" }}
{{ $permalink := printf "%s-%s" $type $name }}
{{ $result = merge $result (dict $name $permalink) }}
{{ $result = merge $result (partial "analyze_globals.html" (dict "data" .members "root_name" $name))}}
{{ end }}

{{ return $result }}
6 changes: 3 additions & 3 deletions doc/site/layouts/partials/analyze_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
{{ $result := dict }} {{/* map[name]permalink */}}

{{ range . }}
{{ $type := (partial "extract_type_name.html" .type) }}
{{ $name := replace .name "." "-" }}
{{ $type := .type }}
{{ $name := replace (partial "extract_type_name.html" .name) "." "-" }}
{{ $permalink := printf "%s-%s" $type $name }}
{{ $result = merge $result (dict $type $permalink) }}
{{ $result = merge $result (dict $name $permalink) }}
{{ end }}

{{ return $result }}
32 changes: 32 additions & 0 deletions doc/site/layouts/partials/build_globals_data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
member: {
name: string
permalink: string
description: string
deprecation_reason: string?
generics: []string
loc: {
file: string
line: integer
}
literal: string?
path: []string
}
table: member {
type: "table"
members: []member
}
field: member
func: member {
params: []{
name: string
typ: string
desc: string?
}
returns: []{
name: string
typ: string
desc: string?
}
}
*/}}
2 changes: 1 addition & 1 deletion doc/site/layouts/partials/extract_type_name.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Emmylua does this thing where either the type is truncated or the entire fucking alias is put in the type field.
So this partial is for extracting a type name from a string, since that needs to be done in a few places.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like something that could be raised with emmylua (or even PR'd in) rather than hacked around here. Just a thought.


params: type_string atring
params: type_string string
returns: type_name string
*/}}

Expand Down
15 changes: 15 additions & 0 deletions doc/site/layouts/partials/global_construction/construct_field.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ $data := .data }}
{{ $path := .path }} {{/* path appended in construct_member */}}

{{ $field := (dict
"type" "field"
"name" $data.name
"description" $data.description
"deprecation_reason" $data.deprecation_reason
"loc" $data.loc
"method" $data.is_meth
"permalink" (printf "field-%s" (replace (delimit $path "-") "." "-"))
"type" (partial "extract_type_name.html" .typ)
)}}

{{ return $field }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ $data := .data }}
{{ $path := .path }} {{/* path appended in construct_member */}}

{{ $fn := (dict
"type" "fn"
"name" $data.name
"description" $data.description
"deprecation_reason" $data.deprecation_reason
"loc" $data.loc
"method" $data.is_meth
"permalink" (printf "fn-%s" (replace (delimit $path "-") "." "-"))
)}}

{{ $params := slice }}
{{ range $data.params }}
{{ $params = append $params (dict
"name" $data.name
"type" (partial "extract_type_name.html" .typ)
"desc" $data.desc
) }}
{{ end }}
{{ $fn = merge $fn (dict "params" $params) }}

{{ $returns := slice }}
{{ range $data.returns }}
{{ $returns = append $returns (dict
"name" $data.name
"type" (partial "extract_type_name.html" .typ)
"desc" $data.desc
) }}
{{ end }}
{{ $fn = merge $fn (dict "returns" $returns) }}

{{ return $fn }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ $data := .data }}
{{ $path := append .data.name .path }}

{{ $res := dict }}

{{ if eq .type "table" }}
{{ $res = (partial "global_construction/construct_table.html" (dict "data" $data "path" (append $data.name $path))) }}
{{ else if eq .type "fn" }}
{{ $res = (partial "global_construction/construct_function.html" (dict "data" $data "path" (append $data.name $path))) }}
{{ else if eq .type "field" }}
{{ $res = (partial "global_construction/construct_field.html" (dict "data" $data "path" (append $data.name $path))) }}
{{ end }}

{{ return $res }}
20 changes: 20 additions & 0 deletions doc/site/layouts/partials/global_construction/construct_table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{ $data := .data }}
{{ $path := .path }} {{/* path appended in construct_member */}}

{{ $table := (dict
"type" "table"
"name" $data.name
"description" $data.description
"deprecation_reason" $data.deprecation_reason
"loc" $data.loc
"permalink" (printf "table-%s" (replace (delimit $path "-") "." "-"))
) }}

{{ $members := slice }}
{{ range .members }}
{{ $members := append (partial "global_construction/construct_member.html" (dict "data" . "path" (append $data.name $path)) ) }}
{{ end }}

{{ $table = merge $table (dict "members" $members) }}

{{ return $table }}