Decathlon / wiki-page-creator-action

Create a GitHub wiki page based on the provided markdown file
Apache License 2.0
94 stars 20 forks source link

feat: Support translation of image URLs #20

Closed resizoltan closed 2 years ago

resizoltan commented 2 years ago

Description:

This feature adds support for displaying images on the wiki that are located in $MD_FOLDER/$GFX_PATH directory. This is achieved by modifying every image URL that match the regex to point to the correct web URL of that image, for every copied file.

Example:

I tested with the repo https://github.com/resizoltan/wiki_update (which I will take down after the PR)

Config:

jobs:
  update-wiki:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Update Wiki
        uses: resizoltan/wiki-page-creator-action@feature/gfx #  docker://decathlon/wiki-page-creator-action:latest
        env:
          ACTION_MAIL: resizoltan@gmail.com
          ACTION_NAME: resizoltan
          GH_PAT: ${{ secrets.WIKI_UPDATE_TOKEN }}
          MD_FOLDER: doc
          OWNER: resizoltan
          REPO_NAME: wiki_update
          GFX_PATH: gfx

URL modification:

![cat](gfx/cat.jpg) -> ! [cat](https://raw.githubusercontent.com/resizoltan/wiki_update/master/doc/gfx/cat.jpg)

Notes:

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

resizoltan commented 2 years ago

Added support for HTML-formatted image links (which support resizing): \ -> \

Also fixed a minor bug in the original regex.

resizoltan commented 2 years ago

Closing this pull request, since Andrew-Chen-Wang's github-wiki-action does this much more powerfully.