DEV Community

Ronald R
Ronald R

Posted on

1st Open Source Pull Request

I forked textml by Ian Jacobs and added a new markdown feature that converts md files to html and created new syntaxes for the proper HTML files

I Created a new funciton titled markdownfeat , write_MD_to_html ,markdown_to_html_links and convertMD

Markdown feature has been created

it now takes all Markdown syntax features for Italics, Bold, Heading 1, Heading 2, or a Link

It now output in the testml directory or if any specified directory

it is also processed in the examples directory if an md file is in the example

For within directory md processing it still go to the testml directory

For outside the directory md processing it still go to the testml directory

For outside the directory md processing and specified directory it now go to that specified directory

Functions that process

convertMD

Is the initial function of the convertion of MD files to html this takes the name of the file and procerly process it.

markdownfeat

is the process of changing the syntaxes of the file to the right HTML tags. Tags which included

Italic
Bold
Headers

markdown_to_html_links

is the process that propely place the link ito an HTML syntax
This was quite challenging as the extraction of substring was somewhat complex, the output was achieved properly nonetheless.

{link_text} with proper HTML tags](url)
Enter fullscreen mode Exit fullscreen mode

write_MD_to_html

Creates the document ready to be written to the html file

After which it goes back to ConvertMD and properly output the file.

Challenges

The most challenging aspect was when creating the functions and how I can ensure that it works properly, since it was a program that I am familliar how it works but not entirely how it operates it was quite interesting.

I know somehow I enhanced my deducing ability to back track how each line of code works. It was soemwhat confusing at the time but nonetheless I was able to properly create the features with the right function and out put the files correctly

Top comments (0)