Code Monkey home page Code Monkey logo

markdown-gen's Introduction

markdown-gen (mdg)

  • A command line tool that can generate markdown using some options.

Dependencies

Install

  • Linux
sudo pip3 install md-toc
chmod +x cli.py
sudo ln -s /usr/bin/mdg /xxx/cli.py
  • Windows
# waiting...

Usage

$ mdg generate --help

# Usage: mdg generate [OPTIONS] INPUT_FILE
#
#   Generate markdown by options.
#
# Options:
#   -o, --output TEXT  Output file path.  [required]
#   --force            Force to save.
#   --center_image     Make images center.
#   --en_punctuation   Use English punctuations.
#   --katex_image      Use image for katex equation.
#   --add_toc          Add table of content.
#   --copy_image       Copy image to current folder.
#   --help             Show this message and exit.

Reference

markdown-gen's People

Contributors

aoi-hosizora avatar

Watchers

James Cloos avatar

markdown-gen's Issues

TOC in github

Add TOC only for # ## and ### with [xxx](#yyy) format, need to handle yyy link.

Vanishing Gradients and Fancy RNNs => #vanishing-gradients-and-fancy-rnns
Machine Translation, Seq2Seq and Attention => #machine-translation-seq2seq-and-attention
Vanishing gradient intuition & Exploding gradient => #vanishing-gradient-intuition--exploding-gradient
a,b a;b => #ab #ab-1
a【b】c[d]e(f)g(h)i => #abcdefghi
& ( , 【】[]()() | | => # #-1 #-2 #-3 #-4
测试 テスト déjà vu => #测试 #テスト #déjà-vu

Current task

0. check input and output file
1. center image
2. English punctuation
3. KaTeX symbols
4. trim spaces around \n
5. add [TOC]
6. copy image

KaTeX render helper

https://www.codecogs.com/latex/eqneditor.php

%5Cdpi%7B120%7D%20%5Cbg_white%20%5Clarge%20%5Cbegin%7Baligned%7D%20y%27_x%20%26%3D%20%5Cbegin%7Bcases%7D%20%5Cfrac%7B%5Cpartial%20y%7D%7B%5Cpartial%20x%7D%20%26%5Ctext%7Bif%20%7D%201%20%5C%5C%20%5Cfrac%7B%5Ctext%7Bd%7D%20y%7D%7B%5Ctext%7Bd%7D%20x%7D%20%26%5Ctext%7Bother%7D%20%5Cend%7Bcases%7D%20%5C%5C%20%5C%3B%5C%5C%20X%20%26%3D%20%5Cbegin%7Bpmatrix%7D%20x_%7B11%7D%20%26%20x_%7B12%7D%20%26%20%5Cdots%20%26%20x_%7B1n%7D%20%5C%5C%20x_%7B21%7D%20%26%20x_%7B22%7D%20%26%20%5Cdots%20%26%20x_%7B2n%7D%20%5C%5C%20%5Cvdots%20%26%20%5Cvdots%20%26%20%26%20%5Cvdots%20%5C%5C%20x_%7Bm1%7D%20%26%20x_%7Bm2%7D%20%26%20%5Cdots%20%26%20x_%7Bmn%7D%20%5C%5C%20%5Cend%7Bpmatrix%7D%20%5C%5C%20%5C%3B%5C%5C%20Z%20%26%3D%20%5C%3B%3F%20%5Cend%7Baligned%7D
\dpi{120} \bg_white \large \begin{aligned} y'_x %26%3D \begin{cases} \frac{\partial y}{\partial x} %26\text{if } 1 \\ \frac{\text{d} y}{\text{d} x} %26\text{other} \end{cases} \\ \%3B\\ X %26%3D \begin{pmatrix} x_{11} %26 x_{12} %26 \dots %26 x_{1n} \\ x_{21} %26 x_{22} %26 \dots %26 x_{2n} \\ \vdots %26 \vdots %26 %26 \vdots \\ x_{m1} %26 x_{m2} %26 \dots %26 x_{mn} \\ \end{pmatrix} \\ \%3B\\ Z %26%3D \%3B%3F \end{aligned}
\begin{aligned}

y'_x &= \begin{cases}
\frac{\partial y}{\partial x} &\text{if } 1 \\
\frac{\text{d} y}{\text{d} x} &\text{other}
\end{cases} \\

\;\\

X &= \begin{pmatrix}
x_{11} & x_{12} & \dots & x_{1n} \\
x_{21} & x_{22} & \dots & x_{2n} \\
\vdots & \vdots &       & \vdots \\
x_{m1} & x_{m2} & \dots & x_{mn} \\
\end{pmatrix} \\

\;\\

Z &= \;?

\end{aligned}

image

English punctuation

Need to check some Chinese punctuation and English punctuation space rules.
Such as: “test",(test)。 => "test", (test)., it is not always "test" , (test) .

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.