Git Product home page Git Product logo

markdown2html-converter's Introduction

Markdown to HTML Converter

CI

Markdown to HTML Converter is a free tool for converting a Markdown file to a single HTML file with built-in CSS and JS.

Help

EXAMPLES:
markdown2html-converter /path/to/file.md                           # Convert /path/to/file.md to /path/to/file.html, titled "file"
markdown2html-converter /path/to/file.md -o /path/to/output.html   # Convert /path/to/file.md to /path/to/output.html, titled "output"
markdown2html-converter /path/to/file.md -t 'Hello World!'         # Convert /path/to/file.md to /path/to/file.html, titled "Hello World!"

Usage: markdown2html-converter [OPTIONS] <MARKDOWN_PATH>

Arguments:
  <MARKDOWN_PATH>  Specify the path of your Markdown file

Options:
  -t, --title <TITLE>                            Specify the title of your HTML file
  -o, --html-path <HTML_PATH>                    Specify the path of your HTML file
  -f, --force                                    Force to output if the HTML file exists
      --no-safe                                  Allow raw HTML and dangerous URLs
      --no-highlight                             Not allow to use highlight.js
      --no-mathjax                               Not allow to use mathjax.js
      --no-cjk-fonts                             Not allow to use CJK fonts
      --css-path <CSS_PATH>                      Specify the path of your custom CSS file
      --highlight-js-path <HIGHLIGHT_JS_PATH>    Specify the path of your custom highlight.js file
      --highlight-css-path <HIGHLIGHT_CSS_PATH>  Specify the path of your custom CSS file for highlight.js code blocks
      --mathjax-js-path <MATHJAX_JS_PATH>        Specify the path of your custom single MATH_JAX.js file
  -h, --help                                     Print help
  -V, --version                                  Print version

Dependency

Markdown is converted to HTML by the comrak crate. The default stylesheet (the CSS file) is from sindresorhus/github-markdown-css.

If ``` is used in the input Markdown file, the highlight.js will be automatically embedded in the output HTML file. The preset supported languages are listed below.

  • Apache
  • Bash
  • C
  • C#
  • C++
  • CSS
  • Diff
  • Dockerfile
  • Go
  • HTML, XML
  • JSON
  • Java
  • JavaScript
  • Kotlin
  • Less
  • Lua
  • Makefile
  • Markdown
  • Nginx
  • Objective-C
  • PHP
  • PHP Template
  • Perl
  • Python
  • Python REPL
  • R
  • Ruby
  • Rust
  • SCSS
  • SQL
  • Shell
  • Swift
  • TOML, INI
  • TypeScript
  • Visual Basic .NET
  • YAML

If #{{ - }}# or #{{{ - }}}# is used in the input Markdown file, the mathjax.js will be automatically embedded in the output HTML file. #{{ and }}# are inlineMath delimiters. #{{{ and }}}# are displayMath delimiters. The default mathjax.js are using the tex-mml-chtml configuration file.

A Markdown Example

The Markdown File

The HTML File

License

MIT

markdown2html-converter's People

Contributors

magiclen 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

markdown2html-converter's Issues

CSS matches system color mode, but highlight does not

CSS matches system color mode, but highlight.js does not. This makes it such that code blocks have very low contrast when using dark mode. Here is an example:

dark

light

I think the fix may require changes to highlight.js, but would be happy to make a PR with changes to integrate upstream fixes.

how do i specify font

i want to tell the converter that i want custom font-family

is there a possible way to do that ?

backtick is interpreted as code instead of asciimath

In mathjax when you write:

`sqrt3+pi`

it would convert to this text as asciimath. but rather i don't know why, but it converts into

<code>sqrt3+pi</code>

please fix this bug. I want to interpret asciimath as it is.

Need release for Windows and MacOS

Hi, dear @magiclen!
Are you planning to create a release of your program for Windows/MacOS?

Tell me, what kind of help do you need? I suggest for writing github action: so that when you push to the master branch with a certain tag, a release is automatically created.

Fix default architecture

I tried to compile this project under Ubuntu 20.04, but got a lot of errors. The cause was hardcoded arch. I changed all x86_64-unknown-linux-musl by x86_64-unknown-linux-gnu in Makefile and then compilation was OK. I suppose you need to document it or get the arch via rustc -vV|grep 'host:' | sed 's/host: //', and then use it in your Makefile.

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.