Coder Social home page Coder Social logo

aumitleon / markdown_html_converter Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 5.0 89 KB

Python module for converting Markdown files to HTML

Home Page: https://markdown-html-converter.rtfd.io

License: MIT License

Python 66.62% Shell 14.76% HTML 18.62%
circleci converter html markdown module pypi python

markdown_html_converter's Introduction

Hi there πŸ‘‹

I'm Aumit Leon, a Software Engineer building performant, scalable, and secure APIs and data pipelines ⚑

  • πŸ”­ Working on building a best in class ads platform as part of the Amplify mission at Spotify.
  • 🌱 Hacking on end to end Machine Learning, NLP, ML pipelines and workflow orchestration.
  • πŸ’¬ Thinking about sustainable software, organizations, and practices.
  • πŸ’» https://aumitleon.dev/

markdown_html_converter's People

Contributors

ajaydwarkani avatar aumitleon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

markdown_html_converter's Issues

Add a header

Hello,
I want to add some css to the html files.
The best method is to allow an option to insert some custom headers into the generated html.
Do you have an idea how to implement it ?

Attempting to upload older distributions

The semantic-release step:

- run:
name: upload to pypi
command: |
git config --global user.email "[email protected]"
git config --global user.name "aumitleon"
. venv/bin/activate
semantic-release publish --retry

When there should be a new version generated, that version is properly uploaded to PyPI, but semantic-release also attempts to upload the previous version as well, causing an error:
screen shot 2018-09-03 at 2 42 59 pm

The --retry option simply adds new changes to the current version, and republishes. The issue is that in the python-semantic-release codebase, the retry boolean is tied to the skip-existing boolean for twine, which python-semantic-release uses to upload distributions.

This is a semantic mismatch, as the retry option doesn't directly match what skip-existing attempts to do. This would be solved if skip-existing were set to true, by default.

Should be resolved by python-semantic-release/python-semantic-release#87

No module named 'converter'

Os: windows 10/64
Python: 3.7/64
Issue Description:
When I run command 'md-to-html -i ***.md -o ***.html' by 'cmd', It prompted me with an error "ModuleNotFoundError: No module named 'converter'". I have reinstalled this module many times by 'pip', but it doesn't work. I think this module is very convenient for me, and I also would like to contribute back to it.

Support complex nested markdown elements

As of release 0.4.2, we don't support nested markdown elements. In particular, the following markdown:

# this is a tile and link [text](link)

produces the following HTML:

<!DOCTYPE html>
<!--Converted via md-to-html-->
<html>
        <head>
        </head>
        <body>
                <h1><a href='link'>text</a></h1>
        </body>
</html>

In particular, we correctly identify the heading type and the link, but the text.

Properly support lists

Currently, the code creating a new list for each bullet point encountered:

def list_md_to_html(matches, text):
bullet_html = "\t\t<ul>\n"
for match in matches:
if match[0] == "*":
if len(matches) > 1:
bullet_html += "\t\t\t<li>" + inner_tags(matches) + "</li>\n"
else:
bullet_html += "\t\t\t<li>" + text[0] + "</li>\n"
bullet_html += "\t\t</ul>\n"
return bullet_html

This creates a scenario in which each individual bullet point has its own list. The following markdown

* point 1
* point 2
* point 3

is currently rendered as:

<ul>
  <li> point 1 </li>
</ul>
<ul>
  <li> point 2 </li>
</ul>
<ul>
  <li> point 3 </li>
</ul>

In reality, this should be rendered as:

<ul>
  <li> point 1 </li>
  <li> point 2 </li>
  <li> point 3 </li>
</ul>

Overwrite file

When creating a new converted HTML file, overwrite as opposed to appending.

'encoding' is an invalid keyword argument for this function

I try co convert my md document to hml and I had this error message:

Traceback (most recent call last):
  File "/usr/local/bin/md-to-html", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/src/converter.py", line 26, in main
    html_doc = open(args.output, "w", encoding="utf-8")
TypeError: 'encoding' is an invalid keyword argument for this function

I have Python 2.7.17 on Ubunti 18.04.1

Application was installed with pip:
sudo pip install md-to-html

Application was run from command line:
md-to-html --input 01-Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ.md

Python3 Compatibility

Python 2 is being retired at the end of 2019. The module should be compatible with Python 3 distributions.

Don't convert table

This markdown syntax is not converted in Html:

cellule 1 cellule 2
A B
C D
Best regards

I use CLI

Add a code formatter

Adding a code formatter with githook ensures that the development lifecyle across machine and dev environment is consistent.

Adding erroneous bullet to list

The following markdown:

# This is a test document
* lol this is cool
* awesome links [text](link).
### Nice!
[test](document)
* seperate list

Produces the following HTML:

<!DOCTYPE html>
<!--Converted via md-to-html-->
<html>
        <head>
        </head>
        <body>
                <h1>This is a test document</h1>
                <ul>
                        <li>lol this is cool</li>
                        <li><a href='link'>text</a></li>
                </ul>
                <h3>Nice!</h3>
                <a href='document'>test</a>
                <ul>
                        <li>lol this is cool</li>
                        <li><a href='link'>text</a></li>
                </ul>
        </body>
</html>

In particular, the final link should not be a list item.

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.