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)
Python library that finds the size / type of an image given its URI by fetching as little as needed

FastImage This is an implementation of the excellent Ruby library FastImage - but for Python. FastImage finds the size or type of an image given its u

Brian Muller 28 Mar 01, 2022
Sample data for the napari image viewer.

napari-demo-data Sample data for the napari image viewer. This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugi

Genevieve Buckley 1 Nov 08, 2021
Black-white image converter - Black-white photo colorization

Black-white image converter - Black-white photo colorization

1 Jan 02, 2022
clesperanto is a graphical user interface for GPU-accelerated image processing.

clesperanto is a graphical user interface for a multi-platform multi-language framework for GPU-accelerated image processing. It is based on napari and the pyclesperanto-prototype.

1 Jan 02, 2022
A minimal, standalone viewer for 3D animations stored as stop-motion sequences of individual .obj mesh files.

ObjSequenceViewer V0.5 A minimal, standalone viewer for 3D animations stored as stop-motion sequences of individual .obj mesh files. Installation: pip

csmailis 2 Aug 04, 2022
PyLibTiff - a wrapper to the libtiff library to Python using ctypes

PyLibTiff is a package that provides: a wrapper to the libtiff library to Python using ctypes. a pure Python module for reading and writing TIFF and L

Pearu Peterson 105 Dec 21, 2022
AutoGiphyMovie lets you search giphy for gifs, converts them to videos, attach a soundtrack and stitches it all together into a movie!

AutoGiphyMovie lets you search giphy for gifs, converts them to videos, attach a soundtrack and stitches it all together into a movie!

Satya Mohapatra 18 Nov 13, 2022
Repair broken bookmarks to referenced files in Apple Photos

Repair Apple Photos Bookmarks Work in progress to repair file location bookmarks in Apple Photos. Background Starting in macOS 10.15/Catalina, photos

Rhet Turnbull 10 Nov 03, 2022
Python Script to generate posters out of the images in directory.

Poster-Maker Python Script to generate posters out of the images in directory. This version is very basic ligthweight code to combine organize images

1 Feb 02, 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
A not exist person image generator python module

A not exist person image generator python module

Fayas Noushad 2 Dec 03, 2021
sK1 2.0 cross-platform vector graphics editor

sK1 2.0 sK1 2.0 is a cross-platform open source vector graphics editor similar to CorelDRAW, Adobe Illustrator, or Freehand. sK1 is oriented for prepr

sK1 Project 238 Dec 04, 2022
Gallery written in Python to manage your photos

GalleryMan Gallery written in Python to manage your photos Installation

Asian Cat 24 Dec 18, 2022
QR fixer part is standalone but for image to FQR conversion

f-qr-fixer QR fixer part is standalone but for image to FQR conversion it requires Pillow (can be installed with easy_install), qrtools (on ubuntu the

2 Nov 22, 2022
OctoPrint is the snappy web interface for your 3D printer!

OctoPrint OctoPrint provides a snappy web interface for controlling consumer 3D printers. It is Free Software and released under the GNU Affero Genera

OctoPrint 7.1k Jan 03, 2023
Instagram-like image filters.

PyGram Instagram-like image filters. Usage First, import the client: from filters import * Instanciate a filter and apply it: f = Nashville("image.jp

Ajay Kumar Nagaraj 0 Oct 18, 2022
Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Multi-view 3D reconstruction using neural rendering. Unofficial implementation of UNISURF, VolSDF, NeuS and more.

Jianfei Guo 683 Jan 04, 2023
👾 Python project to help you convert any image into a pixel art.

👾 Pixel Art Generator Python project to help you convert any image into a pixel art. ⚙️ Developer's Guide Things you need to get started with this co

Atul Anand 6 Dec 14, 2022
A Icon Maker GUI Made - Convert your image into icon ( .ico format ).

Icon-Maker-GUI A Icon Maker GUI Made Using Python 3.9.0 . It will take any image and convert it to ICO file, for web site favicon or Windows applicati

Insanecodes 12 Dec 15, 2021
Qrgenerator - A qr generator app using python3

qrgenerator by Mal4D Hi welcome into qr code generator using python by Mal4d Lin

Mal4D 1 Jan 09, 2022