Skip to content

Commit

Permalink
sort by title
Browse files Browse the repository at this point in the history
  • Loading branch information
hry-gh committed May 28, 2024
1 parent 898c261 commit d960d53
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
10 changes: 7 additions & 3 deletions content/objects/atom/movable/proc/move.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title = "Move"

[extra]
return_val = """
1 on success
0 on failure.
1 on success<br>
0 on failure<br>
Number of pixels moved for a successful slide.
"""

Expand All @@ -17,4 +17,8 @@ args = [

+++

TODO `TODO` TODO
TODO `TODO` TODO

```dm
var/todo = "todo"
```
11 changes: 6 additions & 5 deletions styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ a>i {
text-decoration: dotted;
}

ul li.active>a {
color: #e67a82;
}

input[type="text"] {
border-radius: 4px;
}
Expand Down Expand Up @@ -205,7 +201,12 @@ h6 {
}
}

.nav-link:hover {
.nav-link-inactive:hover {
background-color: #fdfeff23;
border-radius: 2px;
}

.nav-link-active {
background-color: #fdfeff23;
border-radius: 2px;
}
29 changes: 18 additions & 11 deletions templates/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
{%- endif %}
{%- endfor %}

{%- if current_path == subsection.path %}
{%- set class = "active" %}
{%- elif depth > 1
{%- if depth > 1
and current_path != subsection.path
and current_path != myParentSection.path
and current_path != subsectionParent.path
Expand All @@ -44,10 +42,15 @@
{%- if currentPage.ancestors is containing(subsection.relative_path) or current_path == subsection.path or 1 > depth -%}
{%- set iconClass = "fa-rotate-90" -%}
{%- endif -%}

{%- set spanClass = " nav-link-inactive" -%}
{%- if current_path == subsection.path %}
{%- set spanClass = " nav-link-active" %}
{%- endif -%}

{%- set depthIndent = 20 * depth -%}
<li class="{{class}}" data-expand-tag="{{subsection.path}}">
<span style="padding-left: {{depthIndent}}px" class="flex flex-row nav-link">
<span style="padding-left: {{depthIndent}}px" class="flex flex-row{{spanClass}}">
<span class="px-1"><i class="fa-solid fa-caret-right text-blue-300 {{iconClass}} nav-toggle cursor-pointer"></i></span>
<a href="{{ subsection.permalink | safe }}" class="{{linkClass}}">
{{ subsection.title }}
Expand Down Expand Up @@ -82,19 +85,23 @@
{%- endif %}
{%- endfor %}

{%- if current_path == page.path %}
{%- set class = "active" %}
{%- elif depth > 0
{%- if depth > 0
and current_path != subsection.path
and currentParent.path != subsection.path
and not renderAll %}
{%- set class = "hidden" %}
{%- else %}
{%- set class = "" %}
{%- endif -%}

{%- set spanClass = " nav-link-inactive" -%}
{%- if current_path == page.path %}
{%- set spanClass = " nav-link-active" %}
{%- endif -%}

{%- set depthIndent = 20 * (depth + 1) -%}
<li class="text-title {{class}}">
<span style="padding-left: {{depthIndent}}px" class="flex flex-row nav-link">
<span style="padding-left: {{depthIndent}}px" class="flex flex-row{{spanClass}}">
<span class="pl-3"><i class="fa-solid fa-minus"></i></span>
<a href="{{ page.permalink | safe }}">
{{ page.title }}
Expand Down Expand Up @@ -188,7 +195,7 @@
<div class="pl-10 flex flex-row gap-5">
<div class="flex flex-col">
{% endif %}
{% for newProc in possibleProcPage.pages %}
{% for newProc in possibleProcPage.pages | sort(attribute="title") %}
<div class="code-title"><a href="{{newProc.permalink | safe}}">/proc/{{ newProc.title }}</a>({{ self::render_proc_args_short(page=newProc) }})</div>
{% endfor %}
{% if possibleProcPage.pages | length > 0 %}
Expand Down Expand Up @@ -227,7 +234,7 @@ <h3 class="text-xl">Inherited Procs:</h3>
</div>
<div class="flex flex-col">
{% endif %}
{% for newVar in possibleVarPage.pages %}
{% for newVar in possibleVarPage.pages | sort(attribute="title") %}
<div class="code-title"><a href="{{newVar.permalink | safe}}">/var/{{ newVar.title }}</a></div>
{% endfor %}
{% if possibleVarPage.pages | length > 0 %}
Expand Down Expand Up @@ -306,7 +313,7 @@ <h1 class="title text-3xl">

<div>
Returns:
<div class="pl-5">{{page.extra.return_val | default(value="null") }}</div>
<div class="pl-5">{{page.extra.return_val | default(value="null") | safe }}</div>
</div>

{{ page.content | safe }}
Expand Down
4 changes: 2 additions & 2 deletions templates/proc_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

{% block header %}
<h1 class="title text-3xl">{{ macros::render_page_parent_type(page=section, skip_level=0) }} {{ section.title }}</h1>
{% endblock heaer %}
{% endblock header %}

{% block content %}

<div class="flex flex-col gap-5">

{% for page in section.pages %}
{% for page in section.pages | sort(attribute="title") %}
<div class="border border-white border-dashed p-5">
{{ macros::render_proc_title(page=page, list=true) }}
{{ macros::render_proc(page=page, list=true) }}
Expand Down

0 comments on commit d960d53

Please sign in to comment.