utilities

package
v0.0.0-...-bfe7bcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeImageLinksInMarkdown

func ChangeImageLinksInMarkdown(markdownContent string, oldImageTags []string, newLinks []string) (string, error)

Takes mardown text and returns it modifying it with the new links the *oldImageTags*

func DownloadAndSaveImageToFs

func DownloadAndSaveImageToFs(url string, filename string) error

func DownloadImagesAndModifyFile

func DownloadImagesAndModifyFile(path string) error

path: path of the Markdown file

This function combines the functionability of multiple functions, it looks for every image link in the markdown, it downloads then in the same path as the markdown file and modifies the file to instead of pointing to the url the image tags it looks to the local fs

func ExtractLinkImg

func ExtractLinkImg(str string) (string, string)

func ExtractUrlFromImageTag

func ExtractUrlFromImageTag(imageTag string) string

Takes the image tag string of markdown *![](link)* and extract the *link*

func GetImagesFromMarkdown

func GetImagesFromMarkdown(path string) []string

func SpinUp

func SpinUp(path string)

creates an http server for testing purposes

func StringInArray

func StringInArray(s string, array []string) bool

func TrimMoreThanOneSpace

func TrimMoreThanOneSpace(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL