Git Product home page Git Product logo

md-to-html's Introduction

md-to-html

Following John Gruber's Markdown syntax guide with some exceptions, listed below.

  • May not work well when numbered and unnumbered lists are combined.
  • Inline HTML is not supported yet.
  • Every word surrounded by two colons (:likethis:) is assumed to be an emoji and thus becomes a unicode star.
  • Links that are referenced by using brackets ([like this] [reference]) are not supported.

How to try this script

Run this from your terminal:

git clone https://github.com/stamby/md-to-html
cd md-to-html
./md-to-html.sed example.md > /tmp/example.html

Then open file:///tmp/example.html with your browser to see the result.

It also works this way on Bash:

./md-to-html.sed <<< '1. Hello!'

The output of that being:

<ol>
<li>Hello!</li>
</ol>

md-to-html's People

Contributors

stamby 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

Watchers

 avatar

Forkers

ghoulmann

md-to-html's Issues

Using this on script

Hi. I'm trying to paste this into a shell script, so I don't need the sed file. But I'm getting errors. This is what I've done:

md() {
    exp=$(cat <<-EOF
<the content of your sed file>
...
EOF
)
   sed -E "$exp" file.md
}

When I call this function I get the error:

bash: /{: No such file or directory
bash: x: command not found
bash: /^: No such file or directory
bash: /{: No such file or directory
bash: x: command not found
bash: b: command not found
bash: command substitution: line 4: syntax error near unexpected token `}'
bash: command substitution: line 4: `}'
bash: command substitution: line 2: syntax error near unexpected token `^'
bash: command substitution: line 2: `s/(^|[^\\'
bash: command substitution: line 2: syntax error: unexpected end of file
bash: command substitution: line 2: syntax error: unexpected end of file
bash: s/\t/  /g
< all other sed commands >
...
...
: bad substitution
# example

Paragraph.

- it
- works

## bye

I don't know it this is a paste error or quoting error.

Can you help?

Thanks

=>/<= converted into ≥/≤

Great script, I really love it that I do not have to install 100+MB pandoc to convert some basic Markdown to HTML. Thank you for the script!

I think I found a bug:

$> printf "\`\`\`\narrow function => return\n\`\`\`" | ./md-to-html.sed
<pre><code>arrow function &amp;ge; return
</code></pre>

The script converts my "=>" into ≥. I think this is not necessary and lines 9, 10, 19 and 20 can safely be removed, correct?

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.