Coder Social home page Coder Social logo

tinymd's Introduction

Rust로 미니 마크다운 컴파일러 만들기

출처

https://jesselawson.org/rust/getting-started-with-rust-by-building-a-tiny-markdown-compiler/

TODO

  • At the end of the match first_char.pop() block, we have to repeat ourselves by checking whether the _ptag or _htag are open. How could you encapsulate this logic in a function to better adhere to the DRY principle?

  • The way we are opening and reading the input file is not the same as what you find in the Rust docs for read_lines here. How (and why) is the linked Rust code different?

  • How could you add in some other HTML tags at the top of your output file, like a <style> tag or even a link to a CSS file before you iterate over each line from the input file?

  • How would you add support for more than one character as the flag? For example, how could you parse ## This is a second-order heading? (Hint: the first_char is only the first character of line_contents because we used .take(1)…)

  • Try to add support for <em> (asterisks) and <strong> (double asterisks)

  • When it comes to error checking, Rust has evolved over time to be less verbose. Try out some of the ways Rust lets you skip the verbosity in error-handing by updating parts of the code we wrote to manually unwrap Result objects.

  • tutorial hasn’t even touched on one of the coolest parts of Cargo–integrated testing built right into the ecosystem! Challenge yourself to use some TDD practices on your next tinker project in Rust.

tinymd's People

Contributors

jonir227 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.