Code Monkey home page Code Monkey logo

ansi's People

Contributors

jenisys avatar jnrowe avatar mforbes avatar ssbarnea avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ansi's Issues

Reviving sphinxcontrib-ansi

That is a tracking ticket for actions needed for bringing back the project to being actively maintained:

Support for Sphinx >= 2.0

sphinxcontrib-ansi is using some old-style Sphinx APIs that are removed in Sphinx v2.x:

  • app.info() (use: sphinx.util.logging)
# -- SPHINX-BUILD OUTPUT:
...
Running Sphinx v1.8.5
...
/xxx/.venv_py37/lib/python3.7/site-packages/sphinxcontrib/ansi.py:180: RemovedInSphinx20Warning: app.info() is now deprecated. Use sphinx.util.logging instead.
  app.info(bold('Copying ansi stylesheet... '), nonl=True)
Copying ansi stylesheet... 
/xxx/.venv_py37/lib/python3.7/site-packages/sphinxcontrib/ansi.py:184: RemovedInSphinx20Warning: app.info() is now deprecated. Use sphinx.util.logging instead.
  app.info('done')
...

ANSI Codes in output (e.g. from sphinx gallery)

Hopefully this is a reasonable place to ask this question:

I have some program that has terminal output with ANSI color codes that nicely display color in the terminal, but will show the literal ANSI codes in the HTML output unfortunately.
As a simple example, let's say I have some python file like this:

# -*- coding: utf-8 -*-
"""
Plot The Marvelous Colors
=========================

"""

print('\033[94m' + "hi" + '\033[0m')

then in doc after building with sphinx gallery unfortunately I get this:

�[94mhis�[0m

This can also be seen in the second-last cell here:
https://braindecode.org/auto_examples/plot_bcic_iv_2a_moabb_trial.html

Is this something that this package would try to handle? Or do you know where else I might ask?

Outdated Sphinx API Error

Gettting the following error message with the add_stylesheet call, which has been deprecated in favor of add_css_file

Extension error (sphinxcontrib.ansi):
Handler <function add_stylesheet at 0x103fcadc0> for event 'builder-inited' threw 
an exception (exception: 'Sphinx' object has no attribute 'add_stylesheet')

I can submit a PR if needed.

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.