Making markdown pages with yaml part data require remember a load of key words
Those writing documentation using the UI
Julian Stirling (77083fc8) at 25 Mar 18:01
Tweak server test to make it hopefully more robust
Julian Stirling (c087111a) at 25 Mar 17:43
fix issue with fromstep links appearing missing in page bom
Julian Stirling (139b8cf4) at 25 Mar 14:50
Julian Stirling (0b30091d) at 25 Mar 14:50
Merge branch 'conduct' into 'master'
... and 1 more commit
Julian Stirling (139b8cf4) at 25 Mar 14:39
Add code of conduct
Just need to be sure the package data all works ok. See https://setuptools.pypa.io/en/latest/userguide/datafiles.html
Python code will be something like this
needs checking and integrating
from PIL import Image
import logging
_LOGGER = logging.getLogger('BuildUp.GitBuilding')
# For exif key info see
ORIENTATION_KEY = 0x112
# The PIL operations to undo the key
OPERATIONS = {2: Image.FLIP_LEFT_RIGHT,
3: Image.ROTATE_180,
4: Image.FLIP_TOP_BOTTOM,
5: Image.TRANSPOSE,
6: Image.ROTATE_270,
7: Image.TRANSVERSE,
8: Image.ROTATE_90}
def adjust_jpg(filename):
image = Image.open(filename)
exif = image.getexif()
oriented, image, exif = orient_image(image, exif)
resized, image = resize_image(image)
if oriented or resized:
if exif:
image.save(filename, exif=exif.tobytes())
else:
image.save(filename)
def orient_image(image, exif):
print(type(image))
print(exif)
if not exif or ORIENTATION_KEY not in exif:
return (False, image, exif)
#save value and delete exif entry
orient_value = exif[ORIENTATION_KEY]
if orient_value == 1:
return (False, image, exif)
if orient_value in OPERATIONS:
del exif[ORIENTATION_KEY]
image = image.transpose(OPERATIONS[orient_value])
return (True, image, exif)
_LOGGER.warning('Unknown orientation key in Exif, skipping')
return (False, image, exif)
def resize_image(image, max_px = 1e6):
px = image.size[0]*image.size[1]
if px <= max_px:
#Nothing to change
return (False, image)
# To get image down to max size, we need the square root
# of ratio of current pixels to max.
ratio = (px/max_px)**.5
new_size = [int(i/ratio) for i in image.size]
image = image.resize(new_size, Image.Resampling.LANCZOS)
return (True, image)
When #270 was fixed this actually breaks github pages support. GitHub now allows actions for deployment we should use those instead. Something like this:
name: Deploy Gitbuilding Project to Github Pages
on:
push:
branches: [ master ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Compile
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
submodules: true
- name: Install Python 3
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Build
run: |
pip install setuptools
pip install gitbuilding
gitbuilding build-html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "_site/"
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
GitBuilding has some quirks that need to be fixed.
buildconf.yml
is a stupid name -> suggest gitbuilding.yaml
gitbuilding.yaml
should sit in the project root directoryDocsDir
in the config file should point to the docs directorygitbuilding.yaml
in parent directories and serve/build from the docs folderJulian Stirling (f31ce355) at 25 Mar 12:34
Julian Stirling (2d6d836e) at 25 Mar 12:34
Merge branch 'translate-external-master' into 'master'
... and 2 more commits
Julian Stirling (becdda45) at 25 Mar 12:21
change unmark markdown extensions due to markdown 3.6 compatibility
Julian Stirling (f31ce355) at 25 Mar 12:13
Cherrypick python3.6 bugfix aswell (v0.14.2
Julian Stirling (0bc95ae8) at 25 Mar 12:05
change unmark markdown extensions due to markdown 3.6 compatibility
Julian Stirling (59cbd3a3) at 25 Mar 12:00
Fix bug claiming some files are in external directories when they a...