Coder Social home page Coder Social logo

metafates / marky Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 2.0 530 KB

๐Ÿญ Convert Markdown documents into themed HTML pages with support for code syntax highlighting, LaTeX and Mermaid diagrams.

Home Page: https://crates.io/crates/marky

Rust 95.89% Handlebars 4.11%
cli markdown markdown-to-html notes pdf rust

marky's People

Contributors

jessems avatar metafates avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jessems yonasbsd

marky's Issues

--recursive, Convert multiple local markdown documents

A way to render/watch/live multiple markdown documents would be nice. Ideally links to other local markdown documents should open them rendered, as they are in Github.

Watch and single mode:

The given solution would be an -r, --recursive flag, which converts all .md files in a directory and also rewrites local .md links. Aggregate a list of the paths to enable --watch to track them.

This would also necessitate codifying that <file>.md in converted into <file>.html (modifiable via -o?), so that link rewriting is predictably correct (if the linked .md existed to begin with).

Live mode:

The best way is probably unrelated to how watch and single mode are done, since the conversion of each file is isolated and the renaming predictable.

When the server gets a request for a path matching the conversion pattern (ends in .html) we:

  • reverse the file renaming (.html -> .md),
  • open that original file (on failure, fallback to the serve_static_file for original requested path),
  • convert,
  • return with file change watching for that file.

How to use as a library

Hi, I'd love to use your project as a dependency for a tool I'm planning.

Could you please add an example of how to use it to convert Markdown String into HTML String?

--include-images 'remote' flag not working

When I have a markdown file input.md with the following contents:

![](https://fastly.picsum.photos/id/237/536/354.jpg)

And I run the following command:

marky input.md --include-images 'remote'

I get the following error:

thread 'main' panicked at 'Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.', /Users/jmscdch/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.26.0/src/runtime/blocking/shutdown.rs:51:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior would be that the image gets downloaded, converted to base64 and embedded in the HTML file.

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.