Skip to content

Service to return images of text where the input text can have font, font size and color set

License

Notifications You must be signed in to change notification settings

Daylily-Informatics/github_markdown_text_colorizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Service to return images of specified text where text color, bg color, font and font size can be configured. Images may be generated via the service, or dyanmically requested and used in <img /> tags. , which looks like this <img src="https://gtc.dyly.bio/format_gh_text?txt=this+is+dynamic%2C+and+check+out+these+0%27s&bg_color=%239e0a72&txt_color=%2361edff&font=Monoid-Regular-HalfTight-Dollar-0-1-l&font_size=22&width=249&ret_type=img" />, you can generate these urls here.

Quickest Start

Demo Service

this service has no promises re:uptime! run your own service if you require high reliability

  • This service is running the current version of this repo. You may create and download images, or experiment with embedding them.
fglass

Embedding

Enter values via the UI and get your embeddable link.

UI
fgembed
Dynamically Generated Img Using Link Generated Above

Use in markdown <img src="https://gtc.dyly.bio/format_gh_text?txt=Embedding&bg_color=%23121111&txt_color=%2309caf1&font=Monoid-Regular-HalfTight-Dollar-0-1-l&font_size=20&width=140&ret_type=img" />

Using The Link Produced Above

Changing The Link Text & Color

Change The Font, Colors, Size

... you get the idea

xxx

Install And Run Service Yourself (advised for dynamic use)

Likely only will run on mac or linux.

Clone this repo

git clone [email protected]:Daylily-Informatics/github_markdown_text_colorizer.git
cd github_markdown_text_colorizer

Environment

I'm a fan of conda.

conda create -n GMTC -c conda-forge python ipython pytest pip Pillow==9.5.0 cherrypy

Run It

# cd to top level dir of cloned repo

conda activate GMTC
mkdir -p cache
python github_markdown_text_colorizer/bin/gitmdtxtclr3.py 0.0.0.0 8080 https://PUBLIC_IP # :<PORT> will be appended

Will output

[23/Nov/2023:16:36:57] ENGINE Listening for SIGTERM.
[23/Nov/2023:16:36:57] ENGINE Listening for SIGHUP.
[23/Nov/2023:16:36:57] ENGINE Listening for SIGUSR1.
[23/Nov/2023:16:36:57] ENGINE Bus STARTING
[23/Nov/2023:16:36:57] ENGINE Started monitor thread 'Autoreloader'.
[23/Nov/2023:16:36:57] ENGINE Serving on https://127.0.0.1:8080
[23/Nov/2023:16:36:57] ENGINE Bus STARTED

Next Steps

Limtations

  • the demo server, gtc.dyly.bio is not intended for operational use.
  • The fonts available have optimal font sizes, and when not set to these sizes, can look blurry.
  • These can not be used in header tagged lines.

Development Notes

Start to first satisfying working draft ~40m.

About

Service to return images of text where the input text can have font, font size and color set

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages