Skip to content

Commit

Permalink
Site structure and script metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
agnetemoos committed Oct 11, 2024
1 parent 5e3fe1f commit 4264e3a
Show file tree
Hide file tree
Showing 228 changed files with 1,019 additions and 616 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ source 'https://rubygems.org'
gem "jekyll", "~> 4.3.3" # installed by `gem jekyll`
# gem "webrick" # required when using Ruby >= 3 and Jekyll <= 4.2.2

gem "just-the-docs", "0.9.0" # pinned to the current release
# gem "just-the-docs" # always download the latest release
gem "just-the-docs", "0.10.0" # pinned to the current release
gem "git"
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ GEM
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
just-the-docs (0.9.0)
just-the-docs (0.10.0)
jekyll (>= 3.8.5)
jekyll-include-cache
jekyll-seo-tag (>= 2.0)
Expand Down Expand Up @@ -113,7 +113,7 @@ PLATFORMS
DEPENDENCIES
git
jekyll (~> 4.3.3)
just-the-docs (= 0.9.0)
just-the-docs (= 0.10.0)

BUNDLED WITH
2.3.26
192 changes: 162 additions & 30 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,173 @@
title: OS2BorgerPC dokumentationssite
description: Dokumentation af administrationssites, images og scripts.
theme: just-the-docs
description: Dokumentation af administrationssite, images og scripts.

theme: just-the-docs
url: https://just-the-docs.github.io

aux_links:
Template Repository: https://github.com/just-the-docs/just-the-docs-template

collections:
pages:
permalink: "/:collection/:path/"
output: true
scripts:
permalink: "/:collection/:path/"
output: true
just_the_docs:
collections:
pages:
name: Sider
nav_fold: false
scripts:
name: Scripts
nav_fold: false

Intro til OS2BorgerPC: https://os2.eu/os2borgerpc
OS2BorgerPC på Github: https://github.com/OS2borgerPC

# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: true

# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true

# Sort order for navigation links
# nav_sort: case_insensitive # default, equivalent to nil
nav_sort: case_sensitive # Capital letters sorted before lowercase

# External navigation links
nav_external_links:
- title: Just the Docs on GitHub
url: https://github.com/just-the-docs/just-the-docs

# Show navigation error report
nav_error_report: true # default is false/nil.

permalink: pretty

defaults:
# _pages
- scope:
path: ""
type: pages
values:
layout: default
# _scripts
- scope:
path: ""
type: scripts
path: "docs" # an empty string here means all files in the project
type: "pages"
values:
layout: script
layout: "docs"
submodules:
- "/assets/os2borgerpc-scripts/"


exclude:
# from https://github.com/jekyll/jekyll/blob/master/lib/site_template/_config.yml:
- .sass-cache/
- .jekyll-cache/
- gemfiles/
- Gemfile
- Gemfile.lock
- node_modules/
- vendor/bundle/
- vendor/cache/
- vendor/gems/
- vendor/ruby/
# specific to the theme website:
- bin/
- lib/
- "*.gemspec"
- "*.gem"
- LICENSE.txt
- package.json
- package-lock.json
- Rakefile
- README.md
- CODE_OF_CONDUCT.md
- docker-compose.yml
- Dockerfile
# theme test code
- fixtures/

# Enable or disable the site search
# Supports true (default) or false
search_enabled: true
search:
# Split pages into sections that can be searched individually
# Supports 1 - 6, default: 2
heading_level: 2
# Maximum amount of previews per search result
# Default: 3
previews: 2
# Maximum amount of words to display before a matched word in the preview
# Default: 5
preview_words_before: 3
# Maximum amount of words to display after a matched word in the preview
# Default: 10
preview_words_after: 3
# Set the search token separator
# Default: /[\s\-/]+/
# Example: enable support for hyphenated search words
tokenizer_separator: /[\s/]+/
# Display the relative url in search results
# Supports true (default) or false
rel_url: true
# Enable or disable the search button that appears in the bottom right corner of every page
# Supports true or false (default)
button: false
# Focus the search input by pressing `ctrl + focus_shortcut_key` (or `cmd + focus_shortcut_key` on macOS)
focus_shortcut_key: "k"

# For copy button on code
enable_copy_code_button: true

# By default, consuming the theme as a gem leaves mermaid disabled; it is opt-in
mermaid:
# Version of mermaid library
# Pick an available version from https://cdn.jsdelivr.net/npm/mermaid/
version: "9.1.6"
# Put any additional configuration, such as setting the theme, in _includes/mermaid_config.js
# See also docs/ui-components/code
# To load mermaid from a local library, also use the `path` key to specify the location of the library; e.g.
# for (v10+):
# path: "/assets/js/mermaid.esm.min.mjs"
# for (<v10):
# path: "/assets/js/mermaid.min.js"
# Note: copy both `mermaid.esm.min.mjs` (v10+) or `mermaid.min.js` (<v10) and the associated `.map` file from the specified version of `mermaid/dist` to `/assets/js/`.

# Enable or disable heading anchors
heading_anchors: true

# Aux links for the upper right navigation
aux_links:
"Just the Docs on GitHub":
- "https://github.com/just-the-docs/just-the-docs"

# Makes Aux links open in a new tab. Default is false
aux_links_new_tab: false

# Enable or disable the side/mobile menu globally
# Nav menu can also be selectively enabled or disabled using page variables or the minimal layout
nav_enabled: true

# Sort order for navigation links
# nav_sort: case_insensitive # default, equivalent to nil
nav_sort: case_sensitive # Capital letters sorted before lowercase

# External navigation links
nav_external_links:
- title: Just the Docs on GitHub
url: https://github.com/just-the-docs/just-the-docs

# Footer content
# appears at the bottom of every page's main content

# Back to top link
back_to_top: true
back_to_top_text: "Back to top"

footer_content: 'Copyright &copy; 2017-2020 Patrick Marsceill. Distributed by an <a href="https://github.com/just-the-docs/just-the-docs/tree/main/LICENSE.txt">MIT license.</a> <a href="https://www.netlify.com/">This site is powered by Netlify.</a>'

# Footer last edited timestamp
last_edit_timestamp: true # show or hide edit time - page must have `last_modified_date` defined in the frontmatter
last_edit_time_format: "%b %e %Y at %I:%M %p" # uses ruby's time format: https://ruby-doc.org/stdlib-2.7.0/libdoc/time/rdoc/Time.html

# Footer "Edit this page on GitHub" link text
gh_edit_link: true # show or hide edit this page link
gh_edit_link_text: "Edit this page on GitHub"
gh_edit_repository: "https://github.com/just-the-docs/just-the-docs" # the github URL for your repo
gh_edit_branch: "main" # the branch that your docs is served from
# gh_edit_source: docs # the source that your files originate from
gh_edit_view_mode: "tree" # "tree" or "edit" if you want the user to jump into the editor immediately



translations:
checkbox: "Afkrydsningsfelt"
string: "Streng"
integer: "Heltal"
date: "Dato"
password: "Adgangskode"
file: "Fil"
time: "Tid"



92 changes: 92 additions & 0 deletions _includes/components/children_nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{%- comment -%}
Include as: {%- include components/children_nav.html -%}
Depends on: page, site, nav_breadcrumbs.
Results in: HTML for the children-navigation component.
Includes: components/nav/sorted.html, toc_heading_custom.html.
Overwrites:
nav_ancestor_links, nav_top_node_titles, nav_child_candidates, nav_children,
nav_child, nav_child_ok, nav_child_ancestor, nav_sorted.
{%- endcomment -%}

{%- comment -%}
Whether a page has any children is checked efficiently by inspecting the cached
site_nav. If the page has no children, nav_children is set to an empty array;
otherwise nav_children is left unset.
{%- endcomment -%}

{%- if page.has_children == false -%}
{%- assign nav_children = "" | split: "" -%}
{%- else -%}

{%- assign nav_children = nil -%}

{%- capture nav_list_link -%}
<a href="{{ page.url | relative_url }}" class="nav-list-link">
{%- endcapture -%}

{%- capture site_nav -%}
{%- include_cached components/site_nav.html all=true -%}
{%- endcapture -%}

{%- capture nav_list_simple -%}
<ul class="nav-list">
{%- endcapture -%}

{%- assign nav_child_start = site_nav
| split: nav_list_link | last
| split: "</a>" | slice: 1 | first -%}

{%- assign nav_child_test = nav_child_start
| remove_first: nav_list_simple | prepend: nav_list_simple -%}

{%- if nav_child_start != nav_child_test -%}
{%- assign nav_children = "" | split: "" -%}
{%- endif -%}

{%- endif -%}

{%- unless nav_children -%}

{%- comment -%}
The layout is assumed to include components/breadcrumbs.html before this file,
otherwise it needs to be included here.
{%- endcomment -%}

{%- assign nav_ancestors = "" | split: "" -%}
{%- for nav_link in nav_breadcrumbs -%}
{%- assign nav_title = nav_link | split: ">" | slice: 1 | first | append: ">" | remove: "</a>" -%}
{%- assign nav_ancestors = nav_ancestors | push: nav_title -%}
{%- endfor -%}

{%- assign nav_parenthood = site[page.collection] | default: site.html_pages
| where_exp: "item", "item.title != nil" | group_by: "parent" -%}

{%- assign nav_top_nodes = nav_parenthood
| where_exp: "item", "item.name == ''" | map: "items" | first -%}

{% assign nav_top_node_titles = nav_top_nodes | map: "title" -%}

{%- include components/nav/children.html node=page ancestors=nav_ancestors all=true -%}

{%- endunless -%}

{%- if nav_children.size >= 1 -%}

{%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%}
{%- assign nav_children = nav_children | reverse -%}
{%- endif -%}

<hr>
{% include toc_heading_custom.html %}
<div class="toc">
{% for nav_child in nav_children %}
<div class="toc-item">
<a class="fs-5 fw-500" href="{{ nav_child.url | relative_url }}">{{ nav_child.title }}</a>
{% if nav_child.summary %}{{ nav_child.summary }}{% endif %}
<div>{% if nav_child.summary %}{{ nav_child.summary }}{% endif %}</div>
</div>
{% endfor %}

</div>

{%- endif -%}
42 changes: 30 additions & 12 deletions _includes/script_metadata.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
{% if page.title %}
<h1>{{ page.title }}</h1>
{% endif %}

{% if page.category %}
<p><strong>Category:</strong> {{ page.category }}</p>
{% endif %}

{% if page.source %}
<p><strong>Source:</strong>
<a href="{{ page.source | relative_url }}" target="_blank">Download script</a>
<button onclick="copyToClipboard('{{ page.source }}')">Copy to Clipboard</button>
<button onclick="copyToClipboard('{{ page.source | relative_url }}')">Copy to Clipboard</button>
</p>

<p><strong>Last Updated:</strong> {% last_modified_at %}</p>
{% endif %}

{% if page.parameters %}
<p><strong>Parameters:</strong> {{ page.parameters }}</p>
<p><strong>Parameters:</strong></p>
<table class="script-parameters">
<thead>
<tr>
<th>Navn</th>
<th>Type</th>
<th>Standardværdi</th>
<th>Påkrævet</th>
</tr>
</thead>
<tbody>
{% for param in page.parameters %}
{% capture translation_value %}
{% include translation.html key=param.type %}
{% endcapture %}

<tr>
<td class="name"><input type="text" value="{{ param.name }}"></td>
<td class="type"><input type="text" value="{{ translation_value | strip }}"></td>
<td class="default"><input type="text" value="{{ param.default }}"></td>
<td class="mandatory">
<input type="checkbox" {% if param.mandatory %}checked{% endif %}>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

<details>
<summary>Click to see more details</summary>
<p>This is the content inside the fold-out/fold-in element. It is hidden by default and can be toggled by clicking on the summary above.</p>
<summary>Click to see the source code</summary>
<pre><code>{% read_script_content %}</code></pre>
</details>

<script>
Expand Down
7 changes: 7 additions & 0 deletions _includes/translation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% assign key_to_search = include.key %}

{% if site.translations[key_to_search] %}
{{ site.translations[key_to_search] }}
{% else %}
Key not found
{% endif %}
Loading

0 comments on commit 4264e3a

Please sign in to comment.