Coder Social home page Coder Social logo

Comments (8)

tonylampada avatar tonylampada commented on July 23, 2024

Found this --> https://github.com/isaacs/github-flavored-markdown/blob/master/scripts/showdown.js

Ran a few tests, it's already way better than no formatting at all.
But I'd still rather format it on the server side. Syntax highlighting for code blocks would be nice too.

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

Deployed to production, but with a javascript renderer.
It works, but an actual Python renderer is the right tool for the job.

I tried combining this with this. But the results are not so good.

relevant code --> https://github.com/freedomsponsors/www.freedomsponsors.org/blob/master/djangoproject/core/models.py
(see IssueComment.toHTML)

If anyone knows of a working Python GFM implementation, please let me know!
Syntax highlighting is a plus.

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

A few pointers

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

Got a working sample with misaka and Pygments, as pointed out by Eduardo Cereto here (thanks dude!)

A better renderer - with syntax highlighting - should be up soon.

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

For the record, here's what one will need to reproduce it:

  • Install Misaka and Pygments
  • Setup a rendering funcion more or less like this.

There's a running sample in the test environment. Will be in production soon.

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

Ok, done
http://blog.freedomsponsors.org/markdown_formatting/

from www.freedomsponsors.org.

Depado avatar Depado commented on July 23, 2024

Man, you're actually the only lead I had to find out how to do that. Thanks a lot for the great work.

from www.freedomsponsors.org.

tonylampada avatar tonylampada commented on July 23, 2024

Yay, glad this was useful to someone :)

from www.freedomsponsors.org.

Related Issues (20)

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.