Giter VIP home page Giter VIP logo

presentationcodeformatter's Introduction

DEPRECATED

The project got superseded by the CodeImageGenerator project, which creates generally usable images instead of Presentation-specific output.

PresentationCodeFormatter

PresentationCodeFormatter is a Python script, which converts Java files/functions to a text file, which is readable by Presentation. This includes a rough custom syntax highlighting with Pygments.

I personally use this to convert short code snippets for empirical research on program comprehension (see Brains on Code). This means the script is personalized to my specific usage and probably not directly useful to you without changes.

Disclaimer: I am not a Python programmer. I'm always grateful for feedback on how to improve my code.

Features

The main feature is to read all files from a directory and attempting to add syntax highlighting compatible with the syntax of Presentation to the output file(s).

Implemented so far:

  • Reads all files from a directory, and parses one at a time
  • Extracts just the function code from the file (and ignores the class, comments, etc around it)
  • Uses Pygments to create syntax highlighting for each function
  • Parses Pygments syntax highlighting to a Presentation-compatible format (still may be incomplete)
  • Wraps code into a Presentation variable for seamless integration
  • Output in separate files, or one large file

Roadmap

Things I still want to add:

  • Command line support
  • Better configuration (in particular the output color scheme)
  • Allow multiple functions per file
  • Allow functions besides public int, public String, public boolean
  • Only read Java files
  • Support for more languages than just Java

Setup

The project should run in any Python environment. It was developed and tested with the PyCharms IDE.

License

MIT License

Copyright (c) 2017 Norman Peitek

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.