Git Product home page Git Product logo

md2web's Introduction

md2web

Command line usage

usage: md2web.py [-h] [--template TEMPLATE] [--no-template] markdown_file

positional arguments:
  markdown_file        The Markdown file to convert to HTML.
  
  optional arguments:
    -h, --help           show this help message and exit
	--template TEMPLATE  HTML template file to use for conversion. Defaults to
                         template.html
	--no-template        Don't use a template file.						 

Requirements

Templates

md2web can use templates to keep things looking consistent throughout an entire site. To create a template from scratch, just include whatever you want and make sure to use the following variables somewhere in the document:

  • $CONTENT: This is where all the Markdown-compiled text will be placed.
  • $TITLE: The document title to place between <title> and </title>.

Bugs and Pitfalls

  • Right now, the first line of each source file must be the page title (the text that replaces $TITLE). In the future, this may change to something a little safer.
  • Rather than build in code to determine whether or not a file needs to be rebuilt, something like make should be used instead. See the example makefile in the examples directory.

TODO

[ ] Update usage information to reflect using Jinja2.

[ ] Add support for more output formats (via command-line arguments).

License

md2web is released under the terms of the GNU GPL version 3.

md2web's People

Contributors

mivade avatar

Watchers

 avatar

md2web's Issues

Use of latex extension results in failed XHTML 1.1 validation

Error message example:

Line 13, Column 11: required attribute "type" not specified
    <style>img.latex-inline { vertical-align: middle; }</style>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

This is an issue in mdx_latex.py since it defines this style element but ends up being inserted into the body somewhere. Possible solutions:

  • Remove the style tag completely. It doesn't seem too important.
  • Remove the style tag from mdx_latex.py and add it manually into the template.
  • Use MathJax instead.

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.