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)
Extracts dominating colors from an image and presents them as a palette.

ColorPalette A simple web app to extract dominant colors from an image. Demo Live View it live at : https://colorpalettedemo.herokuapp.com/ You can de

Mayank Nader 214 Dec 29, 2022
Convert photos to paintings with python

Convert-photos-to-paintings Before the changes After the changes Before the changes After the changes This code is written in the Python programming l

Amir Hussein Sharifnezhad 3 May 31, 2022
SGTL - Spectral Graph Theory Library

SGTL - Spectral Graph Theory Library SGTL is a python library of spectral graph theory methods. The library is still very new and so there are many fe

Peter Macgregor 6 Oct 01, 2022
Anime2Gif - an algorithm that detects scenes in a video and generates gifs from it

Anime2Gif Anime2Gif is an algorithm that detects scenes in a video and generates gifs from it. How to use To use it, first, you'll need to install it'

1 Dec 09, 2021
Script For Importing Image sequences into scrap mechanic via blueprints

To use dowload and extract "video makes.zip" Python has to be installed https://www.python.org/ (may not work on version lower than 3.9) Has to be run

2 Oct 30, 2021
Seeks to remove text from an image in a convincing way.

Text-Removal This is a Computer Vision project that seeks to successfully remove text from an image by covering the text areas in a convincing way. He

6 Nov 22, 2022
3D printer / slicing GUI built on top of the Uranium framework

Cura Ultimaker Cura is a state-of-the-art slicer application to prepare your 3D models for printing with a 3D printer. With hundreds of settings and h

Ultimaker 4.4k Jan 02, 2023
CadQuery is an intuitive, easy-to-use Python module for building parametric 3D CAD models.

A python parametric CAD scripting framework based on OCCT

1.9k Dec 30, 2022
Gaphor is the simple modeling tool

Gaphor Gaphor is a UML and SysML modeling application written in Python. It is designed to be easy to use, while still being powerful. Gaphor implemen

Gaphor 1.3k Dec 31, 2022
Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Python

AICSImageIO Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Pure Python Features Supports reading metadata and imaging

Allen Institute for Cell Science - Modeling 137 Dec 14, 2022
Fill holes in binary 2D & 3D images fast.

Fill holes in binary 2D & 3D images fast.

11 Dec 09, 2022
QR code python application which can read(decode) and generate(encode) QR codes.

QR Code Application This is a basic QR Code application. Using this application you can generate QR code for you text/links. Using this application yo

Atharva Parkhe 1 Aug 09, 2022
A tool for making simple-style text posters or wallpapers with high resolution.

PurePoster PurePoster is a fancy tool for making arbitrary-resolution, simple-style posters or wallpapers with text in center. Functionality PurePoste

Renyang Guan 4 Jul 09, 2022
Python Image Optimizer Script

Image-Optimizer Download and Install git clone https://github.com/stefankumpan/Image-Optimizer-Script.git cd Image-Optimizer-Script pip install -r req

Stefan Kumpan 0 Jul 15, 2021
Automatic picture transmission(APT) protocol decoder for NOAA weather satellites

Automatic picture transmission(APT) decoder Automatic picture transmission protocol is used by NOAA satellites. They constantly send a frequency modul

Jayachandra Kasarla 25 Aug 05, 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
This Github Action automatically creates a GIF from a given web page to display on your project README

This Github Action automatically creates a GIF from a given web page to display on your project README

Pablo Lecolinet 28 Dec 15, 2022
Image manipulation package used for EpicBot.

Image manipulation package used for EpicBot.

Nirlep_5252_ 7 May 26, 2022
Combinatorial image generator for generative NFT art.

ImageGen Stitches multiple image layers together into one image. Run usage: stitch.py [-h] backgrounds_dir dinos_dir traits_dir texture_file

Dinosols NFT 19 Sep 16, 2022
Simple mathematical operations on image, point and surface layers.

napari-math This package provides a GUI interfrace for simple mathematical operations on image, point and surface layers. addition subtraction multipl

Zach Marin 2 Jan 18, 2022