Convert the SVG code to PNG and replace the line by a call to the image in markdown

Overview

Convert-SVG-to-png

Convert SVG code to png and replace the code with a called to the image file in Markdown files

Objectives

GitHub cannot view SVG files or code from the web, so the main objective of this action is to convert the svg code inserted into any file to PNG, replacing the SVG line by a call to the image (only markdown).

This will be useful to be able to see the SVG code inserted in .MD files from the GitHub web platform.

Inputs

NAME VALUE DEFAULT DESCRIPTION
file string README.md The file from which the SVG code will be collected and in which the code will be replaced by a call to the generated PNG
path string Images/ The path where the PNG file will go
name string Draw The filename format to save the PNG file

Example Workflow file

on: push
jobs:
  Makefiles:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
      - name: convert-svg-to-png
        uses: joseaeltala/convert-svg-to-png/@master
        with:
          file: "README.md"
          path: "Images/png"
          name: "converted-svg-file"
      - name: Commit files
        run: |
          git config user.name github-actions
          git config user.email [email protected]
          git commit -m "SVG code converted to png" -a
      - name: Push changes
        uses: ad-m/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}
You might also like...
With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen

Oraxen-item-to-yml With this simple py script you will be able to get all the .png from a folder and generate a yml for Oraxen How to use Install the

将位图转为彩色矢量 svg 图片
将位图转为彩色矢量 svg 图片

一个将位图描摹为彩色矢量 svg 图片的程序,是一个命令行工具,使用 Python 脚本实现,运行环境 Python3.8+。 ✨ 效果 以一个字帖图片为例,这是 png 格式的位图(370KB): 这是颜

🛹 Turn an SVG into an STL for stencil creation purposes
🛹 Turn an SVG into an STL for stencil creation purposes

svg2stl This repository provides a script which takes as input an SVG such as this one: It outputs an STL file like this one: You can also see an inte

Collection of SVG diagrams about how UTF-8 works

Diagrams Repository of diagrams made for articles on my blog. All diagrams are created using diagrams.net. UTF-8 Licenses Copyright 2022 Seth Michael

An API that renders HTML/CSS content to PNG using Chromium

html_png An API that renders HTML/CSS content to PNG using Chromium Disclaimer I am not responsible if you happen to make your own instance of this AP

Typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.
Typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.

typesheet typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts. I made it because I couldn't find an

A proof-of-concept implementation of a parallel-decodable PNG format
A proof-of-concept implementation of a parallel-decodable PNG format

mtpng A parallelized PNG encoder in Rust by Brion Vibber [email protected] Background Compressing PNG files is a relatively slow operation at large imag

Simple Python package to convert an image into a quantized image using a customizable palette
Simple Python package to convert an image into a quantized image using a customizable palette

Simple Python package to convert an image into a quantized image using a customizable palette. Resulting image can be displayed by ePaper displays such as Waveshare displays.

LGVL helper script to batch and convert with lvgl offline image converter

script to batch and convert with lvgl offline image converter

Comments
  • Support SVG Batches

    Support SVG Batches

    The Issue

    If I understand this correctly you're supposed to...

    • Reference SVG files in your project inside a Markdown file
    • Pass that markdown file into the action And then it will...
    • Convert the SVGs to PNG
    • Place them in a folder you also pass into the action
    • Rewrite the Markdown file
    • Place the Markdown file into another location that you pass into the action.

    But converting SVGs to PNG is useful for more than just markdown previews, and this proves to be too situational.

    Proposed Solution

    If that's right, I'm wondering why it doesn't just...

    • Take an input path (or list of paths) and output path (or list of paths)
    • Convert the SVGs to PNG
    • Place the PNGs in the output path.

    You could also take a list of input and output paths of affected readme files to keep that functionality.

    This is currently the only GitHub Action that comes close to accomplishing this. I do hope you consider it.

    Thanks.

    opened by halotroop2288 0
Releases(only-convert)
  • only-convert(Sep 16, 2021)

    Convert-SVG-to-png @ only

    This version only convert the SVG code inserted in a file (include .svg files) to PNG.

    Inputs

    | NAME | VALUE | DEFAULT | DESCRIPTION | | ---- | ----- | ------- | ----------- | | file | string | README.md | The file from which the SVG code will be collected and in which the code will be replaced by a call to the generated PNG| | path | string | Images/ | The path where the PNG file will go | | name | string | svg | The filename format to save the PNG file |

    Example Workflow file

    on: push
    jobs:
      Makefiles:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/[email protected]
          - name: convert-svg-to-png
            uses: joseaeltala/convert-svg-to-png/@only
            with:
              file: "README.md"
              path: "Images/png"
              name: "converted-svg-file"
          - name: Commit files
            run: |
              git config user.name github-actions
              git config user.email [email protected]
              git commit -m "SVG code converted to png" -a
          - name: Push changes
            uses: ad-m/[email protected]
            with:
              github_token: ${{ secrets.GITHUB_TOKEN }}
              branch: ${{ github.ref }}
    
    Source code(tar.gz)
    Source code(zip)
  • v1(Sep 15, 2021)

    Convert SVG code to PNG and replace the code with a called to the image file in Markdown files.

    GitHub cannot view SVG files or code from the web, so the main objective of this action is to convert the svg code inserted into any file to PNG, replacing the SVG line by a call to the image (only markdown).

    This will be useful to be able to see the SVG code inserted in .MD files from the GitHub web platform:

    In Visual Studio Code preview:

    imagen

    In GitHub preview:

    imagen

    imagen

    After the workflow has done:

    imagen

    imagen

    Source code(tar.gz)
    Source code(zip)
    action.yml(547 bytes)
Pnuemonia Normal detection by using XRay images.

Pnuemonia Normal detection by using XRay images. Got image datas from kaggle(link is given in sources.txt file) also normal xray images from other site (also link is given) in order to avoid data dis

Zarina 1 Feb 28, 2022
Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images

napari-3d-ortho-viewer Napari 3D Ortho Viewer - an ortho viewer for napari for 3D images This napari plugin was generated with Cookiecutter using @nap

niklas netter 5 Nov 28, 2022
Image manipulation package used for EpicBot.

Image manipulation package used for EpicBot.

Nirlep_5252_ 7 May 26, 2022
A proof-of-concept implementation of a parallel-decodable PNG format

mtpng A parallelized PNG encoder in Rust by Brion Vibber [email protected] Backgrou

Brion Vibber 193 Dec 16, 2022
Panel Competition Image Generator

Panel Competition Image Generator This project was build by a member of the NFH community and is open for everyone who wants to try it. Relevant links

Juliano Mendieta 1 Oct 22, 2021
The InvGears workbench for FreeCAD allows the creation of gear systems

FreeCAD InvGears workbench Current version 0.1.1 Overview The InvGears workbench allows the creation of gear systems. The gear generation algorithm is

Sebastian Ernesto Garcia 8 Dec 10, 2021
A script to generate a profile picture and a banner that show the same image on Discord.

Discord profile picture & banner generator A script to generate a profile picture and a banner that show the same image on Discord. Installation / Upd

Victor B. 9 Nov 27, 2022
MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件

Miku_Miku_Rig MikuMikuRig是一款集生成控制器,自动导入动画,自动布料为一体的blender插件。 MikumiKurig is a Blender plugin that can generates rig, automatically imports animations

小威廉伯爵 342 Dec 29, 2022
Blender addon - convert empty image reference to image plane

Reference to image plane Convert reference images to a textured image mesh plane. As if it was imported with import image as plane Use on drag'n'dropp

Samuel Bernou 6 Nov 25, 2022
A python script for extracting/removing exif data from images by @AbirHasan2005

Image-Exif A Python script for extracting exif metadata from images. How to use? Using this script you can extract exif data from image and save in .c

Abir Hasan 13 Dec 16, 2022
The ctypes-based simple ImageMagick binding for Python

Wand Wand is a ctypes-based simple ImageMagick binding for Python, supporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are implement

Eric McConville 1.2k Dec 30, 2022
Validate arbitrary image uploads from incoming data urls while preserving file integrity but removing EXIF and unwanted artifacts and RCE exploit potential

Validate arbitrary base64-encoded image uploads as incoming data urls while preserving image integrity but removing EXIF and unwanted artifacts and mitigating RCE-exploit potential.

A3R0 1 Jan 10, 2022
Generates images of calendar month tables and can paste them onto suitable photos.

📆 calendizer README Generates images of calendar month tables and can paste them onto suitable photos. A quick way to make your own calendar for prin

Sean Ryan 2 Dec 14, 2022
Fixed Version Of Blender Low Poly Rock Generator For Blender 3.0.0

Blender (3.0.0) - Low Poly Rock Generator This is an addon for Blender 3.0.0 to generate low poly rocks. It was based on an addon that unfortunately h

3 Mar 24, 2022
Me cleaner - Tool for partial deblobbing of Intel ME/TXE firmware images

me_cleaner me_cleaner is a Python script able to modify an Intel ME firmware image with the final purpose of reducing its ability to interact with the

Nicola Corna 4.1k Jan 08, 2023
An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright.

Playwright nonoCAPTCHA An async Python library to automate solving ReCAPTCHA v2 by audio using Playwright. Disclaimer This project is for educational

Michael Mooney 69 Dec 28, 2022
Bot by image recognition simulating (random) human clicks

bbbot22 bot por reconhecimento de imagem simulando cliques humanos (aleatórios) inb4: sim, esse é basicamente o mesmo bot de 2021 porque a Globo não t

Yuri 2 Apr 05, 2022
A simple programming language for manipulating images.

f-stop A simple programming language for manipulating images. Examples OPEN "image.png" AS image RESIZE image (300, 300) SAVE image "out.jpg" CLOSE im

F-Stop 6 Oct 27, 2022
Raven is a tool written in Python3 allowing you to generate an unique image with some text.

🐦 Raven is a tool written in Python3 allowing you to generate an unique image with some text. It does it by searching the text on Google, do

Billy 39 Dec 20, 2022
Craft PNG files that appear completely different in Apple software

Ambiguous PNG Packer Craft PNG files that appear completely different in Apple software

David Buchanan 1k Dec 29, 2022