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/checkout@v1
      - 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/github-push-action@master
        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/checkout@v1
          - 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/github-push-action@master
            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)
Owner
null
A Python Script to convert Normal PNG Image to Apple iDOT PNG Image.

idot-png-encoder A Python Script to convert Normal PNG Image to Apple iDOT PNG Image (Multi-threaded Decoding PNG). Usage idotpngencoder.py -i <inputf

Lrdcq 2 Feb 17, 2022
Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

Pyconvert is a python script that you can use to convert image files to another image format! (eg. PNG to ICO)

null 1 Jan 16, 2022
Png2Jpg tool will help you convert from png image format to jpg images format.

PNG 2 JPG All codes assume running from root directory. Please update the sys path at the beginning of the codes before running. Over View Png2Jpg too

Nguyễn Trường Lâu 2 Dec 27, 2021
A little Python tool to convert a TrueType (ttf/otf) font into a PNG for use in demos.

font2png A little Python tool to convert a TrueType (ttf/otf) font into a PNG for use in demos. To use from command line it expects python3 to be at /

Rich Elmes 3 Dec 22, 2021
Fast batch image resizer and rotator for JPEG and PNG images.

imgp is a command line image resizer and rotator for JPEG and PNG images.

Terminator X 921 Dec 25, 2022
Transfers a image file(.png) to an Excel file(.xlsx)

Transfers a image file(.png) to an Excel file(.xlsx)

Junu Kwon 7 Feb 11, 2022
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Juss Patel 4 Nov 8, 2021
HtmlWebShot - A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features.

A python3 package which Can Create Images From url, Html-CSS, Svg and from any readable file and texts with many setup features

Danish 24 Dec 14, 2022
A tool and a library for SVG path data transformations.

SVG path data transformation toolkit A tool and a library for SVG path data transformations. Currently it supports a translation and a scaling. Usage

Igor Mikushkin 2 Mar 7, 2022