-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build and deploy docs to GitHub Pages | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v2 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- run: pip install 'mkdocs-resize-images[dev]' | ||
- run: make fixRelativeLinkDocs | ||
- run: mkdocs gh-deploy --force |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: MkDoxy build all supported Python versions | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
# You can use PyPy versions in python-version. | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# You can test your matrix by printing the current Python version | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install 'mkdocs-resize-images[dev]' | ||
- name: Build docs | ||
run: mkdocs build --clean --strict --verbose |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.PHONY: package release release-test clean reviewCode docs-serve docs-build | ||
|
||
# Packaging | ||
package: | ||
rm -f dist/* | ||
python3 setup.py sdist bdist_wheel | ||
|
||
install: package | ||
python3 -m pip install --no-deps --force dist/*.whl | ||
|
||
install-dev: package | ||
python3 -m pip install --force --editable . | ||
|
||
release: package | ||
twine upload --repository pypi dist/* | ||
|
||
release-test: package | ||
twine upload --repository testpypi dist/* | ||
|
||
clean: | ||
rm -rf dist build | ||
|
||
|
||
fixRelativeLinkDocs: | ||
# change ./docs/ to ./ | ||
sed 's/\.\/docs\//\.\//g' README.md > docs/README.md | ||
|
||
# Testing | ||
reviewCode: | ||
sourcery review mkdoxy --in-place | ||
|
||
install-dev: | ||
python3 -m pip install --force --editable . | ||
|
||
# Documentation | ||
docs-serve: fixRelativeLinkDocs | ||
mkdocs serve | ||
|
||
docs-build: fixRelativeLinkDocs | ||
mkdocs build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,67 @@ | ||
# mkdocs-resize-images | ||
# MkDocs Resize Images Plugin | ||
|
||
<p align="center"> | ||
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.51.al%2FJakubAndrysek%2Fmkdocs-resize-images&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true"/></a> | ||
<img src="https://img.shields.io/github/license/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/v/release/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/stars/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/forks/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/issues/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://static.pepy.tech/personalized-badge/mkdocs-resize-images?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads"> | ||
</p> | ||
|
||
This MkDocs plugin finds all folders with a certain name, by default `assets-large`, resizes all images in those folders according to the plugin configuration. | ||
Then saves the resized images in a different folder, by default `assets`. | ||
The plugin also supports caching: if a file has not changed since the last time the plugin ran, it won't be processed again. | ||
|
||
## Installation | ||
|
||
Install the plugin using pip from [PyPI](https://pypi.org/project/mkdocs-resize-images/): | ||
|
||
```bash | ||
pip install mkdocs-resize-images | ||
``` | ||
|
||
Activate the plugin in `mkdocs.yml`: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- resize-images | ||
``` | ||
Create `.gitignore` file in your project root directory and add the following line to it: | ||
|
||
```bash | ||
assets-large # or whatever you have set as source-dir | ||
.resize-hash # if you have enabled caching | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
By default, the plugin will look for images in all directories named assets-large, resize them to 800x600 pixels, and then save the resized images in assets directories in the same parent directories as the assets-large directories. | ||
|
||
You can configure the plugin in your mkdocs.yml: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- resize-images: | ||
source-dir: assets-large | ||
target-dir: assets | ||
enable_cache: True | ||
size: [800, 600] | ||
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.svg'] | ||
``` | ||
|
||
`source-dir`: The name of the directories to search for images to resize. Default is `assets-large`. | ||
|
||
`target-dir`: The name of the directories to save the resized images in. Default is `assets`. | ||
|
||
`size`: The size to resize the images to, specified as [width, height]. Default is `[800, 600]`. | ||
|
||
`extensions`: List of image file extensions to consider for resizing. The plugin will look for images with these extensions in both lower and upper case. Default is `['.jpg', '.jpeg', '.png', '.gif', '.svg']`. | ||
|
||
`enable_cache`: Whether to enable caching. If enabled, the plugin will check if a file has changed since the last time the plugin ran, and if not, it won't process the file again. Default is `True`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
resize.kubaandrysek.cz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# MkDocs Resize Images Plugin | ||
|
||
<p align="center"> | ||
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.51.al%2FJakubAndrysek%2Fmkdocs-resize-images&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true"/></a> | ||
<img src="https://img.shields.io/github/license/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/v/release/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/stars/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/forks/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://img.shields.io/github/issues/JakubAndrysek/mkdocs-resize-images?style=flat-square"> | ||
<img src="https://static.pepy.tech/personalized-badge/mkdocs-resize-images?period=month&units=international_system&left_color=black&right_color=orange&left_text=Downloads"> | ||
</p> | ||
|
||
This MkDocs plugin finds all folders with a certain name, by default `assets-large`, resizes all images in those folders according to the plugin configuration. | ||
Then saves the resized images in a different folder, by default `assets`. | ||
The plugin also supports caching: if a file has not changed since the last time the plugin ran, it won't be processed again. | ||
|
||
## Installation | ||
|
||
Install the plugin using pip from [PyPI](https://pypi.org/project/mkdocs-resize-images/): | ||
|
||
```bash | ||
pip install mkdocs-resize-images | ||
``` | ||
|
||
Activate the plugin in `mkdocs.yml`: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- resize-images | ||
``` | ||
Create `.gitignore` file in your project root directory and add the following line to it: | ||
|
||
```bash | ||
assets-large # or whatever you have set as source-dir | ||
.resize-hash # if you have enabled caching | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
By default, the plugin will look for images in all directories named assets-large, resize them to 800x600 pixels, and then save the resized images in assets directories in the same parent directories as the assets-large directories. | ||
|
||
You can configure the plugin in your mkdocs.yml: | ||
|
||
```yaml | ||
plugins: | ||
- search | ||
- resize-images: | ||
source-dir: assets-large | ||
target-dir: assets | ||
enable_cache: True | ||
size: [800, 600] | ||
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.svg'] | ||
``` | ||
|
||
`source-dir`: The name of the directories to search for images to resize. Default is `assets-large`. | ||
|
||
`target-dir`: The name of the directories to save the resized images in. Default is `assets`. | ||
|
||
`size`: The size to resize the images to, specified as [width, height]. Default is `[800, 600]`. | ||
|
||
`extensions`: List of image file extensions to consider for resizing. The plugin will look for images with these extensions in both lower and upper case. Default is `['.jpg', '.jpeg', '.png', '.gif', '.svg']`. | ||
|
||
`enable_cache`: Whether to enable caching. If enabled, the plugin will check if a file has changed since the last time the plugin ran, and if not, it won't process the file again. Default is `True`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Image source: https://roboruka.robotickytabor.cz/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Example | ||
|
||
This is large image in `assets-large` folder: | ||
![Large image](assets-large/002.jpg) | ||
|
||
|
||
This is resized image in `assets` folder: | ||
![If you see this message, it means the plugin does not work, please check your configuration.](assets/002.jpg) | ||
|