bast / cicero

:microphone: Serving presentation slides written in Markdown.
https://cicero.xyz
GNU Affero General Public License v3.0
55 stars 17 forks source link

Make it work locally with Windows #56

Open arnfinn opened 6 years ago

arnfinn commented 6 years ago

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 git@github.com:arnfinn/presentasjoner.git
cicero --file presentasjoner/utf8.md --debug

Then go to http://127.0.0.1:5000/

arnfinn commented 6 years ago

Error in this line in templates\render.html (see the whole traceback below):

{% include 'engines/' + engine + '/body.html' %}

It has probably something to do with how they do paths on windows.

 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
  File "p:\venv\lib\site-packages\flask\app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "p:\venv\lib\site-packages\flask\app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "p:\venv\lib\site-packages\flask\app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "p:\venv\lib\site-packages\flask\app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "p:\venv\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "p:\venv\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\flask\_compat.py", line 33, in reraise
    raise value
  File "p:\venv\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "p:\venv\lib\site-packages\flask\app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "p:\venv\lib\site-packages\cicero\preview.py", line 59, in home
    engine=config['engine'])
  File "p:\venv\lib\site-packages\flask\templating.py", line 128, in render_template
    context, ctx.app)
  File "p:\venv\lib\site-packages\flask\templating.py", line 110, in _render
    rv = template.render(context)
  File "p:\venv\lib\site-packages\jinja2\asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "p:\venv\lib\site-packages\jinja2\environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "p:\venv\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "p:\venv\lib\site-packages\jinja2\_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "p:\venv\lib\site-packages\cicero\templates\render.html", line 20, in top-level template code
    {% include 'engines/' + engine + '/body.html' %}
  File "p:\venv\lib\site-packages\flask\templating.py", line 64, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: engines/remark-0.13.0/body.html
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=jquery.js HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=debugger.js HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:05] "GET /?__debugger__=yes&cmd=resource&f=ubuntu.ttf HTTP/1.1" 200 -
127.0.0.1 - - [05/Jun/2018 14:03:06] "GET /?__debugger__=yes&cmd=resource&f=console.png HTTP/1.1" 200 -
bast commented 6 years ago

I will test it out on Azure - thanks for reporting.

arnfinn commented 6 years ago

We have to play our cards right in this new Windows era :smile:

bast commented 6 years ago

Can you try the following:

Does this work? Because at least on Azure it worked then (but I got same error when serving from a clone). And the reason was that Windows did not understand symlinks. But I did not try in Git bash but rather from https://www.msys2.org.

arnfinn commented 6 years ago

I will, tomorrow (only windows @ work).

Thanks for looking at this!

bast commented 6 years ago

If this works then I need to think what to do about the symlinks. Of course I can get rid of them with some code duplication if needed.

arnfinn commented 6 years ago

I was not able to make it work.

bast commented 6 years ago

OK I need to test with Git bash then.

bast commented 6 years ago

Can we perhaps debug this together? Such an incredible struggle for me to get a Git bash going with Python.

bast commented 6 years ago

Alternative: can you try on https://www.msys2.org?

arnfinn commented 6 years ago

I can try to have a look at it next week. It is not very important for me that it is working on Windows, so please do not struggle for me:)