Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for Markdown #4

Merged
merged 6 commits into from
Sep 23, 2023
Merged

Conversation

mingming-ma
Copy link
Contributor

@mingming-ma mingming-ma commented Sep 22, 2023

This commit Fixes #3 which does

The Updated Code

  • Add support .md files
    • helper function bool ctil::ends_with(std::string const & value, std::string const & ending) to do extension check
      • Returns true if value string has the ending suffix
    • void ctil::generateHTML_md(std::ifstream& infile, std::ofstream& outfile, std::string filename) function to process the Markdown file
    • text file process function generateHTML is then named to generateHTML_txt and keep the logic as previous
  • Add Italics parsing support for the Markdown file
    • it is converted in the void ctil::md_italics_content_update(std::string &input) function
    • find one * index and the closet next * index of the given input string, get the inner content between the *, then replace with <i>content</i>

The Updated Document

  • README.md
    • Including running usage and warning for same file name special case

The Updated Examples

  • Add testDirectory/markdown_test.md which contains italics syntax

Unexpected behaviour and bugs to fix

  • Currently, **word** is converted to <i></i>word<i></i> which is not as expected. It should be fixed to converted to <b>word</b> in the future.

source.cpp Outdated Show resolved Hide resolved
ctil.cpp Show resolved Hide resolved
Copy link
Owner

@rjwignar rjwignar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes.

@rjwignar rjwignar merged commit b865adf into rjwignar:master Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to add Markdown support
2 participants