Code Monkey home page Code Monkey logo

cicero's Introduction

cicero's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cicero's Issues

Cicero doesn't check if the file exists when using -f

This seems to work:

cicero -f aoijoiwjd.mkd

but when I load the page I get "Internal Server Error" and this in the console:

[2016-10-26 11:45:07,635] ERROR in app: Exception on /favicon.ico [GET]
Traceback (most recent call last):
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/app.py", line 1539, in handle_user_exception
    return self.handle_http_exception(e)
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/app.py", line 1498, in handle_http_exception
    return handler(e)
  File "/home/olemb/src/cicero/cicero/app.py", line 16, in page_not_found
    return render_template('404.html'), 404
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/home/olemb/.local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/olemb/.local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/olemb/src/cicero/cicero/templates/404.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/home/olemb/src/cicero/cicero/templates/base.html", line 45, in top-level template code
    {% block content %}
  File "/home/olemb/src/cicero/cicero/templates/404.html", line 11, in block "content"
    <a href="{{ url_for('home') }}">nice</a>.
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/helpers.py", line 332, in url_for
    return appctx.app.handle_url_build_error(error, endpoint, values)
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/app.py", line 1811, in handle_url_build_error
    reraise(exc_type, exc_value, tb)
  File "/home/olemb/.local/lib/python2.7/site-packages/flask/helpers.py", line 322, in url_for
    force_external=external)
  File "/home/olemb/.local/lib/python2.7/site-packages/werkzeug/routing.py", line 1758, in build
    raise BuildError(endpoint, values, method, self)
BuildError: Could not build url for endpoint 'home'. Did you mean 'preview.home' instead?
127.0.0.1 - - [26/Oct/2016 11:45:07] "GET /favicon.ico HTTP/1.1" 500 -

Overriding/extending CSS, JS and HTML standard "modules"

Is there a standard way to override and/or extend the standard "modules" that configure cicero? A use case I have in mind is when I want to use a local version of MathJax or set up some TeX macros for it. It seems like I need to modify cicero's sources to do that and always serve locally.

Design of v3 API

Goal of this issue thread is to agree on v3 of the API and iron out some known issues (listed below).

Current headaches with v2:

  1. When upgrading remarkjs, talks can suddenly break. The remarkjs dependency is now implicit and we may want to make it more explicit to avoid "slide deck rot".
  2. We maintain CSS customization (slide splits, colors, footnote) on top of remarkjs which may become difficult to maintain centrally when upgrading remarkjs.
  3. We maintain JS customization (mathjax and code highlighting) on top of what remarkjs provides which may become difficult to maintain centrally when upgrading remarkjs.

Change slide ratio

I would like to make a 16:9 presentation. Is that possible through Cicero? With Remark it is something like this:

var slideshow = remark.create({ ratio: "16:9" });

Sidenote: Are there still places you have to use 4:3?

Make it work locally with Windows

I do not think it is possible at the moment.

How to test it (if you are on a Windows machine with Python 3.6 using Git Bash)

virtualenv venv
source venv/Scripts/activate # Scripts instead of bin on Windows...
pip install git+https://github.com/bast/cicero.git@master#egg=cicero
git clone [email protected]:arnfinn/presentasjoner.git
cicero --file presentasjoner/utf8.md --debug

Then go to http://127.0.0.1:5000/

Reorganize apps with blueprints

Today we have separate apps for server and preview mode. This leads to duplicate code and makes it impossible to pass config parameters to the Flask contructor based on the command line.

We could fix this by switching to blueprints: http://flask.pocoo.org/docs/0.10/blueprints/

The code would then look something like this:

server = flask.Blueprint('server')

@server.route('/')
def home():
    ...


def main():
    args = parse_args()

    app = flask.Flask('Cicero',
                      template_folder=paths.TEMPLATE_FOLDER,
                      static_folder=paths.STATIC_FOLDER)

    if args.filename:
        app.config['filename'] = args.filename
        app.register_blueprint(preview)
    else:
        app.register_blueprint(server)

    app.register_blueprint(common)

Visiting bad URLs should give a 404 instead of server error

I was linked to someone's slides on cicero, and didn't know what it was, so I decided to move up a few levels in the URL hierarchy. Every level between the .md file and cicero.xyz gives an internal server error.
Non-matching URLs should give a 404 message, with a link up to cicero.xyz.

Does not work with ANSI encoding

I am not sure if it is a big deal, but I get an "Internal Server Error" if the md-file is encoded with ANSI (windows). It is probably only a problem if the file contains special characters (like Norwegian letters). See example below.

With ANSI encoding:
http://cicero.xyz/v2/remark/github/arnfinn/presentasjoner/master/ansi.md

With UTF-8 encoding (the same presentation):
http://cicero.xyz/v2/remark/github/arnfinn/presentasjoner/master/utf8.md

v3 also does not work: http://cicero.xyz/v3/remark/0.14.0/github.com/arnfinn/presentasjoner/master/ansi.md

Local preview broken

The local preview works only if the markdown file is in the same directory as the Python scripts:
python cicero.py -f demo.mkd
renders correctly to 0.0.0.0:5000
while:
python ~/path/to/cicero.py -f my_file.mkd
gives an error in the browser.

suggested license change to AGPL

@robertodr @olemb I would like to suggest changing license to Affero GPL:
https://www.gnu.org/licenses/why-affero-gpl.html

I think this license is more appropriate for programs behind web services.

In particular:

The GNU Affero General Public License is a modified version of the ordinary GNU GPL
version 3. It has one added requirement: if you run a modified program on a server
and let other users communicate with it there, your server must also allow them to
download the source code corresponding to the modified version running there.

In other words running a web service then equals to distributing the code. I personally care much more about share-alike than permissiveness.

What is your opinion?

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.