(Grav GitSync) Automatic Commit from dan

This commit is contained in:
dan 2022-03-09 08:21:32 +13:00 committed by GitSync
parent 9773afcd97
commit 1ea4178c1a
7 changed files with 75 additions and 11 deletions

View File

@ -0,0 +1,36 @@
---
title: 'Unser Tutorial/Leitfaden für den Android-Bereich ist fertig 🍻'
published: true
date: '09-03-2022 08:14'
taxonomy:
category:
- news
tag:
- tutorials
- privacy
- android
- magisk
- fdroid
- afwall
- xprivacylua
- lsposed
- microg
- shelter
- aurora
- lineage
- phone
- backup
- seedvault
aura:
author: dodi
---
Bist du daran interessiert, dein altes Android-Telefon über ein Custom ROM zu aktualisieren? Verwendest du ein Android-Gerät für deine digitale Privatsphäre?
Wir haben jetzt auch unser Tutorial/Leitfaden (deutsch) für unseren Android-Bereich fertiggestellt.
F-Droid, Magisk, AFWall, LSPosed, microG ... sie alle sind Teil davon.
Wirf einen Blick darauf:
https://wiki.techsaviours.org/de/phone/operating_systems/android
Wir haben ein paar Backup-Lösungen für unsere Android-Handys hinzugefügt - https://wiki.techsaviours.org/de/backup/phone.

View File

@ -1,3 +1,10 @@
# v3.2.0
## 02/23/2022
1. [](#new)
* Support for HTML or Shortcode based headers with custom `id` attributes to specify an anchor
* Added German translation
# v3.1.3
## 01/03/2022

View File

@ -1,7 +1,7 @@
name: Page Toc
type: plugin
slug: page-toc
version: 3.1.3
version: 3.2.0
description: Generate a table of contents and anchors from a page
icon: list
author:

View File

@ -49,9 +49,10 @@ class MarkupFixer
/** @var DOMElement $node */
foreach ($this->traverseHeaderTags($domDocument, $start, $depth) as $node) {
if ($node->getAttribute('id')) {
continue;
$slug = $node->getAttribute('id');
} else {
$slug = $slugger->slugify($node->getAttribute('title') ?: $node->textContent, $options);
}
$slug = $slugger->slugify($node->getAttribute('title') ?: $node->textContent, $options);
$node->setAttribute('id', $slug);

View File

@ -10,10 +10,12 @@ class AnchorShortcode extends Shortcode
{
public function init()
{
$this->shortcode->getHandlers()->add('anchor', function(ProcessedShortcode $sc) {
$id = $sc->getParameter('id', $sc->getBbCode());
$prefix = $sc->getParameter('prefix', PageTOCPlugin::configVar('anchors.slug_prefix'));
$class = $sc->getParameter('class', 'inline-anchor');
$this->shortcode->getRawHandlers()->add('anchor', function(ProcessedShortcode $sc) {
$id = $this->cleanParam($sc->getParameter('id', $sc->getBbCode()));
$tag = $this->cleanParam($sc->getParameter('tag'));
$prefix = $this->cleanParam($sc->getParameter('prefix', PageTOCPlugin::configVar('anchors.slug_prefix')));
$class = $this->cleanParam($sc->getParameter('class', 'inline-anchor'));
$aria = PageTOCPlugin::configVar('anchors.aria');
$content = $sc->getContent();
@ -27,8 +29,23 @@ class AnchorShortcode extends Shortcode
$id = $prefix . $id;
}
return "<a id=\"$id\" href=\"#$id\" class=\"$class\" aria-label=\"$aria\">$content</a>";
if ($tag) {
$output = "<$tag id=\"$id\" class=\"$class\">$content</$tag>";
} else {
$output = "<a id=\"$id\" href=\"#$id\" class=\"$class\" aria-label=\"$aria\">$content</a>";
}
return $output;
});
$this->shortcode->getHandlers()->addAlias('#', 'anchor');
$this->shortcode->getRawHandlers()->addAlias('#', 'anchor');
}
/**
* @param $param
* @return string
*/
protected function cleanParam($param)
{
return trim(html_entity_decode($param), '"');
}
}

View File

@ -1,3 +1,6 @@
de:
PLUGIN_PAGE_TOC:
TABLE_OF_CONTENTS: Inhaltsverzeichnis
en:
PLUGIN_PAGE_TOC:
TABLE_OF_CONTENTS: Table of Contents

View File

@ -72,7 +72,7 @@ class PageTOCPlugin extends Plugin
'onTwigInitialized' => ['onTwigInitialized', 0],
'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],
'onTwigSiteVariables' => ['onTwigSiteVariables', 0],
'onPageContentProcessed' => ['onPageContentProcessed', 0],
'onPageContentProcessed' => ['onPageContentProcessed', -20],
]);
}
@ -86,7 +86,7 @@ class PageTOCPlugin extends Plugin
/** @var PageInterface $page */
$page = $event['page'];
$content = $page->getRawContent();
$content = $page->content();
$shortcode_exists = preg_match($this->toc_regex, $content);
$active = $this->configVar('active', $page, false);