semvec/pypi-packages huggingface dataset:
Rule34-Posts-Wrapper 0.1.1.1
Library for retrieving posts and tags from rule34.paheal.net
License: MIT

# Rule34 posts wrapper
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/nukdokplex/rule34-posts-wrapper/.github/workflows/ci.yml?label=CI&logo=github&branch=master)](https://github.com/nukdokplex/rule34-posts-wrapper/actions/workflows/ci.yml)
[![Codecov](https://img.shields.io/codecov/c/gh/nukdokplex/rule34-posts-wrapper?token=FZ6UNF6GE1&label=tests%20coverage)](https://app.codecov.io/gh/nukdokplex/rule34-posts-wrapper)
[![GitHub Repo stars](https://img.shields.io/github/stars/nukdokplex/rule34-posts-wrapper)](https://github.com/nukdokplex/rule34-posts-wrapper)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/Rule34-Posts-Wrapper?label=PyPI%20d-loads%3A)](https://pypi.org/project/Rule34-Posts-Wrapper/)

This is a [rule34.paheal.net](https://rule34.paheal.net) wrapper that turns your query into an iterable list of posts
with the most important information about them.

## Installation

To install:
```shell
pip install rule34-posts-wrapper
```
Or for development/testing purposes, clone and run:
```shell
pip install -e .[development]
pre-commit install
```

## Usage

### PostsWrapper

To start import ``PostsWrapper`` and call it:
```python
from rule34_posts_wrapper import PostsWrapper

posts = PostsWrapper(['your', 'query', 'here'])[0].file
```

Note that there is **no authentication** for now so you can't use more than three tags in your query.

Now you can iterate the posts in cycle:
```python
for post in posts:
    print(str(post.file) + " - " + " ".join(post.tags)) # Do whatever you want with Post object
```

Also you can just interact with it like ``list``

```python
first_post = posts[0]
print(str(first_post.thumbnail))
```
Note that all URLs are ``urllib3.util.Url``, call ``str(posts[x].link)`` to convert it to ``str``.

### TagsWrapper

Like ``PostsWrapper``, ``TagsWrapper`` provides you iterable list of ``Tag``'s:

```python
from rule34_posts_wrapper import TagsWrapper

tags = TagsWrapper("Your_Query_Here")

print(f"Found {len(tags)} tags:", end="\n\n")
for tag in tags:
    print(f"Tag: {tag.name}, Count: {tag.count}")
```

It uses [rule34.paheal.net](https://rule34.paheal.net) autocomplete that helps you find tags by it's starting
substring.

## Testing

To run all tests, just use this command:
```shell
tox -e py
```
mkdocs-backlinks 0.9.1
A MkDocs plugin for adding backlinks to your documentation pages.
License: MIT
Requires Python: >=3.10
Keywords: mkdocs

# mkdocs-backlinks

This is a plugin for adding backlinks to your mkdocs generated pages.

Mkdocs is an awesome tool not only for documentation, but also for publishing [digital gardens](https://danodic.dev).
Backlinks are a desirable component when building such digital gardens, as they enable the ability to explore content
based on how the knowledge interconnects instead of just looking at page navigation.

## Setup

Install the plugin using pip:

`pip install mkdocs-backlinks`

Activate the plugin in `mkdocs.yml`:

```yaml
plugins:
  - mkdocs-backlinks
```

> **Note:** If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin.
> MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.

More information about plugins in the [MkDocs documentation][mkdocs-plugins].

## Config

* `ignored_pages` - A list of page titles that will be excluded from the backlinks.

```yaml
plugins:
  - mkdocs-backlinks:
      ignored_pages: [ 'Tags', 'Home' ] 
```

## Usage

This plugin will add a `backlinks` attribute to the Jinja page context, which can be used to add backlinks at any point
in your template. Here is an example of it:

```html
...

{% if backlinks %}
<h3>Backlinks:</h3>
<ul>
    {% for backlink in backlinks %}
    <li><a href="/{{ backlink.url }}">{{ backlink.title }}</a></li>
    {% endfor %}
</ul>
{% endif %}

...
```

That means **you need to have a template that supports backlinks**, or you can alter the template you are using with the
snippet above.

### Writing Notes

I have been using this to publish my Obsidian vault, and there are some _tricks_ to make it work well:

- Obsidian is smart and will resolve links even if they don´t refer to a valid file path. This is not
  true for mkdocs and the backlinks plugin -- you need to write valid links in your markdown files, either
  absolute or relative links.
- Absolute links are absolute related to the root of the `/docs` folder, not to your computer filesystem.

Following those two rules will allow you to go straight from obsidian to mkdocs with cool backlinks.

## See Also

More information about templates [here][mkdocs-template].

More information about blocks [here][mkdocs-block].

[mkdocs-plugins]: http://www.mkdocs.org/user-guide/plugins/

[mkdocs-template]: https://www.mkdocs.org/user-guide/custom-themes/#template-variables

[mkdocs-block]: https://www.mkdocs.org/user-guide/styling-your-docs/#overriding-template-blocks

## Thanks to

- The creator of this awsome mkdocs plugin template: https://github.com/byrnereese/mkdocs-plugin-template