Skip to content

Commit

Permalink
Add tag shifter/reparent, empty tags, and images
Browse files Browse the repository at this point in the history
  • Loading branch information
aMytho committed Apr 17, 2024
1 parent 60b44a3 commit 0c5e0f1
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 0 deletions.
Binary file added assets/img/emptyTagRemoverExample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/tagReparentExample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/tagShifterExample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions content/docs/tools/remove-empty-tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
weight: 308
title: "Remove Empty Tags"
description: ""
icon: "article"
date: "2024-04-16T20:46:22-05:00"
lastmod: "2024-04-16T20:46:22-05:00"
draft: false
toc: true
---

This tool will remove any empty tags. This works in the same manner that the Above tool does. Note that you may need to run this tool several times if you have nested empty tags.

This is commonly used with the [All Tags](/docs/selection/all-tags) selection.

## Parameters

This tool has no parameters.

## Output

Output showing that the empty tags were removed. After this tool was run, there were previously non-empty tags that are **now** empty. The remaining empty tags were **not** removed. This is because they were not empty when the tool checked for them. If you have an empty tag in an tag with no elements beside the empty tag, only the lowest child will be removed. You can run the tool multiple times to remove them all, or adjust your selection.

Based on the order of the "All Tags" selection, the lowest Sect and last 2 Divs were removed.

![The empty Div tag is removed after this tool is used..'](/img/emptyTagRemoverExample.jpg)
28 changes: 28 additions & 0 deletions content/docs/tools/tag-reparent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
weight: 307
title: "Tag Reparent"
description: ""
icon: "article"
date: "2024-04-16T20:24:30-05:00"
lastmod: "2024-04-16T20:24:30-05:00"
draft: false
toc: true
---

This tool can help to remove nested tags that are the same element type. **This is the same as the Tag-Shift tool, but this tool will move up the tag tree recursively until it finds a match.** Read the [Tag-Shifter](/docs/tools/tag-shift) documentation before using this tool.

## Parameters

The Tag Type must must match the selection for the child to be moved. The child element is the selection. This tool also has an option to automatically delete the parent tag if it is empty after the child has been moved.

| Parameter | Purpose |
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Tag Type | This is the type of tag that the toolset will search for. This is the *parent* element. If a child element is a distant child of this element, it will be moved up. |
| Delete if Empty | If the parent tag is empty after the child is moved, the parent tag will be deleted. |


## Output

Output showing the nested tags on the left and the corrected tags on the right. This example moved the last P tag up to the section. The two Divs were not needed. While the original parent tag (2nd Div) was removed, the first Div was not. This is because the Tag Reparent Deletion only removes the original parent, not grandparent tags. If you want to remove empty tags that are not the direct parent, use the Empty Tag Remover tool.

![Duplicate nested tags were moved out of their parent.'](/img/tagReparentExample.jpg)
27 changes: 27 additions & 0 deletions content/docs/tools/tag-shift.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
weight: 306
title: "Tag Shift"
description: ""
icon: "article"
date: "2024-04-16T20:07:52-05:00"
lastmod: "2024-04-16T20:07:52-05:00"
draft: false
toc: true
---

This tool can help to remove nested tags that are the same element type. Many PDFs have tags that unnecessarily encapsulate another tag. For example, a paragraph tag may incorrectly have a child paragraph tag. This tool will automatically move the child tag up one level, leaving the parent intact. If you want to delete the parent tag if it is empty, use the Remove Empty Tag tool after this one.

## Parameters

The Tag Type must must match the selection for the child to be moved. The child element is the selection.

| Parameter | Purpose |
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Tag Type | This is the type of tag that the toolset will search for. This is the *parent* element. If a child element is a direct child of this element, it will be moved up. |


## Output

Output showing the nested tags on the left and the corrected tags on the right. The extra tags were moved to the bottom of the tag root (which happened to be the next parent.)

![Duplicate nested tags were moved to the next parent at the end of the children list'](/img/tagShifterExample.jpg)

0 comments on commit 0c5e0f1

Please sign in to comment.