mirror of
https://github.com/konpa/devicon.git
synced 2025-08-13 10:04:24 +02:00
Various bug fixes and added ability to comment multiple files
This commit is contained in:
10
.github/scripts/build_assets/arg_getters.py
vendored
10
.github/scripts/build_assets/arg_getters.py
vendored
@@ -1,6 +1,7 @@
|
||||
from argparse import ArgumentParser
|
||||
from build_assets.PathResolverAction import PathResolverAction
|
||||
|
||||
|
||||
def get_selenium_runner_args(peek_mode=False):
|
||||
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
|
||||
|
||||
@@ -32,13 +33,4 @@ def get_selenium_runner_args(peek_mode=False):
|
||||
parser.add_argument("--pr_title",
|
||||
help="The title of the PR that we are peeking at")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def get_generate_markdown_args():
|
||||
parser = ArgumentParser(description="Generate markdown for the image urls passed in.")
|
||||
|
||||
parser.add_argument("img_urls",
|
||||
help="The urls of the images. Must be the string/JSON form of an array. Ex: '[1,2,3]'")
|
||||
|
||||
return parser.parse_args()
|
23
.github/scripts/generate_screenshot_markdown.py
vendored
23
.github/scripts/generate_screenshot_markdown.py
vendored
@@ -1,19 +1,10 @@
|
||||
from typing import List
|
||||
|
||||
from build_assets import arg_getters
|
||||
|
||||
|
||||
def generate_screenshot_markdown(img_urls: List[str]):
|
||||
"""
|
||||
Generate the markdown for the screenshots using the
|
||||
img_urls then print it to the console.
|
||||
:param img_urls are valid image links.
|
||||
"""
|
||||
template = ""
|
||||
return [template.format(img_url) for img_url in img_urls]
|
||||
import json
|
||||
import os
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = arg_getters.get_generate_markdown_args()
|
||||
markdown = generate_screenshot_markdown(args.img_urls)
|
||||
print("\n\n".join(markdown)) # format it before printing
|
||||
img_urls_list = json.loads(os.environ["IMG_URLS"])
|
||||
template = ""
|
||||
markdown = [template.format(img_url) for img_url in img_urls_list]
|
||||
print("\n\n".join(markdown))
|
||||
|
||||
|
Reference in New Issue
Block a user