Coder Social home page Coder Social logo

krausefx / markdown-to-html-github-style Goto Github PK

View Code? Open in Web Editor NEW
218.0 218.0 130.0 1.03 MB

Generate a simple HTML page based on a markdown file, that looks like GitHub's stylesheet

Home Page: https://krausefx.github.io/markdown-to-html-github-style/

License: MIT License

JavaScript 17.73% CSS 21.17% HTML 61.10%

markdown-to-html-github-style's People

Contributors

krausefx avatar wazum 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  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  avatar

markdown-to-html-github-style's Issues

Make this project usable by providing a CLI

Right now it's mostly a proof of concept, because I needed it for myself for WalkWithFriends.net, this CLI should provide options for an input and output path, and be distributed via a dependency manager to actually include this in a project.

Since most of this project is just the style.css file, we could easily add multiple implementations, like Ruby, to make it easy to integrate it into all kinds of projects.

How to automatically use your style.css

Dear Felix,

Thank you for providing this repository!

For our bioinformatics work at the DRESDEN-concept Genome Center, we started to write Markdown files to provide READMEs to our collaborators. We are currently using Gitlab for that, and wrote our first CI/CD script to automatically generate HTML and PDF files when a Markdown file has been changed.

The basic pandoc-generated files look pretty ugly, so I started to play around to make them prettier. I followed your recipe today, and ran into a question.

First, I tried pandoc --standalone --css="style.css" (and various versions of it), but it would not incorporate the CSS file properly.

Then, I pretty literally followed your advise and automatically "injected" the content of your style.css file to the end of the basic pandoc-generated HTML file. That worked!

# Convert Markdown to HTML 
pandoc --standalone --from=markdown --to=html $file -o "doc/${id}.html"

# Add CSS at the bottom of the HTML
# Remove last two lines
mv doc/${id}.html doc/${id}_orig.html
head -n -2 doc/${id}_orig.html > doc/${id}.html

# Inject CSS file
echo "<style type='text/css'>" >> doc/${id}.html
cat style.css >> doc/${id}.html

# Close blocks again
echo "</style>" >> doc/${id}.html
echo "</body>" >> doc/${id}.html
echo "</html>" >> doc/${id}.html

It looks so much better than before, but I still wouldn't get the same text width (it looks quite narrow) and am missing the outer border. Would you have any idea?

Thanks a lot in advance!
Best wishes from Dresden :)
Katrin

Improve support for images

I haven't had the time to test this yet, but images on GitHub behave quite nicely. It might be that this project doesn't properly render images yet

"hljs" artefact in code environment?

Hi,

when I generate HTML from the following page:

```
Type :   Extensible
Order:   Significant
Root :   Yes
```

I get:

grafik

Where does the hljs come from? I have recent versions of markdown-to-html-github-style and showdown installed.

Thanks!
Michael

Open links to external hosts in new tab

Use target=_blank for all links that link to another domain. This will require knowledge of its own domain, for absolute URLs going to its own domain. Might be good enough without specifying its own host, and assume relative URLs

<meta charset="UTF-8"> by default?

It seems to be a de facto practice on modern web sites to use UTF-8, i.e.

<head>
  <meta charset="UTF-8">
</head>

This way one does not need to write the awkward &auml; etc. codes to represent letter ä for example. Maybe it would make sense to have that meta tag be generated in all output by default?

Add support for syntax highlighting

Code blocks currently don't support syntax highlighting, however that's something that's rather easy to add. For a minimalistic stylesheet we could take the styles from krausefx.com/css.

There are many libraries that support syntax highlighting to HTML, some even come with nice stylesheets. We gotta find one that's similar to GitHub

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.