Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: IPython notebook support #7

Open
9 tasks
westurner opened this issue Dec 26, 2014 · 2 comments
Open
9 tasks

ENH: IPython notebook support #7

westurner opened this issue Dec 26, 2014 · 2 comments
Labels

Comments

@westurner
Copy link
Owner

  • load accounts config from <config_file> as current context
    • pypfi.conf
    • Session ?
  • Account.reports.report_type() should yield objects with IPython display methods:
    • _repr_html_
    • _repr_javascript_
    • _repr_json_
  • JS TOC Ipython widget?
    • CSS
@westurner westurner added the ENH label Dec 26, 2014
@westurner
Copy link
Owner Author

From https://www.reddit.com/r/IPython/comments/2qae4s/ipython_repr_method_examples/cn5ko02 :


So, from (https://github.com/ipython/ipython/blob/master/IPython/utils/capture.py and https://github.com/ipython/ipython/blob/master/IPython/utils/tests/test_capture.py#L27) and
(https://github.com/ipython/ipython/blob/master/IPython/core/display.py and https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_display.py) :

_mime_map = dict(
    _repr_png_="image/png",
    _repr_jpeg_="image/jpeg",
    _repr_svg_="image/svg+xml",
    _repr_html_="text/html",
    _repr_json_="application/json",
    _repr_javascript_="application/javascript",
)

# _repr_latex_ = "text/latex"
# _repr_retina_ = "image/png"

@westurner westurner changed the title ENH: IPython _repr_html_ _repr_javascript_methods ENH: IPython notebook support Dec 26, 2014
@westurner
Copy link
Owner Author

From https://github.com/westurner/pypfi/blob/master/pypfi/pypfi.py#L224 (pypfi.pypfi.HTML_HEADER) :

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/stylesheets/jquery.tocify.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/floatthead/1.2.8/jquery.floatThead.min.js"></script>
<script>
$(document).ready(function() {
    $("table.table").floatThead();
    $('h2,h3,h4,h5,h6').css('display', 'inline-table').after('<a class="headerlink" href="#">^</a>');
    $("#toc").tocify({
        selectors: "h2,h3,h4,h5,h6",
        showAndHide: false,
        hashGenerator: "pretty",
        scrollHistory: true,
        extendPage: false
        });
});
</script>
<style>
.table-condensed>thead>tr>th,
.table-condensed>tbody>tr>th,
.table-condensed>tfoot>tr>th,
.table-condensed>thead>tr>td,
.table-condensed>tbody>tr>td,
.table-condensed>tfoot>tr>td {
    padding: 2px !important;
}
table.floatThead-table {
    border-top: none;
    border-bottom: none;
    background-color: #FFF;
}
.tocify {
   position: static;
   margin-left: 0;
   width: inherit;
   max-height: inherit;
}
.tocify-subheader {
    text-indent: 20px;
    display: inherit !important;
}
a.headerlink {
    color: #F2F2F2;
    padding: 0 4px 0 4px;
    text-decoration: none;
}
</style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant