-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,315 additions
and
437 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from sphinx.application import Sphinx | ||
|
||
def add_pdf_link(app, pagename, templatename, context, doctree): | ||
if templatename == 'rubik-pdf.html': | ||
build_dir = app.outdir | ||
parts = pagename.split('/') | ||
|
||
if len(parts) == 1: | ||
pdf_link = 'RUBIK-oll-rit-sameinud.pdf' | ||
else: | ||
subfolder = parts[0] | ||
pdf_link = f'RUBIK-{subfolder}.pdf' | ||
|
||
context['pdf_link'] = pdf_link | ||
|
||
def setup(app: Sphinx): | ||
app.connect('html-page-context', add_pdf_link) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{# Displays a link to the edit interface of the page source in the specified Version Control System. #} | ||
{% if sourcename is defined and theme_use_edit_page_button==true and page_source_suffix %} | ||
{% set src = sourcename.split('.') %} | ||
<div class="tocsection editthispage"> | ||
<a href="{{ get_edit_provider_and_url()[1] }}" style="display: inline-block; padding: 0; margin: 0; line-height: 1.5; vertical-align: middle;"> | ||
<i class="fa-solid fa-pen-to-square" style="margin-left: 0px; margin-right: 6px; margin-bottom: 3px; font-size: inherit; line-height: inherit; vertical-align: middle; display: inline-block; width: 1em; height: 1em;"></i>{% set provider = get_edit_provider_and_url()[0] %}{% block edit_this_page_text %}{% if provider %}{% trans provider=provider %}Breyta á {{ provider }}{% endtrans %}{% else %}{% trans %}Edit{% endtrans %}{% endif %}{% endblock %}</a> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{# Displays the current page's Table of Contents. #} | ||
{% set page_toc = generate_toc_html() %} | ||
{%- if page_toc | length >= 1 %} | ||
{%- set page_navigation_heading_id = unique_html_id("pst-page-navigation-heading") -%} | ||
<div | ||
id="{{ page_navigation_heading_id }}" | ||
class="page-toc tocsection onthispage"> | ||
{{ _("Kaflayfirlit") }} | ||
</div> | ||
<nav class="bd-toc-nav page-toc" aria-labelledby="{{ page_navigation_heading_id }}"> | ||
{{ page_toc }} | ||
</nav> | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<div class="tocsection sourcelink"> | ||
<a id="pdf-link" href="#" style="display: inline-block; padding: 0; margin: 0; line-height: 1.5; vertical-align: middle;"> | ||
<i class="fa-solid fa-file-pdf" style="margin-left: 0px; margin-right: 6px; margin-bottom: 3px; font-size: inherit; line-height: inherit; vertical-align: middle; display: inline-block; width: 1em; height: 1em;"></i>{{ ("Sækja PDF") }}</a> | ||
</div> | ||
|
||
<script> | ||
document.addEventListener("DOMContentLoaded", function() { | ||
// Get the current URL path | ||
var path = window.location.pathname; | ||
|
||
// Find the position of the <html> folder in the path | ||
var htmlFolderIndex = path.indexOf('/html/'); | ||
if (htmlFolderIndex === -1) { | ||
console.error("The 'html' folder was not found in the path."); | ||
return; | ||
} | ||
|
||
// Trim the path to start from the <html> folder | ||
var relativePath = path.substring(htmlFolderIndex + 6); | ||
|
||
// Split the relative path into parts | ||
var parts = relativePath.split('/').filter(function(part) { | ||
return part.length > 0; | ||
}); | ||
|
||
// Determine the PDF link based on the path parts | ||
var pdfLink = ""; | ||
if (parts.length === 0 || (parts.length === 1 && parts[0].endsWith('.html'))) { | ||
// If the path has no parts or only one part that ends with .html, it is in the root folder | ||
pdfLink = "RUBIK-oll-rit-sameinud.pdf"; | ||
} else { | ||
// If the path has more than one part, the first part is the subfolder | ||
pdfLink = parts[0] + "/RUBIK-" + parts[0] + ".pdf"; | ||
} | ||
|
||
// Set the href attribute of the PDF link | ||
document.getElementById("pdf-link").href = pdfLink; | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{# Displays the TOC-subtree for pages nested under the currently active top-level TOCtree element. #} | ||
<nav class="bd-docs-nav bd-links" | ||
aria-label="{{ _('Section Navigation') }}"> | ||
<!-- <p class="bd-links__title" role="heading" aria-level="1">{{ _("Section Navigation") }}</p> --> | ||
<div class="bd-toc-item navbar-nav"> | ||
{{- generate_toctree_html( | ||
"sidebar", | ||
show_nav_level=theme_show_nav_level | int, | ||
maxdepth=theme_navigation_depth | int, | ||
collapse=theme_collapse_navigation | tobool, | ||
includehidden=theme_sidebar_includehidden | tobool, | ||
titles_only=True | ||
) | ||
-}} | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{# Displays a link to the .rst source of the current page. #} | ||
{% if show_source and has_source and sourcename %} | ||
<div class="tocsection sourcelink"> | ||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" style="display: inline-block; padding: 0; margin: 0; line-height: 1.5; vertical-align: middle;"> | ||
<i class="fa-solid fa-file-lines" style="margin-left: 0px; margin-right: 6px; margin-bottom: 3px; font-size: inherit; line-height: inherit; vertical-align: middle; display: inline-block; width: 1em; height: 1em;"></i>{{ ("Sjá frumrit") }}</a> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.